location_list.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * @var Location[] $locations
  4. */
  5. ?>
  6. <div class="table-responsive limit-height-2">
  7. <table class="table table-sm table-sm-text table-hover">
  8. <thead>
  9. <tr>
  10. <th class="text-right pr-3">ID</th>
  11. <th>Name / Address</th>
  12. <th>Legal Entity</th>
  13. <th>Internal ID</th>
  14. <th>Tests</th>
  15. <th>Retests</th>
  16. <th></th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <?php
  21. foreach($locations as $location) {
  22. $class = "";
  23. if($location->isArchived()) $class = "text-muted";
  24. ?>
  25. <tr class="<?=$class?>">
  26. <td class="text-right pr-3">
  27. <?=$location->id?>
  28. </td>
  29. <td>
  30. <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a>
  31. <?php
  32. if($location->closed) {
  33. ?>
  34. <span class="badge badge-danger">Closed</span>
  35. <?php
  36. }
  37. if($location->isArchived()) {
  38. ?>
  39. <span class="badge badge-secondary"><?=htmlspecialchars(__("Archived"))?></span>
  40. <?php
  41. }
  42. ?>
  43. <br />
  44. <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
  45. </td>
  46. <td>
  47. <?=htmlspecialchars($location->legal_entity_name)?>
  48. </td>
  49. <td>
  50. <?=htmlspecialchars($location->internal_id)?>
  51. </td>
  52. <td class="text-right">
  53. <?=htmlspecialchars(number_format($location->test_count))?>
  54. </td>
  55. <td class="text-right">
  56. <?=htmlspecialchars(number_format($location->retest_count))?>
  57. </td>
  58. <td class="text-right align-middle">
  59. <a class="btn btn-sm btn-outline-primary" href="/account/locations/<?=$location->id?>/edit">Edit</a>
  60. <button type="button" class="btn btn-sm btn-outline-primary btn-map" data-location-id="<?=$location->id?>">Map</button>
  61. </td>
  62. </tr>
  63. <?php
  64. }
  65. ?>
  66. </tbody>
  67. </table>
  68. </div>
  69. <?php
  70. if(empty($locations)) {
  71. ?>
  72. <div class="alert alert-info">
  73. No locations to display.
  74. </div>
  75. <?php
  76. }
  77. ?>