location_list.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <div class="table-responsive limit-height-2">
  2. <table class="table table-sm table-hover">
  3. <thead>
  4. <tr>
  5. <th class="text-right pr-3">ID</th>
  6. <th>Name / Address</th>
  7. <th></th>
  8. </tr>
  9. </thead>
  10. <tbody>
  11. <?php
  12. foreach($locations as $location) {
  13. ?>
  14. <tr>
  15. <td class="text-right pr-3">
  16. <?=$location->id?>
  17. </td>
  18. <td>
  19. <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
  20. <?php
  21. if($location->internal_id) {
  22. ?>
  23. <small class="text-info">Internal ID: <?=htmlspecialchars($location->internal_id)?></small><br />
  24. <?php
  25. }
  26. ?>
  27. <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
  28. </td>
  29. <td class="text-right align-middle">
  30. <a class="btn btn-outline-primary" href="/account/locations/<?=$location->id?>/edit">Edit</a>
  31. </td>
  32. </tr>
  33. <?php
  34. }
  35. ?>
  36. </tbody>
  37. </table>
  38. </div>
  39. <?php
  40. if(empty($locations)) {
  41. ?>
  42. <div class="alert alert-info">
  43. No locations to display.
  44. </div>
  45. <?php
  46. }
  47. ?>