Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

view_contractor.blade.php 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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>Contractor's List</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">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th>Image</th>
  24. <th>Contractor Name</th>
  25. <th>NRIC</th>
  26. <th>Email</th>
  27. <th>Contact No.</th>
  28. <th>Vendor</th>
  29. <th>Position</th>
  30. <th width="90">Actions</th>
  31. </tr>
  32. </thead>
  33. </table>
  34. </div>
  35. <div class="dialog-delete" title="Delete Contractor">
  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,email) {
  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 Contractor ( " + 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/team/get-contractor-list') }}",
  75. "columns": [
  76. { "data": "index","name": "index"},
  77. { "data": "user_pic","name": "user_pic"},
  78. { "data": "name","name": "name"},
  79. { "data": "ic","name": "ic"},
  80. { "data": "email","name": "email"},
  81. { "data": "phone","name": "phone"},
  82. { "data": "company_id", "name": "company_id"},
  83. { "data": "position","name": "position"},
  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/team/contractor/edit') }}"+"/"+data;
  101. /*<a href="'+link+'" class="tablectrl_medium bLightBlue tipS" title="Edit Agent"><span class="iconb" data-icon="&#xe003;"></span></a>*/
  102. return '<a class="tablectrl_medium bRed tipS delModule" onclick="deleteA(\''+data+'\',\'' + row.name + '\',\'' + row.email + '\', )" title="Delete Contractor"><span class="iconb" data-icon="&#xe136;"></span></a> ';
  103. },
  104. "targets": 8
  105. },
  106. {
  107. "render": function ( data, type, row ) {
  108. return '<img src="{{url('')}}/'+row.user_pic+'" alt="" width="37px" height="36px">';
  109. },
  110. "targets": 1
  111. },
  112. ],
  113. });
  114. //===== Modal =====//
  115. $('.dialog-delete').dialog({
  116. autoOpen: false,
  117. width: 400,
  118. modal: true,
  119. buttons: {
  120. "Yes!": function () {
  121. var id = $(this).data('id');
  122. // window.alert(email);
  123. $.ajax({
  124. type: "POST",
  125. url: "{{ url('/customer-service/team/delete-contractor') }}",
  126. data: { "_token": "{{ csrf_token() }}", id: id },
  127. success:function(data)
  128. {
  129. if(data == "true"){
  130. window.location.reload();
  131. }else if(data == "false"){
  132. alert("ERROR!! Cant Delete Contractor !");
  133. }
  134. }
  135. });
  136. },
  137. "Cancel": function () {
  138. $(this).dialog("close");
  139. $('.dialog-delete').removeAttr('data-id');
  140. }
  141. }
  142. });
  143. $('.tipS').tipsy({gravity: 's',fade: true, html:true});
  144. });
  145. </script>
  146. @endsection