location_log_tab.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * @var Location $location
  4. */
  5. $entries = $location->getUpdateLogEntries();
  6. ?>
  7. <div class="tab-pane fade" id="log" role="tabpanel" aria-labelledby="log-tab">
  8. <?php
  9. if(empty($entries)) {
  10. ?>
  11. <div class="alert alert-info">
  12. <i class="fal fa-fw fa-info-circle"></i> No log entries to display for this location.
  13. </div>
  14. <?php
  15. }
  16. else {
  17. ?>
  18. <table class="table table-sm table-bordered">
  19. <thead>
  20. <tr>
  21. <th>Date/Time</th>
  22. <th>User</th>
  23. <th>Field</th>
  24. <th>Before</th>
  25. <th>After</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <?php
  30. foreach($entries as $entry) {
  31. $user = $entry->getUser();
  32. $dts = Util::getDisplayDateTimeFromUTC($entry->dts);
  33. $modifications = $entry->getModifications();
  34. foreach($modifications as $modification) {
  35. ?>
  36. <tr>
  37. <td><?=htmlspecialchars($dts)?></td>
  38. <td><a href="<?=htmlspecialchars($user->getURL())?>"><?=htmlspecialchars($user->email)?></a></td>
  39. <td class="text-monospace"><?=htmlspecialchars($modification->field)?></td>
  40. <td class="text-monospace"><?=htmlspecialchars($modification->before)?></td>
  41. <td class="text-monospace"><?=htmlspecialchars($modification->after)?></td>
  42. </tr>
  43. <?php
  44. }
  45. ?>
  46. <?php
  47. }
  48. ?>
  49. </tbody>
  50. </table>
  51. <?php
  52. }
  53. ?>
  54. </div>