locations_table.php 929 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. /**
  4. * @var Location[] $locations
  5. */
  6. ?>
  7. <table class="table table-bordered">
  8. <thead>
  9. <tr>
  10. <th><?=htmlspecialchars(__("ID"))?></th>
  11. <th><?=htmlspecialchars(__("Customer"))?></th>
  12. <th><?=htmlspecialchars(__("Name"))?></th>
  13. <th><?=htmlspecialchars(__("Actions"))?></th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php
  18. foreach($locations as $location) {
  19. $customer = $location->getCustomer();
  20. ?>
  21. <tr>
  22. <td class="text-end"><?=$location->id?></td>
  23. <td>
  24. <a href="<?=htmlspecialchars($customer->getUrl())?>">
  25. <?=htmlspecialchars($customer->name)?>
  26. </a>
  27. </td>
  28. <td>
  29. <?=htmlspecialchars($location->name)?>
  30. </td>
  31. <td class="p-1">
  32. <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($location->getUrl())?>/update">
  33. <?=htmlspecialchars(__("Update"))?>
  34. </a>
  35. </td>
  36. </tr>
  37. <?php
  38. }
  39. ?>
  40. </tbody>
  41. </table>