Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

completed_index.blade.php 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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') }}">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') }}" class="active">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. <option selected value="null">Sila Pilih Akta</option>
  102. </select>
  103. </div>
  104. <div class="form-group" style="padding-right: 10px;">
  105. <select name="select" class="form-control form-control-sm" id="faulty">
  106. <option selected value="null">Sila Pilih Kesalahan</option>
  107. </select>
  108. </div>
  109. <div class="form-group">
  110. <button type="button" id="tapis" class="btn btn-primary btn-sm waves-effect waves-light" style="padding: 6px 14px !important;">Tapis</button>
  111. </div>
  112. </form>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="row">
  118. <div class="col-md-12">
  119. <div class="card">
  120. <div class="card-header">
  121. <h5>Senarai Kompaun Dijelaskan</h5>
  122. </div>
  123. <div class="card-block contact-details">
  124. <div class="data_table_main dt-responsive table-responsive">
  125. <table id="compounds" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  126. <thead>
  127. <tr>
  128. <th>Kpd</th>
  129. <th>Jenis</th>
  130. <th>Tarikh</th>
  131. <th>Masa</th>
  132. <th>Kesalahan</th>
  133. <th width="110">Kadar Kompaun</th>
  134. <th width="110">Jumlah Bayaran</th>
  135. <th>Receipt</th>
  136. <th>Status</th>
  137. <th>Tindakan</th>
  138. </tr>
  139. </thead>
  140. <tfoot>
  141. <tr>
  142. <th>Kpd</th>
  143. <th>Jenis</th>
  144. <th>Tarikh</th>
  145. <th>Masa</th>
  146. <th>Kesalahan</th>
  147. <th width="110">Kadar Kompaun</th>
  148. <th width="110">Jumlah Bayaran</th>
  149. <th>Receipt</th>
  150. <th>Status</th>
  151. <th>Tindakan</th>
  152. </tr>
  153. </tfoot>
  154. </table>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. @endsection
  164. @section('external_js')
  165. <script type="text/javascript">
  166. var ellipsis = "...";
  167. function TrimLength(text, maxLength)
  168. {
  169. text = $.trim(text);
  170. if (text.length > maxLength)
  171. {
  172. text = text.substring(0, maxLength - ellipsis.length)
  173. return text.substring(0, text.lastIndexOf(" ")) + ellipsis;
  174. }
  175. else
  176. return text;
  177. }
  178. $.ajaxSetup({
  179. headers: {
  180. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  181. }
  182. });
  183. var table = $('#compounds').DataTable({
  184. "ordering": false,
  185. "serverSide": true,
  186. "processing": true,
  187. "ajax": "{{ url('api/compound/completed') }}/{{ $user->roles_access }}|{{ $user->_id }}/null/null/list",
  188. "columns": [
  189. { "data": "kpd","name": "kpd"},
  190. { "data": "jenis","name": "jenis"},
  191. { "data": "tarikh","name": "tarikh"},
  192. { "data": "masa","name": "masa"},
  193. { "data": "seksyen", "name": "seksyen"},
  194. { "data": "jumlah", "name": "jumlah"},
  195. { "data": "bayaran", "name": "bayaran"},
  196. { "data": "receipt", "name": "receipt"},
  197. { "data": "status", "name": "status"},
  198. { "data": "tindakan","name": "tindakan"}
  199. ],
  200. "columnDefs": [
  201. {
  202. "render": function ( data, type, row ) {
  203. if (data.indexOf("Baru/") >= 0) {
  204. var split = data.split('/');
  205. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  206. }else {
  207. return data;
  208. }
  209. },
  210. "targets": 0,
  211. },
  212. {
  213. "render": function ( data, type, row ) {
  214. return TrimLength(data, 40);
  215. },
  216. "targets": 4,
  217. },
  218. {
  219. "render": function ( data, type, row ) {
  220. var link = "{{ url('/officer/compound') }}"+"/"+data+"/index";
  221. 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>';
  222. },
  223. "targets": 9,
  224. },
  225. ],
  226. "language": {
  227. "paginate": {
  228. "previous": "Sebelum",
  229. "next": "Selepas"
  230. },
  231. "sLengthMenu": "Tunjukkan _MENU_ entri",
  232. "zeroRecords": "Tiada Data Ditemui",
  233. "infoEmpty": "Tiada Rekod Yang Wujud",
  234. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  235. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  236. "sSearch": "Cari:",
  237. }
  238. });
  239. $(document).ready(function() {
  240. $('#faulty').hide();
  241. var origin = window.location.origin;
  242. $(".theme-loader").animate({
  243. opacity: "0"
  244. },1000);
  245. setTimeout(function() {
  246. $(".theme-loader").remove();
  247. }, 800);
  248. /*** Tooltip ***/
  249. $('#compound').on('draw.dt', function () {
  250. $('[data-toggle="tooltip"]').tooltip();
  251. });
  252. $('#acts').append('<option value="null">Pilih Kategori Akta/UUK</option>');
  253. $.ajax({
  254. type: "GET",
  255. url: "{{ url('api/officer') }}"+"/{{ $user->_id }}/deed-law/list",
  256. success: function(result){
  257. $.each(result.data, function(i, d) {
  258. $('#acts').append('<option value="' + d.tindakan + '">' + d.nama + '</option>');
  259. $('#acts').show();
  260. $('#acts').prop('required',true);
  261. });
  262. }
  263. });
  264. var jb = 'null';
  265. $('#jbkod').change(function(){
  266. jb = $(this).val();
  267. });
  268. $('#acts').change(function(){
  269. if( $(this).val()==""){
  270. $('#faulty').hide();
  271. $('#faulty').prop('required',false);
  272. $('#faulty').empty();
  273. $('#faulty').append('<option value="null">Pilih Kategori Kesalahan</option>');
  274. }
  275. else {
  276. $('#faulty').empty();
  277. $('#faulty').append('<option value="null">Pilih Kategori Kesalahan</option>');
  278. $.ajax({
  279. type: "GET",
  280. url: "{{ url('api/faulty') }}/"+jb+"/"+$(this).val()+"/list",
  281. success: function(result){
  282. $.each(result.data, function(i, d) {
  283. var full_sentences = '[' + d.sketr + '] '+ d.nama;
  284. $('#faulty').append('<option value="' + d._id + '">' + TrimLength(full_sentences, 50) +'</option>');
  285. $('#faulty').show();
  286. $('#faulty').prop('required',true);
  287. });
  288. }
  289. });
  290. }
  291. });
  292. $("#tapis").click(function(){
  293. var act = $('#acts').val();
  294. var fa = $('#faulty').val();
  295. var link = origin+"/api/compound/completed/{{ $user->roles_access }}|{{ $user->_id }}/"+act+"/"+fa+"/list";
  296. console.log(link);
  297. table.ajax.url(link).load();
  298. });
  299. });
  300. </script>
  301. @endsection