You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

workorder.blade.php 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. @extends('market.layout.master')
  2. @section('ptitle', 'Marketing')
  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>Work Order'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" style="width:100%">
  35. <thead>
  36. <tr>
  37. <th>#</th>
  38. <th>Service</th>
  39. <th>Cust. Category</th>
  40. <th>W/O</th>
  41. <th>Cust. Name</th>
  42. <th>Contact No.</th>
  43. <th>Unit No.</th>
  44. <th>Building</th>
  45. <th>Postcode</th>
  46. <th>City</th>
  47. <th>Contractor</th>
  48. <th>Installer</th>
  49. <th>Date</th>
  50. <th>Status</th>
  51. <!-- <th width="90">Actions</th> -->
  52. </tr>
  53. </thead>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. @endsection
  59. @section('external_js')
  60. <script>
  61. function deleteA(cid,name,email) {
  62. var cid = cid;
  63. var name = name;
  64. var email = email;
  65. $('.dialog-delete').attr('data-id' , cid);
  66. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this Agent ( " + name + " )?</p>";
  67. $('.dialog-delete').dialog('open');
  68. return false;
  69. };
  70. $(document).ready(function(){
  71. var origin = window.location.origin;
  72. var curr = '{{ $user->_id }}';
  73. //===== Dynamic table toolbars =====//
  74. $('#dyn1 .tOptions').click(function () {
  75. $('#dyn .tablePars').slideToggle(200);
  76. });
  77. $('.tOptions').click(function () {
  78. $(this).toggleClass("act");
  79. });
  80. //======= Filter data table ========//
  81. var table = $('#agent').DataTable({
  82. "dom": 'Br<"tablePars"fl>t<"tableFooter"ip>',
  83. "scrollX": true,
  84. "buttons": [{
  85. extend:'excel',
  86. text:'<span class="icos-download"></span>Download as Excel',
  87. exportOptions:
  88. {
  89. modifier: {
  90. sLengthMenu: 'all'
  91. }
  92. }
  93. // 'copyHtml5', 'csv', 'excelHtml5', 'pdf', 'print'
  94. }],
  95. "bJQueryUI": false,
  96. "bAutoWidth": true,
  97. "bSort": false,
  98. "sPaginationType": "full_numbers",
  99. // "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  100. "oLanguage": {
  101. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  102. },
  103. "ordering": false,
  104. "serverSide": false,
  105. "processing": true,
  106. "ajax": "{{ url('/marketing/work-order/get-wo-list') }}",
  107. "columns": [
  108. { "data": "index","name": "index"},
  109. { "data": "nature_work","name": "nature_work"},
  110. { "data": "customer_category","name": "customer_category"},
  111. { "data": "wo","name": "wo"},
  112. { "data": "customer_name","name": "customer_name"},
  113. { "data": "customer_phone","name": "customer_phone"},
  114. { "data": "customer_unit","name": "customer_unit"},
  115. { "data": "customer_building", "name": "customer_building"},
  116. { "data": "customer_postcode","name": "customer_postcode"},
  117. { "data": "customer_city","name": "customer_city"},
  118. { "data": "contractor_id","name": "contractor_id"},
  119. { "data": "installer_id","name": "installer_id"},
  120. { "data": "dateTimeEnd","name": "dateTimeEnd"},
  121. { "data": "status","name": "status"},
  122. ],
  123. "columnDefs": [
  124. {
  125. "render": function ( data, type, row ) {
  126. if (data.indexOf("-You") >= 0) {
  127. var split = data.split('-');
  128. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  129. }else if (data.indexOf("New/") >= 0) {
  130. var split = data.split('/');
  131. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  132. }else {
  133. return data;
  134. }
  135. },
  136. "targets": 0
  137. },
  138. {
  139. "render": function ( data, type, row ) {
  140. var link = "{{ url('/marketing/work-order/generate-pdf') }}"+"/"+data;
  141. return '<a href="'+link+'" target="_blank"><b>'+data+'</b></a>';
  142. },
  143. "targets": 3
  144. },
  145. ],
  146. });
  147. //===== Modal =====//
  148. $('#fbyear,#fbmonth,#fbapps').change(function()
  149. {
  150. if($('#fbyear').val() != '' && $('#fbmonth').val() != '' && $('#fbapps').val() == '')
  151. {
  152. table.ajax.url( origin+'/marketing/work-order/filter/'+$('#fbyear').val()+'/'+$('#fbmonth').val()+'/null' ).load();
  153. // alert('TEST');
  154. }
  155. else if($('#fbyear').val() == '' && $('#fbmonth').val() == '' && $('#fbapps').val() == '') //done
  156. {
  157. table.ajax.url( origin+'/marketing/work-order/filter/null/null/null' ).load();
  158. }
  159. else if($('#fbyear').val() != '' && $('#fbmonth').val() != '' && $('#fbapps').val() != '')
  160. {
  161. table.ajax.url( origin+'/marketing/work-order/filter/'+$('#fbyear').val()+'/'+$('#fbmonth').val()+'/'+$('#fbapps').val() ).load();
  162. }
  163. else if($('#fbyear').val() == '' && $('#fbmonth').val() == '' && $('#fbapps').val() != '') //done
  164. {
  165. table.ajax.url( origin+'/marketing/work-order/filter/null/null/'+$('#fbapps').val() ).load();
  166. }
  167. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  168. });
  169. });
  170. </script>
  171. @endsection