1
0

tests_available.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <div class="container mt-3 py-4">
  2. <input type="hidden" id="csrf-token" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>" />
  3. <div class="row">
  4. <div class="col">
  5. <h2><?=htmlspecialchars(__("Find Tests"))?></h2>
  6. </div>
  7. <div class="col-auto">
  8. <a id="claim-tests-button" class="btn btn-primary disabled" href="#" data-toggle="modal" data-target="#modal-test-claim">
  9. <?=sprintf(htmlspecialchars(__("Claim %s0%s ...")), '<span id="claim-number">', '</span>')?>
  10. </a>
  11. </div>
  12. </div>
  13. <div class="card mb-3">
  14. <div class="card-body">
  15. <?=htmlspecialchars(__("On this page you can search for tests that are currently available. Please use the \"Select\" buttons or click on the map markers to select and deselect a test. After you have made your selections, please click the \"Claim\" button on the top-right of this page to assign yourself the tests."))?>
  16. </div>
  17. </div>
  18. <div class="row">
  19. <div class="col-lg-6 order-2 order-lg-1 mb-3 mb-lg-0">
  20. <div class="list-group limit-height-2">
  21. <?php
  22. foreach($tests as $test) {
  23. $location = $test->getLocation();
  24. $distance = Geolocation::getDistance($location->getGeolocation(), $address->getGeolocation());
  25. $distance_formatted = number_format($distance, 1);
  26. $project = $test->getProject();
  27. $template = $project->getTemplate();
  28. ?>
  29. <div class="list-group-item">
  30. <div class="d-flex justify-content-between">
  31. <div>
  32. <div><?=htmlspecialchars($location->name)?></div>
  33. <div><small><?=htmlspecialchars($location->getDisplayAddress())?></small></div>
  34. <div>
  35. <small><strong><?=htmlspecialchars(__("Type:"))?></strong> <?=htmlspecialchars($template->name)?></small>
  36. <?php
  37. if($project->isNighttime()) {
  38. ?>
  39. <span class="badge badge-dark">
  40. <i class="fas fa-fw fa-moon"></i>
  41. <?=htmlspecialchars(__("Nighttime"))?>
  42. </span>
  43. <?php
  44. }
  45. ?>
  46. </div>
  47. <div>
  48. <small>
  49. <?=sprintf(htmlspecialchars(__("%s%s mi%s from your %s address")), '<strong>', '</strong>', htmlspecialchars($address->name))?>
  50. </small>
  51. </div>
  52. </div>
  53. <button class="btn btn-primary align-self-start" data-test-id="<?=$test->id?>"><?=htmlspecialchars(__("Select"))?></button>
  54. </div>
  55. </div>
  56. <?php
  57. }
  58. ?>
  59. </div>
  60. </div>
  61. <div class="col-lg-6 order-1 order-lg-2 mb-3 mb-lg-0">
  62. <div class="input-group mb-3">
  63. <div class="input-group-prepend">
  64. <span class="input-group-text">
  65. <?=htmlspecialchars(__("Location"))?>
  66. </span>
  67. </div>
  68. <input class="form-control" type="text" data-autocomplete="map" />
  69. </div>
  70. <div id="map" data-maps data-lat="<?=$latitude?>" data-lng="<?=$longitude?>" data-zoom="9" data-callback="getTests" style="width: 100%; height: 458px;">
  71. </div>
  72. </div>
  73. </div>
  74. </div>