location_list.php 1004 B

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