Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

application-form-list.blade.php 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. @extends('dealer.layout.master')
  2. @section('page_title', 'Subscription Form List')
  3. @section('subpage', 'Graph & Summary Report')
  4. @section('img_profile', asset($user->StaffDetail->user_pic))
  5. @section('login_name', $user->StaffDetail->name )
  6. @section('last_login', $user->last_login_at )
  7. @section('content')
  8. <style>
  9. .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: #EA5730 !important; }
  10. .ui-widget-content .bRed { color: #fff !important; }
  11. .ui-tabs .ui-tabs-panel{padding:0px;}
  12. .modal_open{color: #fff !important;}
  13. </style>
  14. <!-- Table dealer -->
  15. <div class="fluid">
  16. <div class="widget grid12">
  17. <div class="whead"><h6>Subscription Form List</h6></div>
  18. <div id="dyn1" class="cuss shownpars">
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="#new">New</a></li>
  22. <li><a href="#pending">Pending</a></li>
  23. <li><a href="#completed">Completed<a></li>
  24. </ul>
  25. <div id="new" class="table=-responsive">
  26. <table id="newList" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  27. <thead>
  28. <tr>
  29. <th>#</th>
  30. <th>Cust.Name</th>
  31. <th>Contact No.</th>
  32. <th width="80">Unit No.</th>
  33. <th>Building</th>
  34. <th>Street</th>
  35. <th>Postcode</th>
  36. <th>City</th>
  37. <th>Agent</th>
  38. <th width="40">Actions</th>
  39. </tr>
  40. </thead>
  41. </table>
  42. </div>
  43. <div id="pending">
  44. <table id="pendingList" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  45. <thead>
  46. <tr>
  47. <th>#</th>
  48. <th>Cust.Name</th>
  49. <th>Contact No.</th>
  50. <th width="80">Unit No.</th>
  51. <th>Building</th>
  52. <th>Street</th>
  53. <th>Postcode</th>
  54. <th>City</th>
  55. <th>Agent</th>
  56. <th width="40">Actions</th>
  57. </tr>
  58. </thead>
  59. </table>
  60. </div>
  61. <div id="completed">
  62. <table id="completeList" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  63. <thead>
  64. <tr>
  65. <th>#</th>
  66. <th>W/O</th>
  67. <th>Docket</th>
  68. <!-- <th>Activated</th> -->
  69. <th>Cust.Name</th>
  70. <th>Contact No.</th>
  71. <th>Unit No.</th>
  72. <th>Building</th>
  73. <th>Street</th>
  74. <th>Postcode</th>
  75. <th>City</th>
  76. <th>Agent</th>
  77. <th>Actions</th>
  78. </tr>
  79. </thead>
  80. </table>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- Dialog content -->
  86. <div id="customDialog" class="customDialog" title="Status Form">
  87. <div id="data-history"></div>
  88. </div>
  89. </div>
  90. @endsection
  91. @section('external_js')
  92. <script>
  93. function showHistory(cid) {
  94. var origin = window.location.origin;
  95. var cid = cid;
  96. console.log(cid);
  97. $.ajax({
  98. type: "GET",
  99. url: origin+'/dealer/history/'+cid,
  100. dataType: "json",
  101. success:function(data){
  102. var table = '<table cellpadding="0" cellspacing="0" width="100%" class="tDefault checkAll tMedia" id="checkAll">';
  103. table += '<thead><tr>';
  104. table += '<td width="130" class="sortCol"><div>Date<span></span></div></td>';
  105. table += '<td width="120">Status</td>';
  106. table += '<td class="sortCol"><div>Description<span></span></div></td>';
  107. table += '</tr></thead><tbody></tbody></table>';
  108. $('#data-history').html(table);
  109. console.log(data)
  110. $.each(data, function(index, element) {
  111. $('#checkAll tbody').append('<tr><td>' + element.date + '</td><td class="textL">' + element.status + '</td><td class="textL">' + element.desc + '</td></tr>');
  112. });
  113. }
  114. });
  115. $('#customDialog').dialog('open');
  116. return false;
  117. };
  118. $(document).ready(function(){
  119. var origin = window.location.origin;
  120. var curr = '{{ $user->_id }}';
  121. //===== Dynamic table toolbars =====//
  122. $('#dyn1 .tOptions').click(function () {
  123. $('#dyn .tablePars').slideToggle(200);
  124. });
  125. $('.tOptions').click(function () {
  126. $(this).toggleClass("act");
  127. });
  128. //======= Filter data table ========//
  129. $('#newList').DataTable({
  130. "bJQueryUI": false,
  131. "bAutoWidth": true,
  132. "bSort": false,
  133. "sPaginationType": "full_numbers",
  134. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  135. "oLanguage": {
  136. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  137. },
  138. "ordering": false,
  139. "serverSide": true,
  140. "processing": true,
  141. "ajax": "{{ url('/dealer/get-application-list1') }}",
  142. "columns": [
  143. { "data": "index","name": "index"},
  144. { "data": "name","name": "name"},
  145. { "data": "phone","name": "phone"},
  146. { "data": "unit","name": "unit"},
  147. { "data": "building","name": "building"},
  148. { "data": "street","name": "street"},
  149. { "data": "postcode","name": "postcode"},
  150. { "data": "city","name": "city"},
  151. { "data": "sales","name": "sales"},
  152. { "data": "action","name": "action"},
  153. ],
  154. "columnDefs": [
  155. {
  156. "render": function ( data, type, row ) {
  157. if (data.indexOf("-You") >= 0) {
  158. var split = data.split('-');
  159. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  160. }else if (data.indexOf("New/") >= 0) {
  161. var split = data.split('/');
  162. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  163. }else {
  164. return data;
  165. }
  166. },
  167. "targets": 1
  168. },
  169. {
  170. "render": function ( data, type, row ) {
  171. return '<a class="tablectrl_medium bGold tipS ml10 modal_open" title="View Status Form" data-cid="'+data+'" onclick="showHistory(\''+data+'\')"><span class="iconb" data-icon="&#xe157;"></span></a>';
  172. },
  173. "targets": 9
  174. },
  175. ],
  176. });
  177. $('#pendingList').DataTable({
  178. "bJQueryUI": false,
  179. "bAutoWidth": true,
  180. "bSort": false,
  181. "sPaginationType": "full_numbers",
  182. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  183. "oLanguage": {
  184. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  185. },
  186. "ordering": false,
  187. "serverSide": true,
  188. "processing": true,
  189. "ajax": "{{ url('/dealer/get-application-list2') }}",
  190. "columns": [
  191. { "data": "index","name": "index"},
  192. { "data": "name","name": "name"},
  193. { "data": "phone","name": "phone"},
  194. { "data": "unit","name": "unit"},
  195. { "data": "building","name": "building"},
  196. { "data": "street","name": "street"},
  197. { "data": "postcode","name": "postcode"},
  198. { "data": "city","name": "city"},
  199. { "data": "sales","name": "sales"},
  200. { "data": "action","name": "action"},
  201. ],
  202. "columnDefs": [
  203. {
  204. "render": function ( data, type, row ) {
  205. if (data.indexOf("-You") >= 0) {
  206. var split = data.split('-');
  207. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  208. }else if (data.indexOf("New/") >= 0) {
  209. var split = data.split('/');
  210. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  211. }else {
  212. return data;
  213. }
  214. },
  215. "targets": 1
  216. },
  217. {
  218. "render": function ( data, type, row ) {
  219. return '<a class="tablectrl_medium bGold tipS ml10 modal_open" title="View Status Form" data-cid="'+data+'" onclick="showHistory(\''+data+'\')"><span class="iconb" data-icon="&#xe157;"></span></a>';
  220. },
  221. "targets": 9
  222. },
  223. ],
  224. });
  225. var completed = $('#completeList').DataTable({
  226. "bJQueryUI": false,
  227. "bAutoWidth": true,
  228. "bSort": false,
  229. "sPaginationType": "full_numbers",
  230. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  231. "oLanguage": {
  232. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  233. },
  234. "ordering": false,
  235. "serverSide": true,
  236. "processing": true,
  237. "ajax": "{{ url('/dealer/get-application-list3/null/null') }}",
  238. "columns": [
  239. { "data": "index","name": "index"},
  240. { "data": "wo","name": "wo"},
  241. { "data": "do","name": "do"},
  242. // { "data": "activated","name": "activated"},
  243. { "data": "name","name": "name"},
  244. { "data": "phone","name": "phone"},
  245. { "data": "unit","name": "unit"},
  246. { "data": "building","name": "building"},
  247. { "data": "street","name": "street"},
  248. { "data": "postcode","name": "postcode"},
  249. { "data": "city","name": "city"},
  250. { "data": "sales","name": "sales"},
  251. { "data": "action","name": "action"},
  252. ],
  253. "columnDefs": [
  254. {
  255. "render": function ( data, type, row ) {
  256. if (data.indexOf("-You") >= 0) {
  257. var split = data.split('-');
  258. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  259. }else if (data.indexOf("New/") >= 0) {
  260. var split = data.split('/');
  261. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  262. }else {
  263. return data;
  264. }
  265. },
  266. "targets": 4
  267. },
  268. {
  269. "render": function ( data, type, row ) {
  270. return '<a class="tablectrl_medium bGold tipS ml10 modal_open" title="View Status Form" data-cid="'+data+'" onclick="showHistory(\''+data+'\')"><span class="iconb" data-icon="&#xe157;"></span></a>';
  271. },
  272. "targets": 11
  273. },
  274. ],
  275. });
  276. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  277. // Filter by Year & Month
  278. $('#fbyear,#fbmonth').on('change',function(){
  279. if($('#fbyear').val() == '' && $('#fbmonth').val() == ''){
  280. completed.ajax.url( origin+'/dealer/get-application-list3/null/null' ).load();
  281. }else if($('#fbyear').val() != '' && $('#fbmonth').val() != ''){
  282. completed.ajax.url( origin+'/dealer/get-application-list3/'+$('#fbyear').val()+'/'+$('#fbmonth').val() ).load();
  283. }
  284. });
  285. // Dialog
  286. $('#customDialog').dialog({
  287. autoOpen: false,
  288. width: 650,
  289. modal: true,
  290. buttons: {
  291. "Close": function () {
  292. $(this).dialog("close");
  293. }
  294. }
  295. });
  296. });
  297. </script>
  298. @endsection