location_list.php 1.1 KB

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