location.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <div class="container pt-3 my-4">
  2. <div class="row">
  3. <div class="col">
  4. <h2>
  5. <?=htmlspecialchars($location->name)?>
  6. </h2>
  7. </div>
  8. <div class="col-auto">
  9. <a class="btn btn-outline-primary" href="/account/locations/<?=$location->id?>/edit">Edit</a>
  10. </div>
  11. </div>
  12. <p><?=htmlspecialchars($location->getDisplayAddress())?></p>
  13. <h3>Tests</h3>
  14. <?php
  15. if(empty($tests)) {
  16. ?>
  17. <div class="alert alert-info">
  18. This location has no tests.
  19. </div>
  20. <?php
  21. }
  22. else {
  23. ?>
  24. <table class="table table-hover">
  25. <thead>
  26. <tr>
  27. <th>ID</th>
  28. <th>Project</th>
  29. <th>Status</th>
  30. <th></th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. <?php
  35. foreach($tests as $test) {
  36. $project = $test->getProject();
  37. ?>
  38. <tr>
  39. <td class="text-right align-middle">
  40. <?=$test->id?>
  41. </td>
  42. <td class="align-middle">
  43. <a href=""><?=htmlspecialchars($project->name)?></a>
  44. </td>
  45. <td class="align-middle">
  46. <span class="badge badge-lg badge-<?=$test->getStatusClass()?>"><?=htmlspecialchars($test->getStatusText())?></span>
  47. </td>
  48. <td class="text-right">
  49. <?php
  50. if($test->status >= Test::STATUS_PENDING_VERIFICATION) {
  51. ?>
  52. <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View Results</a>
  53. <?php
  54. }
  55. else {
  56. ?>
  57. <a class="btn btn-outline-primary" href="/account/projects/<?=$test->project_id?>">View Project</a>
  58. <?php
  59. }
  60. ?>
  61. </td>
  62. </tr>
  63. <?php
  64. }
  65. ?>
  66. </tbody>
  67. </table>
  68. <?php
  69. }
  70. ?>
  71. <h3>Map</h3>
  72. <div class="mb-3" id="map" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="17" data-marker="true" style="height: 320px;">
  73. </div>
  74. </div>