PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/application/views/default/viewticket.php

https://bitbucket.org/getvivekv/fuse
PHP | 197 lines | 123 code | 74 blank | 0 comment | 13 complexity | bc8458a1a6d1c9ac1724f9e3d064aa56 MD5 | raw file
  1. <div class="span12">
  2. <div class="well-white">
  3. <div class="page-header">
  4. <h1>Viewing Ticket #<?php echo $ticketid;?></h1>
  5. </div>
  6. <div class="body">
  7. <?php
  8. if (isset($error))
  9. echo '<div class="alert alert-danger">' . $error . '</div>';
  10. if (isset($success))
  11. echo '<div class="alert alert-success">' . $success . '</div>';
  12. ?>
  13. <div class="row">
  14. <div class="span3">
  15. <div class="badge badge-important">Ticket Info</div> <p></p>
  16. <table class="table table-condensed table-bordered table-hover">
  17. <tr>
  18. <td>Ticket ID</td>
  19. <td>#<?php echo $ticketid; ?></td>
  20. </tr>
  21. <tr>
  22. <td>Status</td>
  23. <td><?php echo ucfirst($ticket['status']);?></td>
  24. </tr>
  25. <tr>
  26. <td>Department</td>
  27. <td><?php echo $ticket['deptname'];?></td>
  28. </tr>
  29. </table>
  30. </div>
  31. <!-- Additional Fields -->
  32. <?php if(is_array($additional) && !empty($additional)): ?>
  33. <div class="span4">
  34. <div class="badge badge-important">Update Additional Fields</div>
  35. <a rel="tooltip" class="btn btn-link" title="Additional Fields" data-content="Additional field values submitted previously are hidden. Enter new values below if you want to update. These values are encrypted before saving to the database and deleted once the ticket is closed">?</a>
  36. <p></p>
  37. <form id="frmadditional">
  38. <?php
  39. foreach ($additional as $item)
  40. {
  41. echo '<fieldset>' ;
  42. echo '<label>' . $item['name'] . '</label>';
  43. if($item['type'] == 'text')
  44. {
  45. echo '<input type="text" name="' . $item['uniqid'] . '"> ';
  46. }
  47. echo '</fieldset>' . "\n" ;
  48. }
  49. ?>
  50. <input type="hidden" name="ticketid" value="<?php echo $ticketid; ?>">
  51. </form>
  52. <div id="fieldsuccess" class="alert alert-success hidden">Updated</div>
  53. <div class="hidden" id="spinner"><i class="icon-spinner icon-spin "></i><p></p></div>
  54. <a class="btn" id="updatefield" href="#">Update</a><p></p>
  55. <p></p>
  56. <script>
  57. $(function(){
  58. $("#updatefield").click(function(){
  59. var ticketid = $("#ticketid").val();
  60. $("#spinner").removeClass("hidden");
  61. $("#fieldsuccess").addClass("hidden");
  62. var post = $("#frmadditional").serialize();
  63. $.post('<?php echo site_url();?>/tickets/updatefield', post, function(data){
  64. var result = $.parseJSON(data) ;
  65. if(result.status == 1 )
  66. {
  67. $("#fieldsuccess").html(result.statusmsg).removeClass('hidden');
  68. }
  69. $("#spinner").addClass("hidden");
  70. })
  71. return false ;
  72. })
  73. })
  74. </script>
  75. </div>
  76. <?php endif; ?>
  77. </div>
  78. <!-- Close - Additional Fields -->
  79. <!-- original ticket response -->
  80. <div class="well">
  81. <div class="label label-inverse">You - <?php echo $ticket['email'];?></div>
  82. <div class="label"><?php echo $ticket['created'];?></div>
  83. <br><br>
  84. <?php echo nl2br($ticket['body']) ;?>
  85. </div>
  86. <!-- Replies -->
  87. <?php
  88. foreach($replies as $reply) : ?>
  89. <?php
  90. if($reply['replier'] == 'client')
  91. {
  92. echo '<div class="well">' ;
  93. }
  94. else
  95. {
  96. echo '<div class="well-white adminreply">' ;
  97. }
  98. ?>
  99. <?php
  100. if($reply['replier'] == 'client') : ?>
  101. <div class="label label-inverse">You - <?php echo $reply['email'];?></div>
  102. <?php else: ?>
  103. <div class="label label-success"><?php echo $reply['firstname'] .' '. $reply['lastname']; ?></div>
  104. <?php endif ; ?>
  105. <div class="label"><?php echo $reply['time'];?></div>
  106. <br><br>
  107. <?php echo nl2br($reply['body']) ;?>
  108. </div>
  109. <?php
  110. endforeach ?>
  111. <div class="badge badge-important">Post a reply</div>
  112. <p></p>
  113. <?php echo form_open('tickets/reply'); ?>
  114. <input type="hidden" name="ticketid" value="<?php echo $ticketid; ?>" >
  115. <input type="hidden" name="clienthash" value="<?php echo $clienthash; ?>" >
  116. <fieldset>
  117. <textarea rows="10" class="span8" name="reply"></textarea>
  118. </fieldset>
  119. <input type="submit" class="btn btn-primary" value="Submit" />
  120. </form>
  121. </div>
  122. </div>
  123. </div>