/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. <h1 class="headingleft">Tickets <small><?php if ($status) echo '('.$status.')'?></small></h1>
  10. <div class="headingright">
  11. <label for="filter">
  12. Filter
  13. </label>
  14. <?php
  15. $options[''] = 'View All';
  16. $options['open'] = 'Open';
  17. $options['closed'] = 'Closed';
  18. $options['-'] = '--------------------';
  19. if ($webforms)
  20. {
  21. foreach($webforms as $form)
  22. {
  23. $options[$form['formID']] = $form['formName'];
  24. }
  25. }
  26. echo form_dropdown('filter', $options, $this->uri->segment(4), 'id="filter"');
  27. ?>
  28. <a href="/admin/webforms/viewall" class="button blue">Web Forms</a>
  29. </div>
  30. <div class="clear"></div>
  31. <?php if ($tickets): ?>
  32. <?php echo $this->pagination->create_links(); ?>
  33. <table class="default">
  34. <tr>
  35. <th><?php echo order_link('admin/webforms/tickets','subject','Subject'); ?></th>
  36. <th><?php echo order_link('admin/webforms/tickets','dateCreated','Date'); ?></th>
  37. <th><?php echo order_link('admin/webforms/tickets','formName','Web Form'); ?></th>
  38. <th><?php echo order_link('admin/webforms/tickets','status','Status'); ?></th>
  39. <th><?php echo order_link('admin/webforms/tickets','fullName','Name'); ?></th>
  40. <th><?php echo order_link('admin/webforms/tickets','email','Email'); ?></th>
  41. <th class="tiny">&nbsp;</th>
  42. <th class="tiny">&nbsp;</th>
  43. </tr>
  44. <?php
  45. $i=0;
  46. foreach ($tickets as $ticket):
  47. $class = ($i % 2) ? ' class="alt"' : '';
  48. $style = (!$ticket['viewed']) ? ' style="font-weight: bold;"' : '';
  49. $i++;
  50. ?>
  51. <tr<?php echo $class; ?><?php echo $style; ?>>
  52. <td><?php echo anchor('/admin/webforms/view_ticket/'.$ticket['ticketID'], '[#'.$ticket['ticketID'].']: '.$ticket['subject']); ?></td>
  53. <td><?php echo dateFmt($ticket['dateCreated'], '', '', TRUE); ?></td>
  54. <td><?php echo ($ticket['formName']) ? anchor('/admin/webforms/viewall', $ticket['formName']) : ''; ?></td>
  55. <td><?php echo ($ticket['closed']) ? 'Closed' : 'Open'; ?></td>
  56. <td><?php echo $ticket['fullName']; ?></td>
  57. <td><?php echo $ticket['email']; ?></td>
  58. <td class="tiny">
  59. <?php echo anchor('/admin/webforms/view_ticket/'.$ticket['ticketID'], 'Edit'); ?>
  60. </td>
  61. <td class="tiny">
  62. <?php if (in_array('webforms_tickets', $this->permission->permissions)): ?>
  63. <?php echo anchor('/admin/webforms/delete_ticket/'.$ticket['ticketID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
  64. <?php endif; ?>
  65. </td>
  66. </tr>
  67. <?php endforeach; ?>
  68. </table>
  69. <?php echo $this->pagination->create_links(); ?>
  70. <p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  71. <?php else: ?>
  72. <p class="clear">There are no tickets here yet.</p>
  73. <?php endif; ?>