Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

view_docket.blade.php 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. @extends('customer-service.layout.master')
  2. @section('ptitle','Customer Service')
  3. @section('page_title', 'Dashboard')
  4. @section('subpage', 'Graph & Summary Report')
  5. @section('img_profile', asset($user->StaffDetail->user_pic))
  6. @section('login_name', $user->StaffDetail->name )
  7. @section('last_login', $user->last_login_at )
  8. @section('content')
  9. <style>
  10. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #EA5730 !important; }
  11. .ui-widget-content .bRed { color: #fff !important; }
  12. .dt-buttons
  13. {
  14. background: -webkit-linear-gradient(top, #F8F8F8 0%, #EFEFEF 100%);
  15. }
  16. .icos-download
  17. {
  18. padding-top: 0px;
  19. }
  20. .buttons-excel
  21. {
  22. padding: 7px 12px;
  23. display: block;
  24. color: #808080;
  25. font-size: 11px;
  26. }
  27. </style>
  28. <!-- Table dealer -->
  29. <div class="fluid">
  30. <div class="widget grid12">
  31. <div class="whead"><h6>Docket's List</h6></div>
  32. <div id="dyn1" class="shownpars cuss responsive">
  33. <a class="tOptions" title="Options"><img src="{{ url('assets/img/icons/options') }}" alt="" /></a>
  34. <table id="agent" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  35. <thead>
  36. <tr>
  37. <th>#</th>
  38. <th>Docket</th>
  39. <th>W/O</th>
  40. <th>Nature Work</th>
  41. <th>Category</th>
  42. <th>Contractor</th>
  43. <th>Installer</th>
  44. <th>Building</th>
  45. <th>Contact No.</th>
  46. <th>Completed Date</th>
  47. <th>Rating</th>
  48. <th width="90">Actions</th>
  49. </tr>
  50. </thead>
  51. </table>
  52. </div>
  53. <div class="dialog-reset" title="Reset Docket">
  54. <p id="inner-reset"></p>
  55. </div>
  56. </div>
  57. </div>
  58. @endsection
  59. @section('external_js')
  60. <script>
  61. function reset(id,docket) {
  62. var id = id;
  63. var docket = docket;
  64. $('.dialog-reset').attr('data-id' , id);
  65. document.getElementById("inner-reset").innerHTML = "<p>Are you sure want to reset this docket ( " + docket + " )?</p>";
  66. $('.dialog-reset').dialog('open');
  67. return false;
  68. };
  69. //===== Modal =====//
  70. $('.dialog-reset').dialog({
  71. autoOpen: false,
  72. width: 400,
  73. modal: true,
  74. buttons: {
  75. "Yes!": function () {
  76. var id = $(this).data('id');
  77. // window.alert(email);
  78. $.ajax({
  79. type: "GET",
  80. url: "{{ url('/customer-service/reset-docket') }}",
  81. // "_token": "{{ csrf_token() }}",
  82. data: { "_token": "{{ csrf_token() }}", id: id },
  83. success:function(data)
  84. {
  85. if(data == "true"){
  86. window.location.reload();
  87. }else if(data == "false"){
  88. alert("ERROR!! Cant reset D/O !");
  89. }
  90. }
  91. });
  92. },
  93. "Cancel": function () {
  94. $(this).dialog("close");
  95. $('.dialog-reset').removeAttr('data-id');
  96. }
  97. }
  98. });
  99. $(document).ready(function(){
  100. var origin = window.location.origin;
  101. //===== Dynamic table toolbars =====//
  102. $('#dyn1 .tOptions').click(function () {
  103. $('#dyn .tablePars').slideToggle(200);
  104. });
  105. $('.tOptions').click(function () {
  106. $(this).toggleClass("act");
  107. });
  108. //======= Filter data table ========//
  109. var table = $('#agent').DataTable({
  110. "dom": 'Br<"tablePars"fl>t<"tableFooter"ip>',
  111. "buttons": [{
  112. extend:'excel',
  113. text:'<span class="icos-download"></span>Download as Excel',
  114. exportOptions:
  115. {
  116. modifier: {
  117. sLengthMenu: 'all'
  118. }
  119. }
  120. // 'copyHtml5', 'csv', 'excelHtml5', 'pdf', 'print'
  121. }],
  122. "bJQueryUI": false,
  123. "bAutoWidth": true,
  124. "bSort": false,
  125. "sPaginationType": "full_numbers",
  126. // "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  127. "oLanguage": {
  128. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  129. },
  130. "ordering": false,
  131. "serverSide": false,
  132. "processing": true,
  133. "ajax": "{{ url('/customer-service/get-all-docket/null/null/null') }}",
  134. "columns": [
  135. { "data": "index","name": "index"},
  136. { "data": "docket_id","name": "docket_id"},
  137. { "data": "work_order_id","name": "work_order_id"},
  138. { "data": "nature_work","name": "nature_work"},
  139. { "data": "category", "name": "category"},
  140. { "data": "contractor_id","name": "contractor_id"},
  141. { "data": "installer_name","name": "installer_name"},
  142. { "data": "customer_id", "name": "customer_id"},
  143. { "data": "installer_id","name": "installer_id"},
  144. { "data": "end_job","name": "end_job"},
  145. { "data": "rating","name": "rating"},
  146. { "data": "action","name": "action"},
  147. ],
  148. "columnDefs": [
  149. {
  150. "render": function ( data, type, row ) {
  151. if (data.indexOf("New/") >= 0) {
  152. var split = data.split('/');
  153. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  154. }else {
  155. return data;
  156. }
  157. },
  158. "targets": 0
  159. },
  160. {
  161. "render": function ( data, type, row ) {
  162. var split = data.split('/');
  163. var link1 = "{{ url('/customer-service/docket/generate-pdf')}}"+"/"+split[0];
  164. var link2 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+split[1];
  165. return '<a target="_blank" href="'+link1+'" class="tablectrl_medium bGreen tipS" title="View Docket PDF"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link2+'" class="tablectrl_medium bBlue tipS" title="View W/O PDF"><span class="iconb" data-icon=""></span></a> <a target="_blank" class="tablectrl_medium bGold tipS" onclick="reset(\''+split[0]+'\',\'' + split[0] + '\', )" title="Reset Docket PDF"><span class="iconb" data-icon="&#xe004"></span></a>' ;
  166. },
  167. "targets": 11
  168. },
  169. ],
  170. });
  171. //===== Modal =====//
  172. $('#fbyear,#fbmonth').change(function()
  173. {
  174. var link = "{{ url('/customer-service/get-all-docket') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  175. table.ajax.url( link ).load();
  176. });
  177. });
  178. </script>
  179. @endsection