Dashboard sipadu mbip
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

staff_index.blade.php 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. @extends('layout.officer', ['uid' => $user->_id, 'token' => $user->token_firebase])
  2. @section('page_title', 'Kompaun')
  3. @section('sub_page_title', '')
  4. @section('name', $user->StaffDetail->full_name)
  5. @section('img_profile', $user->StaffDetail->profile_img)
  6. @section('content')
  7. <style type="text/css">
  8. select.form-control, select.form-control:focus, select.form-control:hover {
  9. border: 1px solid #ccc !important;
  10. height: auto !important;
  11. }
  12. .panel-group .panel {
  13. margin-bottom: 0;
  14. overflow: hidden;
  15. border-radius: 4px;
  16. }
  17. .panel-default {
  18. border-color: #ddd;
  19. }
  20. .panel-default>.panel-heading {
  21. color: #333;
  22. background-color: #f5f5f5;
  23. border-color: #ddd;
  24. }
  25. .panel-title {
  26. margin-top: 0;
  27. margin-bottom: 0;
  28. font-size: 16px;
  29. color: inherit;
  30. }
  31. .panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
  32. padding: 8px 15px;
  33. line-height: 1.428571429;
  34. vertical-align: top;
  35. border-top: 1px solid #ddd;
  36. }
  37. .glyphicon { margin-right:10px; }
  38. .panel-body { padding:0px; }
  39. .panel-body table tr td { padding-left: 15px }
  40. .panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
  41. .panel-body .table, .panel-body div {margin-bottom: 0px; }
  42. .active { color: #d84315; }
  43. .active:hover { color: #d84315; }
  44. .r-padd { padding-right: 5%; }
  45. </style>
  46. <div class="inner-page">
  47. <div class="row">
  48. <div class="col-md-12">
  49. <div class="fluid">
  50. @if(count($errors) > 0)
  51. <div class="alert alert-danger icons-alert">
  52. @foreach($errors->all() as $error)
  53. <p>{{$error}}</p>
  54. @endforeach
  55. </div>
  56. @endif
  57. @if(Session::get('error_msg'))
  58. <div class="alert alert-danger icons-alert">
  59. {!! Session::get('error_msg') !!}
  60. </div>
  61. @elseif(Session::get('success_msg'))
  62. <div class="alert alert-success icons-alert">
  63. {!! Session::get('success_msg') !!}
  64. </div>
  65. @endif
  66. </div>
  67. </div>
  68. </div>
  69. <div class="row">
  70. <div class="col-xl-2 col-md-12">
  71. <div class="panel panel-default">
  72. <div class="panel-heading">
  73. <h4 class="panel-title"> Navigasi </h4>
  74. </div>
  75. <div class="panel-body">
  76. <div>
  77. <a href="{{ url('/officer/staff/index') }}" class="active">Senarai Penguatkuasa</a>
  78. </div>
  79. <div>
  80. <a href="{{ url('/officer/staff/add') }}">Tambah Penguatkuasa</a>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="col-xl-10 col-md-12">
  86. <div class="row">
  87. <div class="col-md-12">
  88. <div class="card">
  89. <div class="card-header">
  90. <h5>Senarai Penguatkuasa</h5>
  91. </div>
  92. <div class="card-block">
  93. <div class="dt-responsive table-responsive">
  94. <table id="staffL" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  95. <thead>
  96. <tr>
  97. <th>#</th>
  98. <th>Name</th>
  99. <th>No.Kp</th>
  100. <th>No.Telefon</th>
  101. <th>No. Badan</th>
  102. <th>Jawatan</th>
  103. <th>Jabatan</th>
  104. <th>Tindakan</th>
  105. </tr>
  106. </thead>
  107. <tfoot>
  108. <tr>
  109. <th>#</th>
  110. <th>Name</th>
  111. <th>No.Kp</th>
  112. <th>No.Telefon</th>
  113. <th>No. Badan</th>
  114. <th>Jawatan</th>
  115. <th>Jabatan</th>
  116. <th>Tindakan</th>
  117. </tr>
  118. </tfoot>
  119. </table>
  120. </div>
  121. <!-- <div class="animation-modal"> -->
  122. <div class="modal fade" id="ViewDetail" tabindex="-1" role="dialog">
  123. <div class="modal-dialog modal-lg" role="document">
  124. <div class="modal-content">
  125. <div class="modal-header">
  126. <h4 class="modal-title">Maklumat Kaitangan</h4>
  127. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  128. <span aria-hidden="true">&times;</span>
  129. </button>
  130. </div>
  131. <div class="modal-body" style="padding-left: 2rem;padding-right: 2rem;">
  132. <div class="row">
  133. <div class="col-md-12">
  134. <div id="prof" style="text-align: center"></div>
  135. </div>
  136. </div>
  137. <hr>
  138. <div class="row">
  139. <div class="col-md-3">
  140. <b>Nama Penuh: </b>
  141. </div>
  142. <div class="col-md-9">
  143. <div id="full_name"></div>
  144. </div>
  145. </div>
  146. <hr>
  147. <div class="row">
  148. <div class="col-md-3">
  149. <b>NRIC</b>
  150. </div>
  151. <div class="col-md-3">
  152. <div id="nric"></div>
  153. </div>
  154. <div class="col-md-3">
  155. <b>Telephone</b>
  156. </div>
  157. <div class="col-md-3">
  158. <div id="mobile"></div>
  159. </div>
  160. </div>
  161. <hr>
  162. <div class="row">
  163. <div class="col-md-3">
  164. <b>Jabatan</b>
  165. </div>
  166. <div class="col-md-9">
  167. <div id="jabatan"></div>
  168. </div>
  169. </div>
  170. <hr>
  171. <div class="row">
  172. <div class="col-md-3">
  173. <b>Jawatan</b>
  174. </div>
  175. <div class="col-md-3">
  176. <div id="jawatan"></div>
  177. </div>
  178. <div class="col-md-3">
  179. <b>Gred</b>
  180. </div>
  181. <div class="col-md-3">
  182. <div id="gred"></div>
  183. </div>
  184. </div>
  185. <hr>
  186. <div class="row">
  187. <div class="col-md-3">
  188. <b>No. Badan</b>
  189. </div>
  190. <div class="col-md-3">
  191. <div id="badan"></div>
  192. </div>
  193. <div class="col-md-3"></div>
  194. <div class="col-md-3"></div>
  195. </div>
  196. <hr>
  197. <div class="row">
  198. <div class="col-md-3">
  199. <b>Alamat</b>
  200. </div>
  201. <div class="col-md-9">
  202. <div id="address" style="width:100%;word-wrap:break-word;text-align: justify;">
  203. </div>
  204. </div>
  205. </div>
  206. <div id="pegawaiM">
  207. <hr>
  208. <div class="row">
  209. <div class="col-md-3">
  210. <b>Akses Modul</b>
  211. </div>
  212. <div class="col-md-9">
  213. <div id="akses" style="width:100%;word-wrap:break-word;text-align: justify;">
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <hr>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. <!-- End <div class="animation-modal"> -->
  224. </div>
  225. </div>
  226. </div>
  227. <div class="md-overlay"></div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. @endsection
  233. @section('external_js')
  234. <script type="text/javascript">
  235. $.ajaxSetup({
  236. headers: {
  237. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  238. }
  239. });
  240. var table = $('#staffL').DataTable({
  241. "ordering": false,
  242. "serverSide": true,
  243. "processing": true,
  244. "ajax": "{{ url('api/officer') }}/null/staff/list/{{ $user->_id }}",
  245. "columns": [
  246. { "data": "index","name": "index"},
  247. { "data": "nama","name": "nama"},
  248. { "data": "ic","name": "ic"},
  249. { "data": "phone", "name": "phone"},
  250. { "data": "no_badan", "name": "no_badan" },
  251. { "data": "jawatan", "name": "jawatan"},
  252. { "data": "jabatan", "name": "jabatan"},
  253. { "data": "tindakan","name": "tindakan"}
  254. ],
  255. "columnDefs": [
  256. {
  257. "render": function ( data, type, row ) {
  258. if (data.indexOf("Baru/") >= 0) {
  259. var split = data.split('/');
  260. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  261. }else {
  262. return data;
  263. }
  264. },
  265. "targets": 0,
  266. },
  267. {
  268. "render": function ( data, type, row ) {
  269. var link = "{{ url('/officer/staff') }}"+"/"+row.tindakan+"/edit";
  270. // return '<div class="btn-group btn-group-sm" style="float: none;"><a onclick="getDetail(\''+data+'\')" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Kakitangan"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a href="'+link+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Kakitangan"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.email + '\')" data-toggle="tooltip" data-placement="top" title="Buang Kakitangan" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>';
  271. return '<div class="btn-group btn-group-sm" style="float: none;"><a onclick="getDetail(\''+data+'\')" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Kakitangan"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a href="'+link+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Kakitangan"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.email + '\')" data-toggle="tooltip" data-placement="top" title="Buang Kakitangan" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>';
  272. },
  273. "targets": 7,
  274. },
  275. ],
  276. "language": {
  277. "paginate": {
  278. "previous": "Sebelum",
  279. "next": "Selepas"
  280. },
  281. "sLengthMenu": "Tunjukkan _MENU_ entri",
  282. "zeroRecords": "Tiada Data Ditemui",
  283. "infoEmpty": "Tiada Rekod Yang Wujud",
  284. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  285. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  286. "sSearch": "Cari:",
  287. }
  288. });
  289. function deleteA(cid,email) {
  290. var cid = cid;
  291. var email = email;
  292. swal({
  293. title: "Adakah anda pasti?",
  294. text: "Anda tidak akan dapat memulihkan rekod kakitangan ini ( " + email + " )",
  295. html: true,
  296. type: "warning",
  297. showCancelButton: true,
  298. confirmButtonClass: "btn-danger",
  299. confirmButtonText: "Ya!",
  300. cancelButtonText: "Batal!",
  301. closeOnConfirm: false
  302. },
  303. function(isConfirm){
  304. if (!isConfirm) return;
  305. $.ajax({
  306. type: "POST",
  307. url: "{{ url('api/delete/staff') }}",
  308. data: { "_token": "{{ csrf_token() }}", id: cid },
  309. success:function(data){
  310. if(data['status'] == "true"){
  311. swal({
  312. title: "Berjaya",
  313. text: data['desc'],
  314. type: "success",
  315. showCancelButton: false,
  316. confirmButtonText: "OK!",
  317. closeOnConfirm: true
  318. },
  319. function(){
  320. table.ajax.url("{{ url('api/officer') }}/null/staff/list/{{ $user->_id }}").load();
  321. });
  322. }else if(data['status'] == "false"){
  323. swal({
  324. title: "Tidak Berjaya",
  325. text: data['desc'],
  326. type: "error",
  327. showCancelButton: false,
  328. confirmButtonText: "OK!",
  329. closeOnConfirm: true
  330. },
  331. function(){
  332. table.ajax.url("{{ url('api/officer') }}/null/staff/list/{{ $user->_id }}").load();
  333. });
  334. }
  335. },
  336. error: function (xhr, ajaxOptions, thrownError) {
  337. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  338. }
  339. });
  340. });
  341. };
  342. function getDetail(id) {
  343. $.ajax({
  344. url: "{{ url('api/staff/detail') }}",
  345. method: "POST",
  346. data: { "_token": "{{ csrf_token() }}", id: id },
  347. success: function(data){
  348. if(data['status'] == "true"){
  349. $('.modal-title').html('Maklumat kakitangan ( No.Badan: ' +data['desc'].no_badan+ ' )');
  350. $('#prof').html("<img src='"+origin+"/"+data['desc'].profile_img+"' style='width:200px'>");
  351. $('#full_name').html(data['desc'].full_name);
  352. $('#nric').html(data['desc'].identity);
  353. $('#mobile').html(data['desc'].mobile);
  354. $('#jabatan').html(data['desc'].jbkod);
  355. $('#jawatan').html(data['desc'].roles_access);
  356. $('#gred').html(data['desc'].gred);
  357. $('#badan').html(data['desc'].no_badan);
  358. $('#address').html(data['desc'].address);
  359. if(data['desc'].roles_access == "Pegawai"){
  360. $('#akses').html(data['desc'].access);
  361. $('#pegawaiM').show();
  362. }else{
  363. $('#pegawaiM').hide();
  364. }
  365. $('#ViewDetail').modal({
  366. show: true
  367. })
  368. }else if(data['status'] == "false"){
  369. swal("Error deleting!", data['desc'], "error");
  370. }
  371. }
  372. });
  373. };
  374. $(document).ready(function() {
  375. var origin = window.location.origin;
  376. $(".theme-loader").animate({
  377. opacity: "0"
  378. },1000);
  379. setTimeout(function() {
  380. $(".theme-loader").remove();
  381. }, 800);
  382. $('[data-toggle="tooltip"]').tooltip();
  383. $("#tapis").click(function(){
  384. var mod = $('#module').val();
  385. var link = origin+"/api/staff/null/PenguatKuasa/"+mod+"/list";
  386. console.log(link);
  387. table.ajax.url(link).load();
  388. });
  389. });
  390. </script>
  391. @endsection