Dashboard sipadu mbip
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.

compound_index.blade.php 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. .r-padd { padding-right: 5%; }
  43. .active { color: #d84315; }
  44. .active:hover { color: #d84315; }
  45. th { font-weight: 600; }
  46. table.dataTable.nowrap th, table.dataTable.nowrap td {
  47. white-space: pre-line !important;
  48. }
  49. </style>
  50. <div class="inner-page">
  51. <div class="row">
  52. <div class="col-xl-2 col-md-12">
  53. <div class="panel panel-default">
  54. <div class="panel-heading">
  55. <h4 class="panel-title"> Modul Kategori </h4>
  56. </div>
  57. <div class="panel-body">
  58. <div>
  59. <a href="{{ url('/officer/compound') }}" class="active">Baru</a>&nbsp;<label class="badge badge-inverse-danger">{{ $baru }}</label>
  60. </div>
  61. @if(array_search('04', array_column($roles, 'kod')))
  62. <div>
  63. <a href="{{ url('/officer/compound/investigation') }}">Pengesahan Kompaun</a>&nbsp;<label class="badge badge-success">{{ $invest }}</label>
  64. </div>
  65. @endif
  66. @if(array_search('05', array_column($roles, 'kod')))
  67. <div>
  68. <a href="{{ url('/officer/compound/notice') }}">Notis Amaran</a>&nbsp;<label class="badge badge-success">{{ $notice }}</label>
  69. </div>
  70. @endif
  71. @if(array_search('06', array_column($roles, 'kod')) || array_search('07', array_column($roles, 'kod')))
  72. <div>
  73. <a href="{{ url('/officer/compound/confiscated') }}">Sitaan</a>&nbsp;<label class="badge badge-success">{{ $inven }}</label>
  74. </div>
  75. @endif
  76. <div>
  77. <a href="{{ url('/officer/compound/completed') }}">Kompaun Dijelaskan</a>&nbsp;<label class="badge badge-success">{{ $comp }}</label>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="col-xl-10 col-md-12">
  83. <div class="row">
  84. <div class="col-md-12">
  85. <div class="card">
  86. <div class="card-block">
  87. <form class="form-inline">
  88. <div class="form-group" style="padding-right: 10px;">
  89. <label class="r-padd"><b>CARIAN: </b></label>
  90. </div>
  91. <div class="form-group" style="padding-right: 10px;">
  92. <select name="select" class="form-control form-control-sm" id="jbkod">
  93. <option selected value="null">Sila Pilih Jabatan</option>
  94. @foreach($department as $de)
  95. <option value="{{ $de->_id }}">[{{ $de->jbkod }}] {{ $de->jnama }}</option>
  96. @endforeach
  97. </select>
  98. </div>
  99. <div class="form-group" style="padding-right: 10px;">
  100. <select name="select" class="form-control form-control-sm" id="acts">
  101. </select>
  102. </div>
  103. <div class="form-group" style="padding-right: 10px;">
  104. <select name="select" class="form-control form-control-sm" id="faulty">
  105. <option selected value="null">Sila Pilih Kesalahan</option>
  106. </select>
  107. </div>
  108. <div class="form-group">
  109. <button type="button" id="tapis" class="btn btn-primary btn-sm waves-effect waves-light" style="padding: 6px 14px !important;">Tapis</button>
  110. </div>
  111. </form>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="row">
  117. <div class="col-md-12">
  118. <div class="card">
  119. <div class="card-header">
  120. <h5>Senarai Kompaun</h5>
  121. </div>
  122. <div class="card-block contact-details">
  123. <div class="data_table_main dt-responsive table-responsive">
  124. <table id="compound" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  125. <thead>
  126. <tr>
  127. <th>Modul/Kpd</th>
  128. <th>Jenis</th>
  129. <th>Tarikh</th>
  130. <th>Masa</th>
  131. <th>Kesalahan</th>
  132. <th width="110">Kadar Kompaun</th>
  133. <th>Status</th>
  134. <th>Tindakan</th>
  135. </tr>
  136. </thead>
  137. <tfoot>
  138. <tr>
  139. <th>Modul/Kpd</th>
  140. <th>Jenis</th>
  141. <th>Tarikh</th>
  142. <th>Masa</th>
  143. <th>Kesalahan</th>
  144. <th width="110">Kadar Kompaun</th>
  145. <th>Status</th>
  146. <th>Tindakan</th>
  147. </tr>
  148. </tfoot>
  149. </table>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. @endsection
  159. @section('external_js')
  160. <script type="text/javascript">
  161. var ellipsis = "...";
  162. function TrimLength(text, maxLength)
  163. {
  164. text = $.trim(text);
  165. if (text.length > maxLength)
  166. {
  167. text = text.substring(0, maxLength - ellipsis.length)
  168. return text.substring(0, text.lastIndexOf(" ")) + ellipsis;
  169. }
  170. else
  171. return text;
  172. }
  173. $.ajaxSetup({
  174. headers: {
  175. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  176. }
  177. });
  178. var table = $('#compound').DataTable({
  179. "ordering": false,
  180. "serverSide": true,
  181. "processing": true,
  182. "ajax": "{{ url('api/compound') }}/{{ $user->roles_access }}|{{ $user->_id }}/null/null/list/03",
  183. "columns": [
  184. { "data": "kpd","name": "kpd"},
  185. { "data": "jenis","name": "jenis"},
  186. { "data": "tarikh","name": "tarikh"},
  187. { "data": "masa","name": "masa"},
  188. { "data": "seksyen", "name": "seksyen"},
  189. { "data": "jumlah", "name": "jumlah"},
  190. { "data": "status", "name": "status"},
  191. { "data": "tindakan","name": "tindakan"}
  192. ],
  193. "columnDefs": [
  194. {
  195. "render": function ( data, type, row ) {
  196. if(data.includes("Baru")){
  197. var split = data.split('/');
  198. return '<label class="label label-'+split[1]+'">'+split[0]+'</label>&nbsp;'+split[2];
  199. }else{
  200. return data;
  201. }
  202. },
  203. "targets": 0,
  204. },
  205. {
  206. "render": function ( data, type, row ) {
  207. return TrimLength(data, 40);
  208. },
  209. "targets": 4,
  210. },
  211. {
  212. "render": function ( data, type, row ) {
  213. var link = "{{ url('/officer/compound') }}"+"/"+data+"/index";
  214. return '<div class="btn-group btn-group-sm" style="float: none;"><a href="'+link+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Kompaun"><span style="color:white">SELANJUTNYA</span></a></div>';
  215. },
  216. "targets": 7,
  217. },
  218. ],
  219. "language": {
  220. "paginate": {
  221. "previous": "Sebelum",
  222. "next": "Selepas"
  223. },
  224. "sLengthMenu": "Tunjukkan _MENU_ entri",
  225. "zeroRecords": "Tiada Data Ditemui",
  226. "infoEmpty": "Tiada Rekod Yang Wujud",
  227. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  228. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  229. "sSearch": "Cari:",
  230. }
  231. });
  232. $(document).ready(function() {
  233. $('#faulty').hide();
  234. var origin = window.location.origin;
  235. $(".theme-loader").animate({
  236. opacity: "0"
  237. },1000);
  238. setTimeout(function() {
  239. $(".theme-loader").remove();
  240. }, 800);
  241. /*** Tooltip ***/
  242. $('#compound').on('draw.dt', function () {
  243. $('[data-toggle="tooltip"]').tooltip();
  244. });
  245. $('#acts').append('<option value="null">Pilih Kategori Akta/UUK</option>');
  246. $.ajax({
  247. type: "GET",
  248. url: "{{ url('api/officer') }}"+"/{{ $user->_id }}/deed-law/list",
  249. success: function(result){
  250. $.each(result.data, function(i, d) {
  251. $('#acts').append('<option value="' + d.tindakan + '">' + d.nama + '</option>');
  252. $('#acts').show();
  253. $('#acts').prop('required',true);
  254. });
  255. }
  256. });
  257. var jb = 'null';
  258. $('#jbkod').change(function(){
  259. jb = $(this).val();
  260. });
  261. $('#acts').change(function(){
  262. if( $(this).val()==""){
  263. $('#faulty').hide();
  264. $('#faulty').prop('required',false);
  265. $('#faulty').empty();
  266. $('#faulty').append('<option value="null">Pilih Kategori Kesalahan</option>');
  267. }
  268. else {
  269. $('#faulty').empty();
  270. $('#faulty').append('<option value="null">Pilih Kategori Kesalahan</option>');
  271. $.ajax({
  272. type: "GET",
  273. url: "{{ url('api/faulty') }}/"+jb+"/"+$(this).val()+"/list",
  274. success: function(result){
  275. $.each(result.data, function(i, d) {
  276. var full_sentences = '[' + d.sketr + '] '+ d.nama;
  277. $('#faulty').append('<option value="' + d._id + '">' + TrimLength(full_sentences, 50) +'</option>');
  278. $('#faulty').show();
  279. $('#faulty').prop('required',true);
  280. });
  281. }
  282. });
  283. }
  284. });
  285. $("#tapis").click(function(){
  286. var act = $('#acts').val();
  287. var fa = $('#faulty').val();
  288. var link = origin+"/api/compound/{{ $user->roles_access }}|{{ $user->_id }}/"+act+"/"+fa+"/list/03";
  289. console.log(link);
  290. table.ajax.url(link).load();
  291. });
  292. });
  293. </script>
  294. @endsection