PageRenderTime 28ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/halogy/application/modules/webforms/views/tickets.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 92 lines | 73 code | 19 blank | 0 comment | 4 complexity | 3b66ea8c93d97a73bdb94718e115ae12 MD5 | raw file
 1<script language="javascript" type="text/javascript">
 2$(function(){
 3	$('select#filter').change(function(){
 4		var status = ($(this).val());
 5		window.location.href = '/admin/webforms/tickets/'+status;
 6	});	
 7});
 8</script>
 9
10<h1 class="headingleft">Tickets <small><?php if ($status) echo '('.$status.')'?></small></h1>
11
12<div class="headingright">
13
14	<label for="filter">
15		Filter
16	</label> 
17
18	<?php
19		$options[''] = 'View All';
20		$options['open'] = 'Open';
21		$options['closed'] = 'Closed';
22
23		$options['-'] = '--------------------';
24
25		if ($webforms)
26		{
27			foreach($webforms as $form)
28			{
29				$options[$form['formID']] = $form['formName'];
30			}
31		}
32		
33		echo form_dropdown('filter', $options, $this->uri->segment(4), 'id="filter"');
34	?>
35
36	<a href="/admin/webforms/viewall" class="button blue">Web Forms</a>
37
38</div>
39<div class="clear"></div>
40
41
42<?php if ($tickets): ?>
43
44<?php echo $this->pagination->create_links(); ?>
45
46<table class="default">
47	<tr>
48		<th><?php echo order_link('admin/webforms/tickets','subject','Subject'); ?></th>
49		<th><?php echo order_link('admin/webforms/tickets','dateCreated','Date'); ?></th>
50		<th><?php echo order_link('admin/webforms/tickets','formName','Web Form'); ?></th>		
51		<th><?php echo order_link('admin/webforms/tickets','status','Status'); ?></th>		
52		<th><?php echo order_link('admin/webforms/tickets','fullName','Name'); ?></th>
53		<th><?php echo order_link('admin/webforms/tickets','email','Email'); ?></th>
54		<th class="tiny">&nbsp;</th>
55		<th class="tiny">&nbsp;</th>
56	</tr>
57<?php
58	$i=0;
59	foreach ($tickets as $ticket):
60	$class = ($i % 2) ? ' class="alt"' : ''; 
61	$style = (!$ticket['viewed']) ? ' style="font-weight: bold;"' : '';
62	$i++;
63?>
64	<tr<?php echo $class; ?><?php echo $style; ?>>
65		<td><?php echo anchor('/admin/webforms/view_ticket/'.$ticket['ticketID'], '[#'.$ticket['ticketID'].']: '.$ticket['subject']); ?></td>	
66		<td><?php echo dateFmt($ticket['dateCreated'], '', '', TRUE); ?></td>
67		<td><?php echo ($ticket['formName']) ? anchor('/admin/webforms/viewall', $ticket['formName']) : ''; ?></td>
68		<td><?php echo ($ticket['closed']) ? 'Closed' : 'Open'; ?></td>
69		<td><?php echo $ticket['fullName']; ?></td>
70		<td><?php echo $ticket['email']; ?></td>		
71		<td class="tiny">
72			<?php echo anchor('/admin/webforms/view_ticket/'.$ticket['ticketID'], 'Edit'); ?>
73		</td>
74		<td class="tiny">
75			<?php if (in_array('webforms_tickets', $this->permission->permissions)): ?>	
76				<?php echo anchor('/admin/webforms/delete_ticket/'.$ticket['ticketID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
77			<?php endif; ?>
78		</td>
79	</tr>
80<?php endforeach; ?>
81</table>
82
83<?php echo $this->pagination->create_links(); ?>
84
85<p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
86
87<?php else: ?>
88
89<p class="clear">There are no tickets here yet.</p>
90
91<?php endif; ?>
92