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.

application-form-list.blade.php 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. @extends('sales.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. $.ajax({
  97. type: "GET",
  98. url: origin+'/sales/history/'+cid,
  99. dataType: "json",
  100. success:function(data){
  101. var table = '<table cellpadding="0" cellspacing="0" width="100%" class="tDefault checkAll tMedia" id="checkAll">';
  102. table += '<thead><tr>';
  103. table += '<td width="130" class="sortCol"><div>Date<span></span></div></td>';
  104. table += '<td width="120">Status</td>';
  105. table += '<td class="sortCol"><div>Description<span></span></div></td>';
  106. table += '</tr></thead><tbody></tbody></table>';
  107. $('#data-history').html(table);
  108. console.log(data)
  109. $.each(data, function(index, element) {
  110. $('#checkAll tbody').append('<tr><td>' + element.date + '</td><td class="textL">' + element.status + '</td><td class="textL">' + element.desc + '</td></tr>');
  111. });
  112. }
  113. });
  114. $('#customDialog').dialog('open');
  115. return false;
  116. };
  117. $(document).ready(function(){
  118. var origin = window.location.origin;
  119. var curr = '<?php echo $user->_id ?>';
  120. //===== Dynamic table toolbars =====//
  121. $('#dyn1 .tOptions').click(function () {
  122. $('#dyn .tablePars').slideToggle(200);
  123. });
  124. $('.tOptions').click(function () {
  125. $(this).toggleClass("act");
  126. });
  127. //======= Filter data table ========//
  128. $('#newList').DataTable({
  129. "bJQueryUI": false,
  130. "bAutoWidth": true,
  131. "bSort": false,
  132. "sPaginationType": "full_numbers",
  133. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  134. "oLanguage": {
  135. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  136. },
  137. "ordering": false,
  138. "serverSide": true,
  139. "processing": true,
  140. "ajax": "{{ url('/sales/get-application-list1') }}",
  141. "columns": [
  142. { "data": "index","name": "index"},
  143. { "data": "name","name": "name"},
  144. { "data": "phone","name": "phone"},
  145. { "data": "unit","name": "unit"},
  146. { "data": "building","name": "building"},
  147. { "data": "street","name": "street"},
  148. { "data": "postcode","name": "postcode"},
  149. { "data": "city","name": "city"},
  150. { "data": "sales","name": "sales"},
  151. { "data": "action","name": "action"},
  152. ],
  153. "columnDefs": [
  154. {
  155. "render": function ( data, type, row ) {
  156. if (data.indexOf("-You") >= 0) {
  157. var split = data.split('-');
  158. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  159. }else if (data.indexOf("New/") >= 0) {
  160. var split = data.split('/');
  161. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  162. }else {
  163. return data;
  164. }
  165. },
  166. "targets": 0
  167. },
  168. {
  169. "render": function ( data, type, row ) {
  170. 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>';
  171. },
  172. "targets": 9
  173. },
  174. ],
  175. });
  176. $('#pendingList').DataTable({
  177. "bJQueryUI": false,
  178. "bAutoWidth": true,
  179. "bSort": false,
  180. "sPaginationType": "full_numbers",
  181. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  182. "oLanguage": {
  183. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  184. },
  185. "ordering": false,
  186. "serverSide": true,
  187. "processing": true,
  188. "ajax": "{{ url('/sales/get-application-list2') }}",
  189. "columns": [
  190. { "data": "index","name": "index"},
  191. { "data": "name","name": "name"},
  192. { "data": "phone","name": "phone"},
  193. { "data": "unit","name": "unit"},
  194. { "data": "building","name": "building"},
  195. { "data": "street","name": "street"},
  196. { "data": "postcode","name": "postcode"},
  197. { "data": "city","name": "city"},
  198. { "data": "sales","name": "sales"},
  199. { "data": "action","name": "action"},
  200. ],
  201. "columnDefs": [
  202. {
  203. "render": function ( data, type, row ) {
  204. if (data.indexOf("-You") >= 0) {
  205. var split = data.split('-');
  206. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  207. }else if (data.indexOf("New/") >= 0) {
  208. var split = data.split('/');
  209. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  210. }else {
  211. return data;
  212. }
  213. },
  214. "targets": 0
  215. },
  216. {
  217. "width":"60px",
  218. "targets": 2
  219. },
  220. {
  221. "render": function ( data, type, row ) {
  222. 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>';
  223. },
  224. "targets": 9
  225. },
  226. ],
  227. });
  228. var completed = $('#completeList').DataTable({
  229. "bJQueryUI": false,
  230. "bAutoWidth": true,
  231. "bSort": false,
  232. "sPaginationType": "full_numbers",
  233. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  234. "oLanguage": {
  235. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  236. },
  237. "ordering": false,
  238. "serverSide": true,
  239. "processing": true,
  240. "ajax": "{{ url('/sales/get-application-list3/null/null') }}",
  241. "columns": [
  242. { "data": "index","name": "index"},
  243. { "data": "wo","name": "wo"},
  244. { "data": "do","name": "do"},
  245. { "data": "activated","name": "activated"},
  246. { "data": "name","name": "name"},
  247. { "data": "phone","name": "phone"},
  248. { "data": "unit","name": "unit"},
  249. { "data": "building","name": "building"},
  250. { "data": "street","name": "street"},
  251. { "data": "postcode","name": "postcode"},
  252. { "data": "city","name": "city"},
  253. { "data": "sales","name": "sales"},
  254. { "data": "action","name": "action"},
  255. ],
  256. "columnDefs": [
  257. {
  258. "render": function ( data, type, row ) {
  259. if (data.indexOf("-You") >= 0) {
  260. var split = data.split('-');
  261. return '<small class="label label-info">'+split[1]+'</small>&nbsp;'+split[0];
  262. }else if (data.indexOf("New/") >= 0) {
  263. var split = data.split('/');
  264. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  265. }else {
  266. return data;
  267. }
  268. },
  269. "targets": 0
  270. },
  271. {
  272. "render": function ( data, type, row ) {
  273. 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>';
  274. },
  275. "targets": 12
  276. },
  277. ],
  278. });
  279. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  280. // Filter by Year & Month
  281. $('#fbyear,#fbmonth').on('change',function(){
  282. if($('#fbyear').val() == '' && $('#fbmonth').val() == ''){
  283. completed.ajax.url( origin+'/sales/get-application-list3/null/null' ).load();
  284. }else if($('#fbyear').val() != '' && $('#fbmonth').val() != ''){
  285. completed.ajax.url( origin+'/sales/get-application-list3/'+$('#fbyear').val()+'/'+$('#fbmonth').val() ).load();
  286. }
  287. });
  288. // Dialog
  289. $('#customDialog').dialog({
  290. autoOpen: false,
  291. width: 650,
  292. modal: true,
  293. buttons: {
  294. "Close": function () {
  295. $(this).dialog("close");
  296. }
  297. }
  298. });
  299. });
  300. </script>
  301. @endsection