1
0

log.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * @var LocationUpdateLogEntry[] $entries
  4. * @var object $pagination_object
  5. */
  6. ?>
  7. <div class="container-fluid mt-3 py-4">
  8. <h2>Log</h2>
  9. <div class="mb-3">
  10. <?php
  11. View::include("pagination", compact("pagination_object"));
  12. ?>
  13. </div>
  14. <table class="table table-sm table-bordered">
  15. <thead>
  16. <tr>
  17. <th>Date/Time</th>
  18. <th>Location</th>
  19. <th>User</th>
  20. <th>Changes</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. <?php
  25. foreach($entries as $entry) {
  26. $location = $entry->getLocation();
  27. $user = $entry->getUser();
  28. $dts = Util::getDisplayDateTimeFromUTC($entry->dts);
  29. ?>
  30. <tr>
  31. <td><?=htmlspecialchars($dts)?></td>
  32. <td><a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a></td>
  33. <td><a href="<?=htmlspecialchars($user->getURL())?>"><?=htmlspecialchars($user->email)?></a></td>
  34. <td>
  35. <table class="table-sm table-bordered w-100">
  36. <colgroup>
  37. <col style="width: 33%"/>
  38. <col style="width: 33%"/>
  39. <col style="width: 33%"/>
  40. </colgroup>
  41. <thead>
  42. <tr>
  43. <th>Field</th>
  44. <th>Before</th>
  45. <th>After</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <?php
  50. foreach($entry->getModifications() as $modification) {
  51. ?>
  52. <tr>
  53. <td class="text-monospace"><?=htmlspecialchars($modification->field)?></td>
  54. <td class="text-monospace"><?=htmlspecialchars($modification->before)?></td>
  55. <td class="text-monospace"><?=htmlspecialchars($modification->after)?></td>
  56. </tr>
  57. <?php
  58. }
  59. ?>
  60. </tbody>
  61. </table>
  62. </td>
  63. </tr>
  64. <?php
  65. }
  66. ?>
  67. </tbody>
  68. </table>
  69. <?php
  70. View::include("pagination", compact("pagination_object"));
  71. ?>
  72. </div>