Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

view_customer.blade.php 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. @extends('customer-service.layout.master')
  2. @section('ptitle','Customer Service')
  3. @section('page_title', 'Customers & Subscribers')
  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. </style>
  13. <!-- Table dealer -->
  14. <div class="fluid">
  15. <div class="widget grid12">
  16. <div class="whead"><h6>Customer's List ( Resident & Business )</h6></div>
  17. <div id="dyn1" class="responsive shownpars cuss">
  18. <a class="tOptions" title="Options"><img src="{{ url('assets/img/icons/options') }}" alt="" /></a>
  19. @if($user->StaffDetail->position == 'Customer Service')
  20. <table id="customer" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  21. <thead>
  22. <tr>
  23. <th>#</th>
  24. <th>Type Application</th>
  25. <th>Customer Name</th>
  26. <th>Contact No.</th>
  27. <th>Unit No.</th>
  28. <th>Building</th>
  29. <th>Project Type</th>
  30. <th>Street</th>
  31. <!-- <th>Postcode</th> -->
  32. <th>Need Phone</th>
  33. <th>Email</th>
  34. <th>W/O</th>
  35. <th width="90">Actions</th>
  36. </tr>
  37. </thead>
  38. </table>
  39. @elseif($user->StaffDetail->position == 'Careline')
  40. <table id="view_customer" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  41. <thead>
  42. <tr>
  43. <th>#</th>
  44. <th>Type Application</th>
  45. <th>Customer Name</th>
  46. <th>Contact No.</th>
  47. <th>Unit No.</th>
  48. <th>Building</th>
  49. <th>Project Type</th>
  50. <th>Street</th>
  51. <th>Need Phone</th>
  52. <th>Email</th>
  53. </tr>
  54. </thead>
  55. </table>
  56. @endif
  57. </div>
  58. <div class="dialog-delete" title="Delete Customer">
  59. <p id="inner-delete"></p>
  60. </div>
  61. </div>
  62. </div>
  63. @endsection
  64. @section('external_js')
  65. <script>
  66. function deleteA(cid,name) {
  67. var cid = cid;
  68. var name = name;
  69. $('.dialog-delete').attr('data-id' , cid);
  70. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this Customer ( " + name + " )?</p>";
  71. $('.dialog-delete').dialog('open');
  72. return false;
  73. };
  74. $(document).ready(function(){
  75. var origin = window.location.origin;
  76. //===== Dynamic table toolbars =====//
  77. $('#dyn1 .tOptions').click(function () {
  78. $('#dyn .tablePars').slideToggle(200);
  79. });
  80. $('.tOptions').click(function () {
  81. $(this).toggleClass("act");
  82. });
  83. //======= Filter data table ========//
  84. var table = $('#customer').DataTable({
  85. "bJQueryUI": false,
  86. "bAutoWidth": true,
  87. "bSort": false,
  88. "sPaginationType": "full_numbers",
  89. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  90. "oLanguage": {
  91. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  92. },
  93. "ordering": false,
  94. "serverSide": true,
  95. "processing": true,
  96. "ajax": "{{ url('/customer-service/get-all-new-customer/null/null/null') }}",
  97. "columns": [
  98. { "data": "formT","name": "formT"},
  99. { "data": "type","name": "type"},
  100. { "data": "name","name": "name"},
  101. { "data": "phone","name": "phone"},
  102. { "data": "unit","name": "unit"},
  103. { "data": "building","name": "building"},
  104. { "data": "projectT", "name": "projectT"},
  105. { "data": "street","name": "street"},
  106. // { "data": "postcode", "name": "postcode"},
  107. { "data": "need_phone","name": "need_phone"},
  108. { "data": "email","name": "email"},
  109. { "data": "action1","name": "action1"},
  110. { "data": "action2","name": "action2"},
  111. ],
  112. "columnDefs": [
  113. {
  114. "render": function ( data, type, row ) {
  115. if (data.indexOf("New/") >= 0) {
  116. var split = data.split('/');
  117. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  118. }else {
  119. return data;
  120. }
  121. },
  122. "targets": 0
  123. },
  124. {
  125. "render": function ( data, type, row ) {
  126. if (data.indexOf("D/") >= 0) {
  127. var split = data.split('/');
  128. return '<small class="label label-purple">'+split[0]+'</small> &nbsp;'+split[1];
  129. }else {
  130. return data;
  131. }
  132. },
  133. "targets": 2
  134. },
  135. {
  136. "render": function ( data, type, row ) {
  137. if(data == 'unverified'){
  138. var link = "{{ url('/customer-service/update-email-status') }}"+"/"+row.action2;
  139. return '<div class="btn-group"><a href="" class="tablectrl_medium bRed tipS" data-toggle="dropdown" original-title="Waiting for verifying"><span class="iconb" data-icon=""></span></a> <ul class="dropdown-menu pull-right"><li><a href="'+link+'">Force Verify</a></li></ul></div>';
  140. }else {
  141. return '<a class="tablectrl_medium bGreen isDisabled tipS" link-disabled="" original-title="Success verifying"><span class="iconb" data-icon=""></span></a>';
  142. }
  143. },
  144. "targets": 9
  145. },
  146. {
  147. "render": function ( data, type, row ) {
  148. if(data != ''){
  149. if (data.indexOf("Non/") >= 0) {
  150. var split = data.split('Non/');
  151. var link = "{{ url('/customer-service/work-order/add/schedule') }}"+"/non-prelaid/"+split[1];
  152. return '<a href="'+link+'" class="tablectrl_medium bPurple tipS" title="Non Prelaid<"><span>Non Prelaid</span></a>';
  153. }else {
  154. var link = "{{ url('/customer-service/work-order/add/schedule') }}"+"/prelaid/"+data;
  155. return '<a href="'+link+'" class="tablectrl_medium bPurple tipS" title="Create New W/O"><span>W/O</span></a>';
  156. }
  157. }else {
  158. return data;
  159. }
  160. },
  161. "targets": 10
  162. },
  163. {
  164. "render": function ( data, type, row ) {
  165. var link = "{{ url('/customer-service/edit/customer') }}"+"/"+data;
  166. var link2 = "{{ url('/customer-service/customer/pdf') }}"+"/"+data;
  167. return '<a target="_blank" href="'+link2+'" class="tablectrl_medium bPurple tipS" original-title="View Subscribers"><span class="iconb" data-icon=""></span></a> <a href="'+link+'" class="tablectrl_medium bLightBlue tipS" title="Edit Agent"><span class="iconb" data-icon="&#xe003;"></span></a> <a class="tablectrl_medium bRed tipS delModule" onclick="deleteA(\''+data+'\',\'' + row.name + '\', )" title="Delete Customer"><span class="iconb" data-icon="&#xe136;"></span></a>';
  168. },
  169. "targets": 11
  170. }
  171. ],
  172. });
  173. var table3 = $('#view_customer').DataTable({
  174. "bJQueryUI": false,
  175. "bAutoWidth": true,
  176. "bSort": false,
  177. "sPaginationType": "full_numbers",
  178. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  179. "oLanguage": {
  180. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  181. },
  182. "ordering": false,
  183. "serverSide": true,
  184. "processing": true,
  185. "ajax": "{{ url('/customer-service/get-all-new-customer/null/null/null') }}",
  186. "columns": [
  187. { "data": "formT","name": "formT"},
  188. { "data": "type","name": "type"},
  189. { "data": "name","name": "name"},
  190. { "data": "phone","name": "phone"},
  191. { "data": "unit","name": "unit"},
  192. { "data": "building","name": "building"},
  193. { "data": "projectT","name":"projectT"},
  194. { "data": "street","name": "street"},
  195. // { "data": "postcode", "name": "postcode"},
  196. { "data": "need_phone","name": "need_phone"},
  197. { "data": "email","name": "email"},
  198. ],
  199. "columnDefs": [
  200. {
  201. "render": function ( data, type, row ) {
  202. if (data.indexOf("New/") >= 0) {
  203. var split = data.split('/');
  204. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  205. }else {
  206. return data;
  207. }
  208. },
  209. "targets": 0
  210. },
  211. {
  212. "render": function ( data, type, row ) {
  213. if (data.indexOf("D/") >= 0) {
  214. var split = data.split('/');
  215. return '<small class="label label-purple">'+split[0]+'</small> &nbsp;'+split[1];
  216. }else {
  217. return data;
  218. }
  219. },
  220. "targets": 2
  221. },
  222. {
  223. "render": function ( data, type, row ) {
  224. if(data == 'unverified'){
  225. return '<a href="" class="tablectrl_medium bRed tipS" data-toggle="dropdown" original-title="Waiting for verifying"><span class="iconb" data-icon=""></span></a>';
  226. }else {
  227. return '<a class="tablectrl_medium bGreen isDisabled tipS" link-disabled="" original-title="Success verifying"><span class="iconb" data-icon=""></span></a>';
  228. }
  229. },
  230. "targets": 9
  231. },
  232. ],
  233. });
  234. //===== Modal =====//
  235. $('.dialog-delete').dialog({
  236. autoOpen: false,
  237. width: 400,
  238. modal: true,
  239. buttons: {
  240. "Yes!": function () {
  241. var id = $(this).data('id');
  242. // window.alert(email);
  243. $.ajax({
  244. type: "POST",
  245. url: "{{ url('/customer-service/delete-new-customer') }}",
  246. data: { "_token": "{{ csrf_token() }}", id: id },
  247. success:function(data)
  248. {
  249. if(data == "true"){
  250. window.location.reload();
  251. }else if(data == "false"){
  252. alert("ERROR!! Cant Delete Customer !");
  253. }
  254. }
  255. });
  256. },
  257. "Cancel": function () {
  258. $(this).dialog("close");
  259. $('.dialog-delete').removeAttr('data-id');
  260. }
  261. }
  262. });
  263. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  264. /*** Filter ***/
  265. $('#fbtype,#fbbuilding,#fbdealer').on('change', function() {
  266. var link = "{{ url('/customer-service/get-all-new-customer') }}" +"/"+$('#fbtype').val()+"/"+$('#fbbuilding').val()+"/"+$('#fbdealer').val();
  267. table.ajax.url( link ).load();
  268. });
  269. });
  270. </script>
  271. @endsection