test_verify_form.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. /**
  3. * @controller test.php
  4. *
  5. * @var Test $test
  6. * @var User $tester
  7. * @var Location $location
  8. * @var Project $project
  9. * @var Project[] $future_projects
  10. * @var Customer $customer
  11. * @var Template $template
  12. * @var array $fields
  13. * @var string $tester_message
  14. */
  15. use Carbon\CarbonImmutable;
  16. $config = $template->getConfiguration();
  17. $values = $test->getValues(true);
  18. $get_test_details = static function(Test $test) use ($project, $location): array {
  19. $test_details = [];
  20. $test_details["Project"] = sprintf('<a href="/account/projects/%d">%s</a>', $test->project_id, $project->getNameHtml());
  21. $test_details["Status"] = "<span class=\"badge badge-lg badge-" . $test->getStatusClass() . "\">" . $test->getStatusText() . "</span>";
  22. if($test->isVoid()) {
  23. $test_details["Result"] = "<span class=\"badge badge-lg badge-secondary\">Void</span>";
  24. }
  25. else {
  26. $test_details["Result"] = "<span class=\"badge badge-lg badge-" . $test->getPassClass() . "\">" . $test->getPassText() . "</span>";
  27. }
  28. $test_details["Location"] = "<a href=\"/account/locations/$location->id\" target=\"_blank\">" . htmlspecialchars($location->name) . "</a>";
  29. $test_details["Address"] = htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]));
  30. if($test->dts_end) {
  31. $test_details = array_merge($test_details, [
  32. "Duration" => $test->getDisplayDuration(),
  33. "Start" => Util::getDisplayDateTime(strtotime($test->dts_start . " UTC")),
  34. "End" => Util::getDisplayDateTime(strtotime($test->dts_end . " UTC")),
  35. ]);
  36. }
  37. if(in_array($test->getStatus(), [Test::STATUS_CANCELLED, Test::STATUS_COMPLETED], true)) {
  38. $test_details["Verified"] = Util::getDisplayDateTime(strtotime($test->dts_verified . " UTC"));
  39. $test_details["Retest"] = $test->retest ? "Yes" : "No";
  40. }
  41. return $test_details;
  42. };
  43. $tester_details = [
  44. "Name" => "Unassigned"
  45. ];
  46. if($tester) {
  47. $tester_details = [
  48. "Name" => "<a href=\"/account/users/$tester->id\" target=\"_blank\">" . $tester->getDisplayName() . "</a>",
  49. "Date of Birth" => $tester->date_of_birth,
  50. "Gender" => $tester->getGenderText(),
  51. "Phone" => $tester->phone,
  52. "Score" => $tester->score,
  53. ];
  54. $tester_invoice_details = [
  55. "Status" => Test::getStatusTesterInvoiceText($test->status_tester_invoice),
  56. "Generated" => $test->dts_tester_invoice_generated ? Util::getDisplayDateTimeFromUTC($test->dts_tester_invoice_generated) : "N/A",
  57. "Paid" => $test->dts_tester_invoice_paid ? Util::getDisplayDateTimeFromUTC($test->dts_tester_invoice_paid) : "N/A",
  58. ];
  59. if($test->test_travel_cost) {
  60. $tester_invoice_details["Travel Costs"] = "£" . number_format($test->test_travel_cost, 2);
  61. }
  62. else {
  63. $tester_invoice_details["Travel Costs"] = "N/A";
  64. }
  65. if($test->test_travel_cost_description) {
  66. $tester_invoice_details["Travel Cost Description"] = htmlspecialchars($test->test_travel_cost_description);
  67. }
  68. else {
  69. $tester_invoice_details["Travel Cost Description"] = "N/A";
  70. }
  71. if($test->hasTesterInvoicePDF()) {
  72. $tester_invoice_details["PDF"] = "<a href=\"/account/tests/{$test->id}/invoice\" target=\"_blank\">Download Invoice</a>";
  73. }
  74. if($test->hasTravelCostsPhoto()) {
  75. $tester_invoice_details["Photo"] = "<a href=\"/account/tests/{$test->id}/files/travel_costs\" target=\"_blank\">View Photo</a>";
  76. }
  77. }
  78. function render_card_list_group($details) {
  79. ?>
  80. <div class="list-group list-group-flush">
  81. <?php
  82. foreach($details as $title => $html) {
  83. ?>
  84. <div class="list-group-item">
  85. <div class="row" style="overflow: hidden; text-overflow: ellipsis;">
  86. <div class="col-md-auto">
  87. <?=htmlspecialchars($title)?>
  88. </div>
  89. <div class="col-md text-right" style="width: auto; overflow: hidden; text-overflow: ellipsis;">
  90. <?=$html?>
  91. </div>
  92. </div>
  93. </div>
  94. <?php
  95. }
  96. ?>
  97. </div>
  98. <?php
  99. }
  100. ?>
  101. <div class="container mt-3 py-4">
  102. <div class="row">
  103. <div class="col">
  104. <h2>Edit/Verify Test</h2>
  105. </div>
  106. <div class="col-auto justify-self-center">
  107. <div class="dropdown">
  108. <button class="btn btn-secondary dropdown-toggle" type="button" id="actions-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  109. Actions
  110. </button>
  111. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="actions-button">
  112. <a class="dropdown-item" href="/account/projects/<?=$test->project_id?>">View Project</a>
  113. <div class="dropdown-divider"></div>
  114. <a class="dropdown-item" href="/account/tests/<?=$test->id?>/pdf" target="_blank">Generate New PDF</a>
  115. <?php
  116. if($test->hasPDF()) {
  117. $pdf_url = $test->getPDFUrl();
  118. ?>
  119. <a class="dropdown-item" href="<?=$pdf_url?>" target="_blank">View Sent PDF</a>
  120. <?php
  121. }
  122. if($test->hasTesterInvoicePDF()) {
  123. ?>
  124. <a class="dropdown-item" href="/account/tests/<?=$test->id?>/invoice" target="_blank">Download Tester Invoice</a>
  125. <?php
  126. }
  127. if($test->hasTravelCostsPhoto()) {
  128. ?>
  129. <a class="dropdown-item" href="/account/tests/<?=$test->id?>/files/travel_costs" target="_blank">View Travel Costs Photo</a>
  130. <?php
  131. }
  132. ?>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <form method="post">
  138. <input type="hidden" name="submit" value="<?=$_SESSION["csrf_token"]?>" />
  139. <div class="row">
  140. <div class="col-xl-6">
  141. <div class="card mb-3">
  142. <div class="card-header">
  143. Submitted Data
  144. </div>
  145. <div class="card-body">
  146. <?php
  147. $header_count = 0;
  148. foreach($fields as $field) {
  149. $field = $template->applyOverridesToField($field);
  150. if($field->type === "file") {
  151. $path = $test->getDirectory() . "/" . $field->name . ".jpg";
  152. ?>
  153. <div class="row mb-1">
  154. <label class="col-sm-8 col-form-label"><?=htmlspecialchars($field->label)?></label>
  155. <div class="col-sm-4">
  156. <a href="/account/tests/<?=$test->id?>/files/<?=$field->name?>" target="_blank">
  157. <img class="img-fluid rounded" src="/account/tests/<?=$test->id?>/files/<?=$field->name?>" alt="<?=htmlspecialchars($field->label)?>" />
  158. </a>
  159. </div>
  160. </div>
  161. <?php
  162. continue;
  163. }
  164. if(!empty($field->name)) {
  165. $name = $field->name;
  166. if(isset($test->$name)) $field->value = $test->$name;
  167. else if(isset($values[$name])) $field->value = $values[$name];
  168. }
  169. $field->template = $template;
  170. Form::renderField($field);
  171. if($field->type === "header") {
  172. $header_count++;
  173. }
  174. }
  175. ?>
  176. <hr/>
  177. <h3><?=htmlspecialchars(__("Void"))?></h3>
  178. <?php
  179. Form::renderField((object) [
  180. "type" => "checkbox",
  181. "name" => "void",
  182. "value" => $test->void,
  183. "label" => __("Void - All Tests / Venue Closed"),
  184. ]);
  185. if($config->hasAlcohol ?? false) {
  186. Form::renderField((object) [
  187. "type" => "checkbox",
  188. "name" => "void_primary",
  189. "value" => $test->void_primary,
  190. "label" => __("Void - Gaming Test"),
  191. ]);
  192. Form::renderField((object) [
  193. "type" => "checkbox",
  194. "name" => "void_secondary",
  195. "value" => $test->void_secondary,
  196. "label" => __("Void - Alcohol Test"),
  197. ]);
  198. }
  199. Form::renderField((object) [
  200. "type" => "textarea",
  201. "name" => "void_notes",
  202. "label" => __("Void Notes"),
  203. "value" => $test->void_notes,
  204. "maxLength" => 65535,
  205. "helpText" => __("You must fill in this field if any part of the test was void."),
  206. ]);
  207. ?>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="col-xl-6">
  212. <div class="row">
  213. <div class="col-md col-xl-12">
  214. <div class="card mb-3">
  215. <div class="card-header">
  216. Info
  217. </div>
  218. <div class="card-body p-0">
  219. <div id="map" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="17" data-marker="true" style="height: 320px;">
  220. </div>
  221. </div>
  222. <?php
  223. render_card_list_group($get_test_details($test));
  224. ?>
  225. </div>
  226. </div>
  227. <div class="col-md col-xl-12">
  228. <div class="card mb-3">
  229. <div class="card-header">
  230. Tester
  231. </div>
  232. <?php
  233. render_card_list_group($tester_details);
  234. ?>
  235. </div>
  236. <?php
  237. if(isset($tester_invoice_details)) {
  238. ?>
  239. <div class="card mb-3">
  240. <div class="card-header">
  241. Tester Invoice
  242. </div>
  243. <?php
  244. render_card_list_group($tester_invoice_details);
  245. if($test->getTesterInvoiceStatus() === Test::STATUS_TESTER_INVOICE_PENDING) {
  246. ?>
  247. <div class="card-body text-center">
  248. <button class="btn btn-success" type="submit" name="accept_tester_invoice" value="1">
  249. Paid Invoice
  250. </button>
  251. <button class="btn btn-danger" type="submit" name="reject_tester_invoice" value="1">
  252. Reject Invoice
  253. </button>
  254. </div>
  255. <?php
  256. }
  257. ?>
  258. </div>
  259. <?php
  260. }
  261. ?>
  262. </div>
  263. </div>
  264. <?php
  265. if($test->verifier_id && $test->dts_verified) {
  266. $verifier = $test->getVerifier();
  267. $time_verified = CarbonImmutable::parse($test->dts_verified, "UTC")->getTimestamp();
  268. ?>
  269. <div class="card mb-3">
  270. <div class="card-header">
  271. <?=htmlspecialchars(__("Verification Info"))?>
  272. </div>
  273. <div class="list-group list-group-flush">
  274. <div class="list-group-item d-flex justify-content-between">
  275. <div>
  276. <?=htmlspecialchars(__("Verifier"))?>
  277. </div>
  278. <div>
  279. <?=htmlspecialchars($verifier->getDisplayName())?>
  280. </div>
  281. </div>
  282. <div class="list-group-item d-flex justify-content-between">
  283. <div>
  284. <?=htmlspecialchars(__("Verified Date/Time"))?>
  285. </div>
  286. <div>
  287. <?=htmlspecialchars(Util::getDisplayDateTime($time_verified))?>
  288. </div>
  289. </div>
  290. <div class="list-group-item d-flex justify-content-between">
  291. <div>
  292. <?=htmlspecialchars(__("Verifier Notes"))?>
  293. </div>
  294. <div>
  295. <?=$test->getVerifierNotesHtml()?>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. <?php
  301. }
  302. ?>
  303. <div class="card mb-3">
  304. <div class="card-header">
  305. Verification
  306. </div>
  307. <div class="card-body">
  308. <div class="row mb-1 align-items-center">
  309. <label class="col-sm-4 col-form-label col-form-label-sm">Verifier</label>
  310. <div class="col-sm">
  311. <?=htmlspecialchars(Core::$user->getDisplayName())?>
  312. </div>
  313. </div>
  314. <hr />
  315. <section class="mb-4">
  316. <h5><?=htmlspecialchars(__("Overrides"))?></h5>
  317. <?php
  318. if($template->hasPassFail()) {
  319. ?>
  320. <div class="row mb-1">
  321. <label class="col-sm-4 col-form-label col-form-label-sm" for="pass-override">Pass Override</label>
  322. <div class="col-sm">
  323. <select class="form-control form-control-sm" name="pass_override" id="pass-override">
  324. <option value="">None</option>
  325. <option value="1">Pass</option>
  326. <option value="0">Fail</option>
  327. </select>
  328. </div>
  329. </div>
  330. <?php
  331. }
  332. ?>
  333. <div class="row mb-1">
  334. <label class="col-sm-4 col-form-label col-form-label-sm" for="start-override">Start Override</label>
  335. <div class="col-sm">
  336. <input class="form-control form-control-sm" type="datetime-local" name="start_override" id="start-override" />
  337. </div>
  338. </div>
  339. <div class="row mb-1">
  340. <label class="col-sm-4 col-form-label col-form-label-sm" for="end-override">End Override</label>
  341. <div class="col-sm">
  342. <input class="form-control form-control-sm" type="datetime-local" name="end_override" id="end-override" />
  343. </div>
  344. </div>
  345. <div class="row mb-1">
  346. <label class="col-sm-4 col-form-label col-form-label-sm" for="customer-fee">Customer Fee Override</label>
  347. <div class="col-sm">
  348. <div class="input-group input-group-sm">
  349. <div class="input-group-prepend">
  350. <span class="input-group-text">£</span>
  351. </div>
  352. <input class="form-control" type="number" step="0.01" min="0" name="customer_fee" id="customer-fee" placeholder="Enter customer fee override" value="<?=htmlspecialchars($test->customer_fee)?>" />
  353. </div>
  354. </div>
  355. </div>
  356. <div class="row mb-1">
  357. <label class="col-sm-4 col-form-label col-form-label-sm" for="tester-fee">Tester Fee Override</label>
  358. <div class="col-sm">
  359. <div class="input-group input-group-sm">
  360. <div class="input-group-prepend">
  361. <span class="input-group-text">£</span>
  362. </div>
  363. <input class="form-control" type="number" step="0.01" min="0" name="tester_fee" id="tester-fee" placeholder="Enter tester fee override" value="<?=htmlspecialchars($test->test_fee)?>" />
  364. </div>
  365. </div>
  366. </div>
  367. </section>
  368. <section class="mb-4">
  369. <h5><?=htmlspecialchars(__("Costs & Notes"))?></h5>
  370. <div class="row mb-1">
  371. <label class="col-sm-4 col-form-label col-form-label-sm" for="travel-cost">Travel Costs</label>
  372. <div class="col-sm">
  373. <div class="input-group input-group-sm">
  374. <div class="input-group-prepend">
  375. <span class="input-group-text">£</span>
  376. </div>
  377. <input class="form-control" type="number" step="0.01" min="0" max="999.99" name="travel_cost" id="travel-cost" placeholder="Enter travel costs" value="<?=htmlspecialchars($test->test_travel_cost)?>" />
  378. </div>
  379. </div>
  380. </div>
  381. <div class="row mb-1">
  382. <label class="col-sm-4 col-form-label col-form-label-sm" for="verifier-notes">Verifier Notes</label>
  383. <div class="col-sm">
  384. <textarea class="form-control form-control-sm" name="verifier_notes" id="verifier-notes" placeholder="Enter verifier notes" rows="4"><?=htmlspecialchars($test->verifier_notes)?></textarea>
  385. </div>
  386. </div>
  387. <div class="row mb-1 align-items-center">
  388. <label class="col-sm-4 col-form-label col-form-label-sm" for="retest">Set As Retest</label>
  389. <div class="col-sm">
  390. <div class="custom-control custom-checkbox">
  391. <input class="custom-control-input" type="checkbox" name="retest" id="retest" value="1" <?=Form::checked($test->retest)?> />
  392. <label class="custom-control-label" for="retest">This test was a retest</label>
  393. </div>
  394. </div>
  395. </div>
  396. </section>
  397. <section class="mb-4">
  398. <h5><?=htmlspecialchars(__("New Test"))?></h5>
  399. <div class="row mb-1">
  400. <label class="col-sm-4 col-form-label col-form-label-sm" for="new-test-project-id">
  401. Create New Test
  402. </label>
  403. <div class="col-sm">
  404. <div class="input-group">
  405. <select class="form-control" name="new_test_project_id" id="new-test-project-id">
  406. <option value="0">Do not create</option>
  407. <?php
  408. foreach($future_projects as $future_project) {
  409. ?>
  410. <option value="<?=$future_project->id?>" data-customer-fee="<?=$future_project->default_customer_fee?>">
  411. <?=htmlspecialchars($future_project->name)?>
  412. </option>
  413. <?php
  414. }
  415. ?>
  416. </select>
  417. <div class="input-group-append">
  418. <div class="input-group-text">
  419. <div class="custom-control custom-checkbox">
  420. <input class="custom-control-input" type="checkbox" name="new_test_is_retest" id="new-test-is-retest" value="1" />
  421. <label class="custom-control-label" for="new-test-is-retest"><?=htmlspecialchars(__("Retest"))?></label>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. </div>
  427. </div>
  428. <?php
  429. if($location->email) {
  430. ?>
  431. <div class="row mb-1 align-items-center">
  432. <label class="col-sm-4 col-form-label col-form-label-sm" for="payment-required">
  433. Invoice Location
  434. </label>
  435. <div class="col-sm">
  436. <div class="custom-control custom-switch">
  437. <input class="custom-control-input" id="payment-required" name="payment_required" type="checkbox" value="1" />
  438. <label class="custom-control-label" for="payment-required"><?=htmlspecialchars(__("Send Invoice"))?></label>
  439. </div>
  440. </div>
  441. </div>
  442. <div class="row mb-1 align-items-center">
  443. <label class="col-sm-4 col-form-label col-form-label-sm" for="invoice-amount">
  444. Invoice Amount
  445. </label>
  446. <div class="col-sm">
  447. <div class="input-group input-group-sm">
  448. <div class="input-group-prepend">
  449. <span class="input-group-text">£</span>
  450. </div>
  451. <input class="form-control" type="number" step="0.01" min="0" max="999.99" name="invoice_amount" id="invoice-amount" placeholder="Enter invoice amount" value="0.00" />
  452. </div>
  453. </div>
  454. </div>
  455. <?php
  456. }
  457. ?>
  458. </section>
  459. <?php
  460. if($test->getStatus() === Test::STATUS_PENDING_VERIFICATION) {
  461. ?>
  462. <section class="mb-4">
  463. <h5><?=htmlspecialchars(__("Notifications"))?></h5>
  464. <?php
  465. $customer_checked = $customer->email_after_test;
  466. $location_checked = $customer->email_locations_after_test;
  467. $email_address_configs = [
  468. ["email" => $customer->email, "label" => "Email Headquarters", "name" => "email_customer", "checked" => $customer_checked],
  469. ["email" => $location->email, "label" => "Email Venue", "name" => "email_location", "checked" => $location_checked],
  470. ["email" => $location->area_manager_email, "label" => "Email AM", "name" => "email_location_area_manager", "checked" => $location_checked],
  471. ["email" => $location->operations_manager_email, "label" => "Email OM", "name" => "email_location_operations_manager", "checked" => $location_checked],
  472. ["email" => $location->gaming_manager_email, "label" => "Email GM", "name" => "email_location_gaming_manager", "checked" => $location_checked],
  473. ["email" => $location->senior_gaming_manager_email, "label" => "Email SGM", "name" => "email_location_senior_gaming_manager", "checked" => $location_checked],
  474. ];
  475. foreach($email_address_configs as $email_address_config) {
  476. $email_address = $email_address_config["email"];
  477. if(!$email_address) {
  478. continue;
  479. }
  480. $label = $email_address_config["label"];
  481. $name = $email_address_config["name"];
  482. $checked = $email_address_config["checked"];
  483. $id = str_replace("_", "-", $name);
  484. ?>
  485. <div class="row mb-1">
  486. <label class="col-sm-4 col-form-label col-form-label-sm" for="<?= $id ?>">
  487. <?= htmlspecialchars($label) ?>
  488. </label>
  489. <div class="col-sm">
  490. <div class="custom-control custom-checkbox">
  491. <input class="custom-control-input" type="checkbox" name="<?= $name ?>"
  492. id="<?= $id ?>" value="1" <?= Form::checked($checked) ?> />
  493. <label class="custom-control-label"
  494. for="<?= $id ?>"><?= htmlspecialchars($email_address) ?></label>
  495. </div>
  496. </div>
  497. </div>
  498. <?php
  499. }
  500. ?>
  501. <div class="row mb-1">
  502. <label class="col-sm-4 col-form-label col-form-label-sm"
  503. for="include-previous-test"><?= htmlspecialchars(__("Previous Test")) ?></label>
  504. <div class="col-sm">
  505. <div class="custom-control custom-checkbox">
  506. <input class="custom-control-input" type="checkbox" name="include_previous_test"
  507. id="include-previous-test" value="1" checked/>
  508. <label class="custom-control-label" for="include-previous-test">
  509. <?= htmlspecialchars(__("Attach PDF")) ?>
  510. </label>
  511. </div>
  512. </div>
  513. </div>
  514. <div class="row mb-1">
  515. <label class="col-sm-4 col-form-label col-form-label-sm" for="tester-message">Message to Tester (if
  516. rejecting)</label>
  517. <div class="col-sm">
  518. <textarea class="form-control form-control-sm" name="tester_message"
  519. id="tester-message" placeholder="Enter message to tester"
  520. rows="4"><?= htmlspecialchars($tester_message) ?></textarea>
  521. </div>
  522. </div>
  523. </section>
  524. <?php
  525. }
  526. ?>
  527. <?php
  528. // Submit buttons
  529. if($test->getStatus() === Test::STATUS_PENDING_VERIFICATION) {
  530. ?>
  531. <div class="row mb-1">
  532. <div class="col-sm offset-sm-4">
  533. <button class="btn btn-success" type="submit" name="accept" value="1">Accept
  534. </button>
  535. <button class="btn btn-danger" type="submit" name="reject" value="1">Reject</button>
  536. </div>
  537. </div>
  538. <?php
  539. }
  540. else {
  541. ?>
  542. <div class="row mb-1">
  543. <div class="col-sm offset-sm-4">
  544. <button class="btn btn-primary" type="submit">Submit</button>
  545. </div>
  546. </div>
  547. <?php
  548. }
  549. ?>
  550. </div>
  551. </div>
  552. <?php
  553. $previous_test = $test->getPreviousTest();
  554. if($previous_test) {
  555. $dt = $previous_test->getDateTimeStart();
  556. $previous_test_details = $get_test_details($previous_test);
  557. $previous_test_details_subset = [
  558. "Date/Time" => $previous_test_details["Start"],
  559. "Result" => $previous_test_details["Result"],
  560. ];
  561. ?>
  562. <div class="card mb-3">
  563. <div class="card-header">
  564. <?=htmlspecialchars(__("Previous Test"))?>
  565. </div>
  566. <?php
  567. render_card_list_group($previous_test_details_subset);
  568. ?>
  569. </div>
  570. <?php
  571. }
  572. ?>
  573. </div>
  574. </div>
  575. </form>
  576. </div>