PageRenderTime 741ms CodeModel.GetById 528ms app.highlight 4ms RepoModel.GetById 207ms app.codeStats 0ms

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