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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 width="90">Actions</th>
  30. </tr>
  31. </thead>
  32. </table>
  33. </div>
  34. <div class="dialog-delete" title="Delete Coverage">
  35. <p id="inner-delete"></p>
  36. </div>
  37. </div>
  38. </div>
  39. @endsection
  40. @section('external_js')
  41. <script>
  42. function deleteA(cid,name) {
  43. var cid = cid;
  44. var name = name;
  45. var email = email;
  46. $('.dialog-delete').attr('data-id' , cid);
  47. document.getElementById("inner-delete").innerHTML = "<p>Are you sure want to delete this coverage ( " + name + " )?</p>";
  48. $('.dialog-delete').dialog('open');
  49. return false;
  50. };
  51. $(document).ready(function(){
  52. var origin = window.location.origin;
  53. //===== Dynamic table toolbars =====//
  54. $('#dyn1 .tOptions').click(function () {
  55. $('#dyn .tablePars').slideToggle(200);
  56. });
  57. $('.tOptions').click(function () {
  58. $(this).toggleClass("act");
  59. });
  60. //======= Filter data table ========//
  61. $('#agent').DataTable({
  62. "bJQueryUI": false,
  63. "bAutoWidth": true,
  64. "bSort": false,
  65. "sPaginationType": "full_numbers",
  66. "sDom": '<"tablePars"fl>t<"tableFooter"ip>',
  67. "oLanguage": {
  68. "sLengthMenu": "<span class='showentries'>Show entries:</span> _MENU_"
  69. },
  70. "ordering": false,
  71. "serverSide": true,
  72. "processing": true,
  73. "ajax": "{{ url('/customer-service/coverage/get-coverage-listR') }}",
  74. "columns": [
  75. { "data": "index","name": "index"},
  76. { "data": "address","name": "address"},
  77. // { "data": "street","name": "street"},
  78. { "data": "city","name": "city"},
  79. { "data": "state","name": "state"},
  80. { "data": "postcode", "name": "postcode"},
  81. { "data": "status_building", "name": "status_building"},
  82. { "data": "action","name": "action"},
  83. ],
  84. "columnDefs": [
  85. {
  86. "render": function ( data, type, row ) {
  87. if (data.indexOf("New/") >= 0) {
  88. var split = data.split('/');
  89. return '<small class="label label-warning">'+split[0]+'</small>&nbsp;'+split[1];
  90. }else {
  91. return data;
  92. }
  93. },
  94. "targets": 0
  95. },
  96. {
  97. "render": function ( data, type, row ) {
  98. var link = "{{ url('/customer-service/coverage/residential/edit') }}"+"/"+data;
  99. 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>';
  100. },
  101. "targets": 6
  102. },
  103. ],
  104. });
  105. //===== Modal =====//
  106. $('.dialog-delete').dialog({
  107. autoOpen: false,
  108. width: 400,
  109. modal: true,
  110. buttons: {
  111. "Yes!": function () {
  112. var id = $(this).data('id');
  113. // window.alert(email);
  114. $.ajax({
  115. type: "POST",
  116. url: "{{ url('/customer-service/coverage/delete-coverage') }}",
  117. data: { "_token": "{{ csrf_token() }}", id: id },
  118. success:function(data)
  119. {
  120. if(data == "true"){
  121. window.location.reload();
  122. }else if(data == "false"){
  123. alert("ERROR!! Cant Delete Coverage !");
  124. }
  125. }
  126. });
  127. },
  128. "Cancel": function () {
  129. $(this).dialog("close");
  130. $('.dialog-delete').removeAttr('data-id');
  131. }
  132. }
  133. });
  134. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  135. });
  136. </script>
  137. @endsection