location_list.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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></th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <?php
  19. foreach($locations as $location) {
  20. $class = "";
  21. if($location->isArchived()) $class = "text-muted";
  22. ?>
  23. <tr class="<?=$class?>">
  24. <td class="text-right pr-3">
  25. <?=$location->id?>
  26. </td>
  27. <td>
  28. <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a>
  29. <?php
  30. if($location->closed) {
  31. ?>
  32. <span class="badge badge-danger">Closed</span>
  33. <?php
  34. }
  35. if($location->isArchived()) {
  36. ?>
  37. <span class="badge badge-secondary"><?=htmlspecialchars(__("Archived"))?></span>
  38. <?php
  39. }
  40. ?>
  41. <br />
  42. <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
  43. </td>
  44. <td>
  45. <?=htmlspecialchars($location->legal_entity_name)?>
  46. </td>
  47. <td>
  48. <?=htmlspecialchars($location->internal_id)?>
  49. </td>
  50. <td class="text-right align-middle">
  51. <a class="btn btn-sm btn-outline-primary" href="/account/locations/<?=$location->id?>/edit">Edit</a>
  52. </td>
  53. </tr>
  54. <?php
  55. }
  56. ?>
  57. </tbody>
  58. </table>
  59. </div>
  60. <?php
  61. if(empty($locations)) {
  62. ?>
  63. <div class="alert alert-info">
  64. No locations to display.
  65. </div>
  66. <?php
  67. }
  68. ?>