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.

view_coverageR.blade.php 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. </style>
  13. <!-- Table dealer -->
  14. <div class="fluid">
  15. <div class="widget grid12">
  16. <div class="whead"><h6>Coverage List (R)</h6></div>
  17. <div id="dyn1" class="shownpars cuss responsive">
  18. <a class="tOptions" title="Options"><img src="{{ url('assets/img/icons/options') }}" alt="" /></a>
  19. <table id="agent" cellpadding="0" cellspacing="0" border="0" class="dTable tMedia" width="100%">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th>Building</th>
  24. <!-- <th>Street</th> -->
  25. <th>City</th>
  26. <th>State</th>
  27. <th>Postcode.</th>
  28. <th>Status Building</th>
  29. <th>Project Type</th>
  30. <th width="90">Actions</th>
  31. </tr>
  32. </thead>
  33. </table>
  34. </div>
  35. <div class="dialog-delete" title="Delete Coverage">
  36. <p id="inner-delete"></p>
  37. </div>
  38. </div>
  39. </div>
  40. @endsection
  41. @section('external_js')
  42. <script>
  43. function deleteA(cid,name) {
  44. var cid = cid;
  45. var name = name;
  46. var email = email;
  47. $('.dialog-delete').attr('data-id' , cid);
  48. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this coverage ( " + name + " )?</p>";
  49. $('.dialog-delete').dialog('open');
  50. return false;
  51. };
  52. $(document).ready(function(){
  53. var origin = window.location.origin;
  54. //===== Dynamic table toolbars =====//
  55. $('#dyn1 .tOptions').click(function () {
  56. $('#dyn .tablePars').slideToggle(200);
  57. });
  58. $('.tOptions').click(function () {
  59. $(this).toggleClass("act");
  60. });
  61. //======= Filter data table ========//
  62. $('#agent').DataTable({
  63. "bJQueryUI": false,
  64. "bAutoWidth": true,
  65. "bSort": false,
  66. "sPaginationType": "full_numbers",
  67. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  68. "oLanguage": {
  69. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  70. },
  71. "ordering": false,
  72. "serverSide": true,
  73. "processing": true,
  74. "ajax": "{{ url('/customer-service/coverage/get-coverage-listR') }}",
  75. "columns": [
  76. { "data": "index","name": "index"},
  77. { "data": "address","name": "address"},
  78. // { "data": "street","name": "street"},
  79. { "data": "city","name": "city"},
  80. { "data": "state","name": "state"},
  81. { "data": "postcode", "name": "postcode"},
  82. { "data": "status_building", "name": "status_building"},
  83. { "data": "project_type", "name": "project_type"},
  84. { "data": "action","name": "action"},
  85. ],
  86. "columnDefs": [
  87. {
  88. "render": function ( data, type, row ) {
  89. if (data.indexOf("New/") >= 0) {
  90. var split = data.split('/');
  91. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  92. }else {
  93. return data;
  94. }
  95. },
  96. "targets": 0
  97. },
  98. {
  99. "render": function ( data, type, row ) {
  100. var link = "{{ url('/customer-service/coverage/residential/edit') }}"+"/"+data;
  101. return '<a href="'+link+'" class="tablectrl_medium bLightBlue tipS" title="Edit Coverage"><span class="iconb" data-icon="&#xe003;"></span></a> <a class="tablectrl_medium bRed tipS delModule" onclick="deleteA(\''+data+'\',\'' + row.address + '\',)" title="Delete Coverage"><span class="iconb" data-icon="&#xe136;"></span></a>';
  102. },
  103. "targets": 7
  104. },
  105. ],
  106. });
  107. //===== Modal =====//
  108. $('.dialog-delete').dialog({
  109. autoOpen: false,
  110. width: 400,
  111. modal: true,
  112. buttons: {
  113. "Yes!": function () {
  114. var id = $(this).data('id');
  115. // window.alert(email);
  116. $.ajax({
  117. type: "POST",
  118. url: "{{ url('/customer-service/coverage/delete-coverage') }}",
  119. data: { "_token": "{{ csrf_token() }}", id: id },
  120. success:function(data)
  121. {
  122. if(data == "true"){
  123. window.location.reload();
  124. }else if(data == "false"){
  125. alert("ERROR!! Cant Delete Coverage !");
  126. }
  127. }
  128. });
  129. },
  130. "Cancel": function () {
  131. $(this).dialog("close");
  132. $('.dialog-delete').removeAttr('data-id');
  133. }
  134. }
  135. });
  136. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  137. });
  138. </script>
  139. @endsection