Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

view_wo.blade.php 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  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. .ui-tabs .ui-tabs-nav li a { color: #636363 !important; }
  13. .ui-tabs .ui-tabs-nav li a:hover { color: #212121 !important; }
  14. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #2E6B9B !important; }
  15. .ui-widget-content a { color: #fff; }
  16. .dt-buttons { background: -webkit-linear-gradient(top, #F8F8F8 0%, #EFEFEF 100%); }
  17. .icos-download { padding-top: 0px; }
  18. .buttons-excel {
  19. padding: 7px 12px;
  20. display: block;
  21. color: #808080;
  22. font-size: 11px;
  23. }
  24. </style>
  25. <!-- Table work order -->
  26. <div class="widget">
  27. <div class="whead"><h6>Important Note</h6></div>
  28. <div class="formRow cussPayment">
  29. <div class="grid-12">
  30. <label style="font-size: 14px;">To create the <b>Appointment Date</b> for customer in <b>Success Non Prelaid</b>, just click the <b>Button</b> color <b>Blue</b></label>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="widget leftTabs tableTabs">
  35. <div class="whead"><h6>Work Order's Data Table</h6></div>
  36. <div class="cuss shownpars responsive">
  37. <div class="tabs">
  38. <ul>
  39. <li><a href="#nwo">Pending Contractor <small style="color:#B35D7E">({{ $pc }})</small></a></li>
  40. <li><a href="#pps">Pending Non Prelaid <small style="color:#B35D7E">({{ $pp }})</small></a></li>
  41. <li><a href="#sps">Success Non Prelaid <small style="color:#B35D7E">({{ $sp }})</small></a></li>
  42. <li><a href="#pending">Pending Installer <small style="color:#B35D7E">({{ $pi }})</small></a></li>
  43. <li><a href="#resc">Reschedule <small style="color:#B35D7E">({{ $rs }})</small></a></li>
  44. <li><a href="#suspend">Suspend <small style="color:#B35D7E">({{ $ss }})</small></a></li>
  45. <li><a href="#completed">Completed <small style="color:#B35D7E">({{ $cm }})</small></a></li>
  46. <li><a href="#cancel">Cancelled <small style="color:#B35D7E">({{$cance}})</small></a></li>
  47. </ul>
  48. <div id="nwo">
  49. <table id="cont" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  50. <thead>
  51. <tr>
  52. <th>#</th>
  53. <th width="40">Service</th>
  54. <th width="40">W/O</th>
  55. <th width="60">Cust.Name</th>
  56. <th width="100">Contact No.</th>
  57. <th width="60">Unit No.</th>
  58. <th>Building</th>
  59. <th>City</th>
  60. <th>Package</th>
  61. <th>Contractor</th>
  62. <th>Installer</th>
  63. <th>Date</th>
  64. <th width="60">Time</th>
  65. <th>Status</th>
  66. <th width="120">Actions</th>
  67. </tr>
  68. </thead>
  69. </table>
  70. </div>
  71. <div id="pps">
  72. <table id="pnon" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  73. <thead>
  74. <tr>
  75. <th>#</th>
  76. <th width="40">Service</th>
  77. <th width="40">W/O</th>
  78. <th width="60">Cust.Name</th>
  79. <th width="100">Contact No.</th>
  80. <th>Unit No.</th>
  81. <th>Building</th>
  82. <th>City</th>
  83. <th>Package</th>
  84. <th>Contractor</th>
  85. <th>Installer</th>
  86. <th>Date</th>
  87. <th width="60">Time</th>
  88. <th>Status</th>
  89. <th width="100">Actions</th>
  90. </tr>
  91. </thead>
  92. </table>
  93. </div>
  94. <div id="sps">
  95. <table id="snon" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  96. <thead>
  97. <tr>
  98. <th>#</th>
  99. <th width="40">Service</th>
  100. <th width="40">W/O</th>
  101. <th width="60">Cust.Name</th>
  102. <th width="100">Contact No.</th>
  103. <th width="60">Unit No.</th>
  104. <th>Building</th>
  105. <th>City</th>
  106. <th>Package</th>
  107. <th>Contractor</th>
  108. <th>Installer</th>
  109. <th>Date</th>
  110. <th width="60">Time</th>
  111. <th>Status</th>
  112. <th width="120">Actions</th>
  113. </tr>
  114. </thead>
  115. </table>
  116. </div>
  117. <div id="pending">
  118. <table id="pinst" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  119. <thead>
  120. <tr>
  121. <th>#</th>
  122. <th width="40">Service</th>
  123. <th width="40">W/O</th>
  124. <th width="60">Cust.Name</th>
  125. <th width="100">Contact No.</th>
  126. <th width="60">Unit No.</th>
  127. <th>Building</th>
  128. <th>City</th>
  129. <th>Package</th>
  130. <th>Contractor</th>
  131. <th>Installer</th>
  132. <th>Date</th>
  133. <th width="60">Time</th>
  134. <th>Status</th>
  135. <th width="120">Actions</th>
  136. </tr>
  137. </thead>
  138. </table>
  139. </div>
  140. <div id="resc">
  141. <table id="sche" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  142. <thead>
  143. <tr>
  144. <th>#</th>
  145. <th width="40">Service</th>
  146. <th width="40">W/O</th>
  147. <th width="60">Cust.Name</th>
  148. <th width="100">Contact No.</th>
  149. <th width="60">Unit No.</th>
  150. <th>Building</th>
  151. <th>City</th>
  152. <th>Package</th>
  153. <th>Contractor</th>
  154. <th>Installer</th>
  155. <th>Date</th>
  156. <th width="60">Time</th>
  157. <th>Installer's Remark</th>
  158. <th width="100">Actions</th>
  159. </tr>
  160. </thead>
  161. </table>
  162. </div>
  163. <div id="suspend">
  164. <table id="susp" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  165. <thead>
  166. <tr>
  167. <th>#</th>
  168. <th width="40">Service</th>
  169. <th width="40">W/O</th>
  170. <th width="60">Cust.Name</th>
  171. <th width="100">Contact No.</th>
  172. <th width="60">Unit No.</th>
  173. <th>Building</th>
  174. <th>City</th>
  175. <th>Package</th>
  176. <th>Contractor</th>
  177. <th>Installer</th>
  178. <th>Date</th>
  179. <th width="60">Time</th>
  180. <th>Installer's Remark</th>
  181. <th width="100">Actions</th>
  182. </tr>
  183. </thead>
  184. </table>
  185. </div>
  186. <div id="completed">
  187. <table id="comp" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  188. <thead>
  189. <tr>
  190. <th>#</th>
  191. <th width="40">Service</th>
  192. <th width="40">W/O</th>
  193. <th width="60">Cust.Name</th>
  194. <th width="100">Contact No.</th>
  195. <th width="60">Unit No.</th>
  196. <th>Building</th>
  197. <th>City</th>
  198. <th>Package</th>
  199. <th>Contractor</th>
  200. <th>Installer</th>
  201. <th>Date</th>
  202. <th width="60">Time</th>
  203. <th>Status</th>
  204. <th>Docket</th>
  205. <th width="40">Actions</th>
  206. </tr>
  207. </thead>
  208. </table>
  209. </div>
  210. <div id="cancel">
  211. <table id="canc" cellpadding="0" cellspacing="0" border="0" width="100%" class="dTable tMedia">
  212. <thead>
  213. <tr>
  214. <th>#</th>
  215. <th width="40">Service</th>
  216. <th width="40">W/O</th>
  217. <th width="60">Cust.Name</th>
  218. <th width="100">Contact No.</th>
  219. <th width="60">Unit No.</th>
  220. <th>Building</th>
  221. <th>City</th>
  222. <th>Package</th>
  223. <th>Contractor</th>
  224. <th>Installer</th>
  225. <th>Date</th>
  226. <th width="60">Time</th>
  227. <th>Status</th>
  228. <th width="100">Actions</th>
  229. </tr>
  230. </thead>
  231. </table>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="dialog-delete" title="Delete Work Order">
  236. <p id="inner-delete"></p>
  237. </div>
  238. </div>
  239. @endsection
  240. @section('external_js')
  241. <script>
  242. function deleteA(cid,wo) {
  243. var cid = cid;
  244. var wo = wo;
  245. $('.dialog-delete').attr('data-id' , cid);
  246. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this W/O ( " + wo + " )?</p>";
  247. $('.dialog-delete').dialog('open');
  248. return false;
  249. };
  250. //===== Modal =====//
  251. $('.dialog-delete').dialog({
  252. autoOpen: false,
  253. width: 400,
  254. modal: true,
  255. buttons: {
  256. "Yes!": function () {
  257. var id = $(this).data('id');
  258. // window.alert(email);
  259. $.ajax({
  260. type: "POST",
  261. url: "{{ url('/customer-service/delete-work-order') }}",
  262. // "_token": "{{ csrf_token() }}",
  263. data: { "_token": "{{ csrf_token() }}", id: id },
  264. success:function(data)
  265. {
  266. if(data == "true"){
  267. window.location.reload();
  268. }else if(data == "false"){
  269. alert("ERROR!! Cant Delete W/O !");
  270. }
  271. }
  272. });
  273. },
  274. "Cancel": function () {
  275. $(this).dialog("close");
  276. $('.dialog-delete').removeAttr('data-id');
  277. }
  278. }
  279. });
  280. $(document).ready(function(){
  281. var origin = window.location.origin;
  282. var positionRoles = '{{ $user->StaffDetail->position }}';
  283. //===== Dynamic table toolbars =====//
  284. $('#dyn1 .tOptions').click(function () {
  285. $('#dyn .tablePars').slideToggle(200);
  286. });
  287. $('.tOptions').click(function () {
  288. $(this).toggleClass("act");
  289. });
  290. //======= Filter data table ========//
  291. var table1 = $('#cont').DataTable({
  292. "bJQueryUI": false,
  293. "bAutoWidth": true,
  294. "bSort": false,
  295. "sPaginationType": "full_numbers",
  296. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  297. "oLanguage": {
  298. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  299. },
  300. "ordering": false,
  301. "serverSide": true,
  302. "processing": true,
  303. "ajax": "{{ url('/customer-service/get-all-pending-contractor/null/null/null') }}",
  304. "columns": [
  305. { "data": "formT","name": "formT"},
  306. { "data": "service","name": "service"},
  307. { "data": "wo","name": "wo"},
  308. { "data": "name","name": "name"},
  309. { "data": "phone","name": "phone"},
  310. { "data": "unit","name": "unit"},
  311. { "data": "building","name": "building"},
  312. { "data": "city","name": "city"},
  313. { "data": "package", "name": "package"},
  314. { "data": "contractor","name": "contractor"},
  315. { "data": "installer","name": "installer"},
  316. { "data": "date","name": "date"},
  317. { "data": "time","name": "time"},
  318. { "data": "status","name": "status"},
  319. { "data": "action","name": "action"},
  320. ],
  321. "columnDefs": [
  322. {
  323. "render": function ( data, type, row ) {
  324. if (data.indexOf("New/") >= 0) {
  325. var split = data.split('/');
  326. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  327. }else {
  328. return data;
  329. }
  330. },
  331. "targets": 0
  332. },
  333. {
  334. "width":"60px",
  335. "targets": 2
  336. },
  337. {
  338. "render": function ( data, type, row ) {
  339. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  340. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  341. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  342. if(positionRoles == 'Customer Service'){
  343. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a> <a class="tablectrl_medium bRed tipS delModule" onclick="deleteA(\''+row.wo+'\',\'' + row.wo + '\', )" title="Delete W/O"><span class="iconb" data-icon="&#xe136;"></span></a>';
  344. }else {
  345. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  346. }
  347. },
  348. "targets": 14
  349. }
  350. ],
  351. });
  352. var table2 = $('#pnon').DataTable({
  353. "bJQueryUI": false,
  354. "bAutoWidth": true,
  355. "bSort": false,
  356. "sPaginationType": "full_numbers",
  357. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  358. "oLanguage": {
  359. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  360. },
  361. "ordering": false,
  362. "serverSide": true,
  363. "processing": true,
  364. "ajax": "{{ url('/customer-service/get-all-pending-non/null/null/null') }}",
  365. "columns": [
  366. { "data": "formT","name": "formT"},
  367. { "data": "service","name": "service"},
  368. { "data": "wo","name": "wo"},
  369. { "data": "name","name": "name"},
  370. { "data": "phone","name": "phone"},
  371. { "data": "unit","name": "unit"},
  372. { "data": "building","name": "building"},
  373. { "data": "city","name": "city"},
  374. { "data": "package", "name": "package"},
  375. { "data": "contractor","name": "contractor"},
  376. { "data": "installer","name": "installer"},
  377. { "data": "date","name": "date"},
  378. { "data": "time","name": "time"},
  379. { "data": "status","name": "status"},
  380. { "data": "action","name": "action"},
  381. ],
  382. "columnDefs": [
  383. {
  384. "render": function ( data, type, row ) {
  385. if (data.indexOf("New/") >= 0) {
  386. var split = data.split('/');
  387. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  388. }else {
  389. return data;
  390. }
  391. },
  392. "targets": 0
  393. },
  394. {
  395. "render": function ( data, type, row ) {
  396. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  397. var link2 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  398. if(positionRoles == 'Customer Service'){
  399. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link2+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  400. }else {
  401. return '<a target="_blank" href="'+link2+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  402. }
  403. },
  404. "targets": 14
  405. }
  406. ],
  407. });
  408. var table3 = $('#snon').DataTable({
  409. "bJQueryUI": false,
  410. "bAutoWidth": true,
  411. "bSort": false,
  412. "sPaginationType": "full_numbers",
  413. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  414. "oLanguage": {
  415. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  416. },
  417. "ordering": false,
  418. "serverSide": true,
  419. "processing": true,
  420. "ajax": "{{ url('/customer-service/get-all-success-non/null/null/null') }}",
  421. "columns": [
  422. { "data": "formT","name": "formT"},
  423. { "data": "service","name": "service"},
  424. { "data": "wo","name": "wo"},
  425. { "data": "name","name": "name"},
  426. { "data": "phone","name": "phone"},
  427. { "data": "unit","name": "unit"},
  428. { "data": "building","name": "building"},
  429. { "data": "city","name": "city"},
  430. { "data": "package", "name": "package"},
  431. { "data": "contractor","name": "contractor"},
  432. { "data": "installer","name": "installer"},
  433. { "data": "date","name": "date"},
  434. { "data": "time","name": "time"},
  435. { "data": "status","name": "status"},
  436. { "data": "action","name": "action"},
  437. ],
  438. "columnDefs": [
  439. {
  440. "render": function ( data, type, row ) {
  441. if (data.indexOf("New/") >= 0) {
  442. var split = data.split('/');
  443. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  444. }else {
  445. return data;
  446. }
  447. },
  448. "targets": 0
  449. },
  450. {
  451. "render": function ( data, type, row ) {
  452. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  453. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  454. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  455. if(positionRoles == 'Customer Service'){
  456. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  457. }else{
  458. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  459. }
  460. },
  461. "targets": 14
  462. }
  463. ],
  464. });
  465. var table4 = $('#pinst').DataTable({
  466. "bJQueryUI": false,
  467. "bAutoWidth": true,
  468. "bSort": false,
  469. "sPaginationType": "full_numbers",
  470. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  471. "oLanguage": {
  472. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  473. },
  474. "ordering": false,
  475. "serverSide": true,
  476. "processing": true,
  477. "ajax": "{{ url('/customer-service/get-all-pending-installer/null/null/null') }}",
  478. "columns": [
  479. { "data": "formT","name": "formT"},
  480. { "data": "service","name": "service"},
  481. { "data": "wo","name": "wo"},
  482. { "data": "name","name": "name"},
  483. { "data": "phone","name": "phone"},
  484. { "data": "unit","name": "unit"},
  485. { "data": "building","name": "building"},
  486. { "data": "city","name": "city"},
  487. { "data": "package", "name": "package"},
  488. { "data": "contractor","name": "contractor"},
  489. { "data": "installer","name": "installer"},
  490. { "data": "date","name": "date"},
  491. { "data": "time","name": "time"},
  492. { "data": "status","name": "status"},
  493. { "data": "action","name": "action"},
  494. ],
  495. "columnDefs": [
  496. {
  497. "render": function ( data, type, row ) {
  498. if (data.indexOf("New/") >= 0) {
  499. var split = data.split('/');
  500. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  501. }else {
  502. return data;
  503. }
  504. },
  505. "targets": 0
  506. },
  507. {
  508. "render": function ( data, type, row ) {
  509. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  510. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  511. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  512. if(positionRoles == 'Customer Service'){
  513. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  514. }else{
  515. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  516. }
  517. },
  518. "targets": 14
  519. }
  520. ],
  521. });
  522. var table5 = $('#sche').DataTable({
  523. "bJQueryUI": false,
  524. "bAutoWidth": true,
  525. "bSort": false,
  526. "sPaginationType": "full_numbers",
  527. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  528. "oLanguage": {
  529. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  530. },
  531. "ordering": false,
  532. "serverSide": true,
  533. "processing": true,
  534. "ajax": "{{ url('/customer-service/get-all-reschedule/null/null/null') }}",
  535. "columns": [
  536. { "data": "formT","name": "formT"},
  537. { "data": "service","name": "service"},
  538. { "data": "wo","name": "wo"},
  539. { "data": "name","name": "name"},
  540. { "data": "phone","name": "phone"},
  541. { "data": "unit","name": "unit"},
  542. { "data": "building","name": "building"},
  543. { "data": "city","name": "city"},
  544. { "data": "package", "name": "package"},
  545. { "data": "contractor","name": "contractor"},
  546. { "data": "installer","name": "installer"},
  547. { "data": "date","name": "date"},
  548. { "data": "time","name": "time"},
  549. { "data": "status","name": "status"},
  550. { "data": "action","name": "action"},
  551. ],
  552. "columnDefs": [
  553. {
  554. "render": function ( data, type, row ) {
  555. if (data.indexOf("New/") >= 0) {
  556. var split = data.split('/');
  557. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  558. }else {
  559. return data;
  560. }
  561. },
  562. "targets": 0
  563. },
  564. {
  565. "render": function ( data, type, row ) {
  566. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  567. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  568. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  569. if(positionRoles == 'Customer Service'){
  570. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  571. }else{
  572. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  573. }
  574. },
  575. "targets": 14
  576. }
  577. ],
  578. });
  579. var table6 = $('#susp').DataTable({
  580. "bJQueryUI": false,
  581. "bAutoWidth": true,
  582. "bSort": false,
  583. "sPaginationType": "full_numbers",
  584. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  585. "oLanguage": {
  586. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  587. },
  588. "ordering": false,
  589. "serverSide": true,
  590. "processing": true,
  591. "ajax": "{{ url('/customer-service/get-all-suspend/null/null/null') }}",
  592. "columns": [
  593. { "data": "formT","name": "formT"},
  594. { "data": "service","name": "service"},
  595. { "data": "wo","name": "wo"},
  596. { "data": "name","name": "name"},
  597. { "data": "phone","name": "phone"},
  598. { "data": "unit","name": "unit"},
  599. { "data": "building","name": "building"},
  600. { "data": "city","name": "city"},
  601. { "data": "package", "name": "package"},
  602. { "data": "contractor","name": "contractor"},
  603. { "data": "installer","name": "installer"},
  604. { "data": "date","name": "date"},
  605. { "data": "time","name": "time"},
  606. { "data": "status","name": "status"},
  607. { "data": "action","name": "action"},
  608. ],
  609. "columnDefs": [
  610. {
  611. "render": function ( data, type, row ) {
  612. if (data.indexOf("New/") >= 0) {
  613. var split = data.split('/');
  614. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  615. }else {
  616. return data;
  617. }
  618. },
  619. "targets": 0
  620. },
  621. {
  622. "render": function ( data, type, row ) {
  623. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  624. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  625. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  626. if(positionRoles == 'Customer Service'){
  627. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  628. }else{
  629. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  630. }
  631. },
  632. "targets": 14
  633. }
  634. ],
  635. });
  636. var table7 = $('#comp').DataTable({
  637. "bJQueryUI": false,
  638. "bAutoWidth": true,
  639. "bSort": false,
  640. "sPaginationType": "full_numbers",
  641. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  642. "oLanguage": {
  643. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  644. },
  645. "ordering": false,
  646. "serverSide": true,
  647. "processing": true,
  648. "ajax": "{{ url('/customer-service/get-all-completed/null/null/null') }}",
  649. "columns": [
  650. { "data": "formT","name": "formT"},
  651. { "data": "service","name": "service"},
  652. { "data": "wo","name": "wo"},
  653. { "data": "name","name": "name"},
  654. { "data": "phone","name": "phone"},
  655. { "data": "unit","name": "unit"},
  656. { "data": "building","name": "building"},
  657. { "data": "city","name": "city"},
  658. { "data": "package", "name": "package"},
  659. { "data": "contractor","name": "contractor"},
  660. { "data": "installer","name": "installer"},
  661. { "data": "date","name": "date"},
  662. { "data": "time","name": "time"},
  663. { "data": "status","name": "status"},
  664. { "data": "docket","name": "docket"},
  665. { "data": "action","name": "action"},
  666. ],
  667. "columnDefs": [
  668. {
  669. "render": function ( data, type, row ) {
  670. if (data.indexOf("New/") >= 0) {
  671. var split = data.split('/');
  672. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  673. }else {
  674. return data;
  675. }
  676. },
  677. "targets": 0
  678. },
  679. {
  680. "render": function ( data, type, row ) {
  681. var link = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  682. return '<a target="_blank" href="'+link+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  683. },
  684. "targets": 15
  685. }
  686. ],
  687. });
  688. var table6 = $('#canc').DataTable({
  689. "bJQueryUI": false,
  690. "bAutoWidth": true,
  691. "bSort": false,
  692. "sPaginationType": "full_numbers",
  693. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  694. "oLanguage": {
  695. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  696. },
  697. "ordering": false,
  698. "serverSide": true,
  699. "processing": true,
  700. "ajax": "{{ url('/customer-service/get-all-cancelled/null/null/null') }}",
  701. "columns": [
  702. { "data": "formT","name": "formT"},
  703. { "data": "service","name": "service"},
  704. { "data": "wo","name": "wo"},
  705. { "data": "name","name": "name"},
  706. { "data": "phone","name": "phone"},
  707. { "data": "unit","name": "unit"},
  708. { "data": "building","name": "building"},
  709. { "data": "city","name": "city"},
  710. { "data": "package", "name": "package"},
  711. { "data": "contractor","name": "contractor"},
  712. { "data": "installer","name": "installer"},
  713. { "data": "date","name": "date"},
  714. { "data": "time","name": "time"},
  715. { "data": "status","name": "status"},
  716. { "data": "action","name": "action"},
  717. ],
  718. "columnDefs": [
  719. {
  720. "render": function ( data, type, row ) {
  721. if (data.indexOf("New/") >= 0) {
  722. var split = data.split('/');
  723. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  724. }else {
  725. return data;
  726. }
  727. },
  728. "targets": 0
  729. },
  730. {
  731. "render": function ( data, type, row ) {
  732. var link1 = "{{ url('/customer-service/work-order/edit') }}"+"/"+data;
  733. var link2 = "{{ url('/customer-service/work-order/reschedule') }}"+"/"+data;
  734. var link3 = "{{ url('/customer-service/work-order/generate-pdf') }}"+"/"+data;
  735. if(positionRoles == 'Customer Service'){
  736. return '<a href="'+link1+'" class="tablectrl_medium bGreen tipS" original-title="Edit Detail W/O"><span class="iconb" data-icon=""></span></a> <a href="'+link2+'" class="tablectrl_medium bBlue tipS" original-title="Reassign/Change Datetime W/O"><span class="iconb" data-icon=""></span></a> <a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  737. }else{
  738. return '<a target="_blank" href="'+link3+'" class="tablectrl_medium bGold tipS" original-title="View W/O"><span class="iconb" data-icon=""></span></a>';
  739. }
  740. },
  741. "targets": 14
  742. }
  743. ],
  744. });
  745. //===== Modal =====//
  746. // $('#fbyear,#fbmonth').change(function() {
  747. // var link1 = "{{ url('/customer-service/get-all-pending-contractor') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  748. // table1.ajax.url( link1 ).load();
  749. // var link2 = "{{ url('/customer-service/get-all-pending-non') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  750. // table2.ajax.url( link2 ).load();
  751. // var link3 = "{{ url('/customer-service/get-all-success-non') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  752. // table3.ajax.url( link3 ).load();
  753. // var link4 = "{{ url('/customer-service/get-all-pending-installer') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  754. // table4.ajax.url( link3 ).load();
  755. // var link5 = "{{ url('/customer-service/get-all-reschedule') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  756. // table5.ajax.url( link3 ).load();
  757. // var link6 = "{{ url('/customer-service/get-all-suspend') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  758. // table6.ajax.url( link3 ).load();
  759. // var link7 = "{{ url('/customer-service/get-all-completed') }}" +"/"+$('#fbyear').val()+"/"+$('#fbmonth').val()+"/null";
  760. // table7.ajax.url( link3 ).load();
  761. // });
  762. });
  763. </script>
  764. @endsection