/halogy/application/modules/events/views/admin/viewall.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 57 lines · 48 code · 9 blank · 0 comment · 6 complexity · a4a7a323d0e2b53c1c685302112f86a9 MD5 · raw file

  1. <h1 class="headingleft">Events</h1>
  2. <div class="headingright">
  3. <?php if (in_array('events_edit', $this->permission->permissions)): ?>
  4. <a href="/admin/events/add_event" class="button">Add Event</a>
  5. <?php endif; ?>
  6. </div>
  7. <?php if ($events): ?>
  8. <?php echo $this->pagination->create_links(); ?>
  9. <table class="default clear">
  10. <tr>
  11. <th><?php echo order_link('/admin/events/viewall','eventtitle','Event'); ?></th>
  12. <th><?php echo order_link('/admin/events/viewall','location','Location'); ?></th>
  13. <th><?php echo order_link('/admin/events/viewall','dateCreated','Date created'); ?></th>
  14. <th><?php echo order_link('/admin/events/viewall','eventDate','Event date'); ?></th>
  15. <th>Active</th>
  16. <th class="tiny">&nbsp;</th>
  17. <th class="tiny">&nbsp;</th>
  18. </tr>
  19. <?php foreach ($events as $event): ?>
  20. <tr>
  21. <td><?php echo (in_array('events_edit', $this->permission->permissions)) ? anchor('/admin/events/edit_event/'.$event['eventID'], $event['eventTitle']) : $event['eventTitle']; ?></td>
  22. <td><?php echo $event['location']; ?></td>
  23. <td><?php echo dateFmt($event['dateCreated']); ?></td>
  24. <td><?php echo dateFmt($event['eventDate'], 'd M Y'); ?></td>
  25. <td>
  26. <?php
  27. if (strtotime($event['eventDate']) < time()) echo 'No';
  28. else echo 'Yes';
  29. ?>
  30. </td>
  31. <td class="tiny">
  32. <?php if (in_array('events_edit', $this->permission->permissions)): ?>
  33. <?php echo anchor('/admin/events/edit_event/'.$event['eventID'], 'Edit'); ?>
  34. <?php endif; ?>
  35. </td>
  36. <td class="tiny">
  37. <?php if (in_array('events_delete', $this->permission->permissions)): ?>
  38. <?php echo anchor('/admin/events/delete_event/'.$event['eventID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
  39. <?php endif; ?>
  40. </td>
  41. </tr>
  42. <?php endforeach; ?>
  43. </table>
  44. <?php echo $this->pagination->create_links(); ?>
  45. <p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  46. <?php else: ?>
  47. <p class="clear">There are no events yet.</p>
  48. <?php endif; ?>