tests_available.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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>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">Claim <span id="claim-number">0</span> ...</a>
  9. </div>
  10. </div>
  11. <div class="card mb-3">
  12. <div class="card-body">
  13. 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.
  14. </div>
  15. </div>
  16. <div class="row">
  17. <div class="col-lg-6 order-2 order-lg-1 mb-3 mb-lg-0">
  18. <div class="list-group limit-height-2">
  19. <?php
  20. foreach($tests as $test) {
  21. $location = $test->getLocation();
  22. $distance = Geolocation::getDistance($location->getGeolocation(), $address->getGeolocation());
  23. $distance_formatted = number_format($distance, 1);
  24. ?>
  25. <div class="list-group-item">
  26. <div class="d-flex justify-content-between">
  27. <div>
  28. <?=htmlspecialchars($location->name)?><br />
  29. <small><?=htmlspecialchars($location->getDisplayAddress())?></small><br />
  30. <small><?=htmlspecialchars($distance_formatted)?> mi from your <?=htmlspecialchars($address->name)?> address.</small>
  31. </div>
  32. <button class="btn btn-primary align-self-start" data-test-id="<?=$test->id?>">Select</button>
  33. </div>
  34. </div>
  35. <?php
  36. }
  37. ?>
  38. </div>
  39. </div>
  40. <div class="col-lg-6 order-1 order-lg-2 mb-3 mb-lg-0">
  41. <div class="input-group mb-3">
  42. <div class="input-group-prepend">
  43. <span class="input-group-text">
  44. Location
  45. </span>
  46. </div>
  47. <input class="form-control" type="text" data-autocomplete="map" />
  48. </div>
  49. <div id="map" data-maps data-lat="<?=$latitude?>" data-lng="<?=$longitude?>" data-zoom="9" data-callback="getTests" style="width: 100%; height: 458px;">
  50. </div>
  51. </div>
  52. </div>
  53. </div>