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.5KB

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