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.

memo_detail.blade.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. @extends('layout.officer', ['uid' => $user->_id, 'token' => $user->token_firebase])
  2. @section('page_title', 'Kompaun (Kertas Siasatan)')
  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. .panel-body { padding:0px; }
  38. .panel-body table tr td { padding-left: 15px }
  39. .panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
  40. .panel-body .table, .panel-body div {margin-bottom: 0px; }
  41. .glyphicon { margin-right:10px; }
  42. .active { color: #d84315; }
  43. .active:hover { color: #d84315; }
  44. #custom table {
  45. table-layout:fixed !important;
  46. border-collapse: collapse !important;
  47. width: 100%;
  48. word-wrap:break-word !important;
  49. }
  50. #custom td, #custom th {
  51. border-top: 1px solid #dee2e6;
  52. border-bottom: 1px solid #dee2e6;
  53. }
  54. .longtext{
  55. word-wrap: break-word !important;
  56. word-break: break-word !important;
  57. padding: 0.6rem 2rem;
  58. }
  59. .btn i {
  60. margin-right: 0px;
  61. }
  62. </style>
  63. <div class="inner-page">
  64. <!-- Display message -->
  65. <div class="row">
  66. <div class="col-md-12">
  67. <div class="fluid">
  68. @if(count($errors) > 0)
  69. <div class="alert alert-danger icons-alert">
  70. @foreach($errors->all() as $error)
  71. <p>{{$error}}</p>
  72. @endforeach
  73. </div>
  74. @endif
  75. @if(Session::get('error_msg'))
  76. <div class="alert alert-danger icons-alert">
  77. {!! Session::get('error_msg') !!}
  78. </div>
  79. @elseif(Session::get('success_msg'))
  80. <div class="alert alert-success icons-alert">
  81. {!! Session::get('success_msg') !!}
  82. </div>
  83. @endif
  84. </div>
  85. </div>
  86. </div>
  87. <!-- End Display message -->
  88. <div class="row">
  89. <div class="col-xl-2 col-md-12">
  90. <div class="panel panel-default">
  91. <div class="panel-heading">
  92. <h4 class="panel-title"> Maklumat Terperinci </h4>
  93. </div>
  94. <div class="panel-body">
  95. @if($compound->status == 'Belum Bayar')
  96. <div><a href="{{ url('officer/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('officer/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
  97. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
  98. @if($compound->modul == '04')
  99. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('officer/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  100. @elseif($compound->modul == '05')
  101. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('officer/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
  102. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('officer/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  103. @elseif($compound->modul == '06')
  104. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('officer/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
  105. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('officer/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  106. @elseif($compound->modul == '07')
  107. <div><a href="{{ url('officer/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('officer/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
  108. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('officer/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  109. @endif
  110. <div><a target="_blank" href="{{ url('/officer/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
  111. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('officer/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
  112. @elseif($compound->status == 'Berbayar')
  113. <div><a href="{{ url('officer/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('officer/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
  114. <div><a href="{{ url('/officer/compound') }}/{{$compound->kpd}}">Kompaun</a></div>
  115. <div><a target="_blank" href="{{ url('/officer/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
  116. @endif
  117. </div>
  118. </div>
  119. </div>
  120. <div class="col-xl-10 col-md-12">
  121. <div class="row">
  122. <div class="col-md-12">
  123. <div class="card">
  124. <div class="card-header">
  125. @if(empty($role))
  126. <h5 class="card-header-text">
  127. Maklumat Memo / Nota [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>-</code>]
  128. </h5>
  129. @else
  130. <h5 class="card-header-text">
  131. Maklumat Memo / Nota [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
  132. </h5>
  133. @endif
  134. <span><code>Perhatian!!</code> Memo boleh ditambah mahupun dikemaskini sekiranya kompaun berada di bawah salah satu kategori modul</span>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="row">
  140. <div class="col-md-12">
  141. <div class="card">
  142. <div class="card-block">
  143. <div class="row">
  144. <div class="col-md-12">
  145. @if($file->modul != '03')
  146. <button id="nota-btn" type="button" class="btn btn-sm btn-outline-danger waves-effect f-right" data-toggle="tooltip" data-placement="top" title data-original-title="Tambah Nota/Memo">
  147. <i class="icofont icofont-edit"></i>
  148. </button>
  149. @endif
  150. </div>
  151. </div>
  152. <hr>
  153. <div id="view-nota" class="row">
  154. <div class="col-xl-12">
  155. <div class="data_table_main dt-responsive table-responsive">
  156. <table id="nota" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  157. <thead>
  158. <tr>
  159. <th>#</th>
  160. <th>Modul</th>
  161. <th>Jenis Memo</th>
  162. <th>No.Rujukan</th>
  163. <th>Tarikh Mula</th>
  164. <th>Tarikh Akhir</th>
  165. <th>DiKeluarkan</th>
  166. <th>Disahkan</th>
  167. <th>Tindakan</th>
  168. </tr>
  169. </thead>
  170. <tfoot>
  171. <tr>
  172. <th>#</th>
  173. <th>Modul</th>
  174. <th>Jenis Memo</th>
  175. <th>No.Rujukan</th>
  176. <th>Tarikh Mula</th>
  177. <th>Tarikh Akhir</th>
  178. <th>DiKeluarkan</th>
  179. <th>Disahkan</th>
  180. <th>Tindakan</th>
  181. </tr>
  182. </tfoot>
  183. </table>
  184. </div>
  185. </div>
  186. </div>
  187. <div id="edit-nota" class="row">
  188. <div class="col-lg-12 col-md-12">
  189. <form method="POST" action="{{ url('/officer/compound/memo/request/add') }}" enctype="multipart/form-data">
  190. <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
  191. <input type="hidden" name="kpd" value="{{ $compound->kpd }}">
  192. <div class="row">
  193. <div class="col-lg-12 col-md-12">
  194. <div class="form-group form-primary">
  195. <label class="float-label"><b>Jenis Memo/Nota <small style="color: red;">*</small></b></label>
  196. <select id="jenis_memo" name="jenis_memo" class="form-control" required>
  197. <option value="">Pilih Jenis Memo</option>
  198. <option value="Tambahan">Tambahan Harga</option>
  199. <option value="Lain-lain">Lain-lain</option>
  200. </select>
  201. <span class="form-bar"></span>
  202. </div>
  203. </div>
  204. </div>
  205. <div class="row">
  206. <div class="col-lg-6 col-md-12">
  207. <div class="form-group form-primary">
  208. <label class="float-label"><b>No.Rujukan <small style="color: red;">*</small></b></label>
  209. <input type="text" name="no_rujukan" class="form-control" value="{{ old('no_rujukan')}}" required="">
  210. <span class="form-bar"></span>
  211. </div>
  212. </div>
  213. <div class="col-lg-6 col-md-12">
  214. <div class="form-group form-primary">
  215. <label class="float-label"><b>Tawaran Kompaun Baru <small style="color: red;">Optional</small></b></label>
  216. <input type="text" name="tawaran" class="form-control" value="{{ old('tawaran')}}" placeholder="5%">
  217. <span class="form-bar"></span>
  218. <small style="color: red;">Format tawaran kompaun mesti dalam bentuk <b>peratus (%)</b></small>
  219. </div>
  220. </div>
  221. </div>
  222. <div class="row">
  223. <div class="col-lg-12 col-md-12">
  224. <div class="form-group form-primary">
  225. <label class="float-label"><b>Subjek <small style="color: red;">*</small></b></label>
  226. <input type="text" name="subjek" class="form-control" value="{{ old('subjek')}}" required="">
  227. <span class="form-bar"></span>
  228. </div>
  229. </div>
  230. <div class="col-lg-12 col-md-12">
  231. <div class="form-group form-primary">
  232. <label class="float-label"><b>Penerangan <small style="color: red;">*</small></b></label>
  233. <textarea type="text" name="penerangan" id="penerangan" style="width: 100%; height: 200px" required=""> {{ old('penerangan')}}</textarea>
  234. <span class="form-bar"></span>
  235. </div>
  236. </div>
  237. </div>
  238. <!-- Drag Drop -->
  239. <div class="row" style="margin-bottom: 1.25em;">
  240. <div class="col-lg-12">
  241. <div class="dropzone" id="uploadF">
  242. <label class="float-label"><b>Tekan untuk memuat PDF. <small style="color: red;">Optional</small></b></label>
  243. <div class="fallback">
  244. <input name="attachment[]" id="attachment" type="file" class="form-control form-control-sm" multiple />
  245. </div>
  246. </div>
  247. <small style="color: red;">Format <b>PDF</b> sahaja yang diterima dan tidak lebih daripada 4</small>
  248. </div>
  249. </div>
  250. <div class="row">
  251. <div class="col-lg-6 col-md-12">
  252. <div class="form-group form-primary">
  253. <label class="float-label"><b>Tarikh Mula <small style="color: red;">*</small></b></label>
  254. <input type="datetime-local" name="tarikh_mula" value="{{ old('tarikh_mula')}}" class="form-control">
  255. <span class="form-bar"></span>
  256. </div>
  257. </div>
  258. <div class="col-lg-6 col-md-12">
  259. <div class="form-group form-primary">
  260. <label class="float-label"><b>Tarikh Akhir <small style="color: red;">*</small></b></label>
  261. <input type="date" name="tarikh_akhir" value="{{ old('tarikh_akhir')}}" class="form-control">
  262. <span class="form-bar"></span>
  263. </div>
  264. </div>
  265. </div>
  266. <hr>
  267. <div class="md-group-add-on"></div>
  268. <div class="f-right m-t-20">
  269. <button type="submit" class="btn btn-sm btn-outline-danger waves-effect">Simpan Rekod Memo</button>
  270. <a href="javascript:;" id="nota-cancel" class="btn btn-sm btn-out-dashed waves-effect waves-light btn-default btn-square">Batal</a>
  271. </div>
  272. </form>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. @endsection
  283. @section('external_js')
  284. <script type="text/javascript" src="{{ asset('js/toggle_button_edit.js') }}"></script>
  285. <script type="text/javascript">
  286. var table = $('#nota').DataTable({
  287. "ordering": false,
  288. "serverSide": true,
  289. "processing": true,
  290. "ajax": "{{ url('api/compound') }}/{{$file->no_siri}}/memo/list",
  291. "columns": [
  292. { "data": "index","name": "index"},
  293. { "data": "modul","name": "modul"},
  294. { "data": "jenis","name": "jenis"},
  295. { "data": "no_rujukan", "name": "no_rujukan" },
  296. { "data": "mula", "name": "mula"},
  297. { "data": "akhir", "name": "akhir"},
  298. { "data": "dikeluakan", "name": "dikeluakan"},
  299. { "data": "disahkan", "name": "disahkan"},
  300. { "data": "tindakan","name": "tindakan"}
  301. ],
  302. "columnDefs": [
  303. {
  304. "render": function ( data, type, row ) {
  305. if (data.indexOf("Baru/") >= 0) {
  306. var split = data.split('/');
  307. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  308. }else {
  309. return data;
  310. }
  311. },
  312. "targets": 0,
  313. },
  314. {
  315. "render": function ( data, type, row ) {
  316. var kpd = '{{ $compound->kpd }}';
  317. var editLink = "{{ url('/officer/compound') }}"+"/"+kpd+"/memo/"+data+"/edit";
  318. var pdfLink = "{{ url('/officer/setting/memo') }}"+"/"+data+"/view/detail";
  319. var staff = "{{ $user->_id}}";
  320. if(row.modul == '-'){
  321. return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Memo"><span class="icofont icofont-eye-alt" style="color:white"></span></a></div>';
  322. }else {
  323. return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Memo"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a href="'+editLink+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Memo"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+kpd+'\',\''+data+'\',\'' + row.no_rujukan + '\',\'' + staff + '\')" data-toggle="tooltip" data-placement="top" title="Buang Memo" 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>';
  324. }
  325. },
  326. "targets": 8,
  327. },
  328. ],
  329. "language": {
  330. "paginate": {
  331. "previous": "Sebelum",
  332. "next": "Selepas"
  333. },
  334. "sLengthMenu": "Tunjukkan _MENU_ entri",
  335. "zeroRecords": "Tiada Data Ditemui",
  336. "infoEmpty": "Tiada Rekod Yang Wujud",
  337. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  338. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  339. "sSearch": "Cari:",
  340. }
  341. });
  342. function deleteA(kpd,cid,rujukan,staff) {
  343. var kpd = kpd;
  344. var cid = cid;
  345. var rujukan = rujukan;
  346. swal({
  347. title: "Adakah anda pasti?",
  348. text: "Anda tidak akan dapat memulihkan rekod memo ini ( " + rujukan + " )",
  349. html: true,
  350. type: "warning",
  351. showCancelButton: true,
  352. confirmButtonClass: "btn-danger",
  353. confirmButtonText: "Ya!",
  354. cancelButtonText: "Batal!",
  355. closeOnConfirm: false
  356. },
  357. function(isConfirm){
  358. if (!isConfirm) return;
  359. $.ajax({
  360. type: "POST",
  361. url: "{{ url('api/compound/delete/memo') }}",
  362. data: { "_token": "{{ csrf_token() }}", id: cid, kpd: kpd, staff:staff },
  363. success:function(data){
  364. if(data['status'] == "true"){
  365. swal({
  366. title: "Berjaya",
  367. text: data['desc'],
  368. type: "success",
  369. showCancelButton: false,
  370. confirmButtonText: "OK!",
  371. closeOnConfirm: true
  372. },
  373. function(){
  374. table.ajax.url("{{ url('api/compound') }}/{{$file->no_siri}}/memo/list").load();
  375. });
  376. }else if(data['status'] == "false"){
  377. swal({
  378. title: "Tidak Berjaya",
  379. text: data['desc'],
  380. type: "error",
  381. showCancelButton: false,
  382. confirmButtonText: "OK!",
  383. closeOnConfirm: true
  384. },
  385. function(){
  386. table.ajax.url("{{ url('api/compound') }}/{{$file->no_siri}}/memo/list").load();
  387. });
  388. }
  389. },
  390. error: function (xhr, ajaxOptions, thrownError) {
  391. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  392. }
  393. });
  394. });
  395. };
  396. $.ajaxSetup({
  397. headers: {
  398. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  399. }
  400. });
  401. $(document).ready(function() {
  402. var origin = window.location.origin;
  403. $(".theme-loader").animate({
  404. opacity: "0"
  405. },1000);
  406. setTimeout(function() {
  407. $(".theme-loader").remove();
  408. }, 800);
  409. $('[data-toggle="tooltip"]').tooltip();
  410. /** Nota/Memo **/
  411. $('#edit-nota').hide();
  412. $('#nota-save').on('click', function() {
  413. var c = $('#nota-btn').find("i");
  414. c.removeClass('icofont-close');
  415. c.addClass('icofont-edit');
  416. $('#view-nota').show();
  417. $('#edit-nota').hide();
  418. });
  419. $('#nota-cancel').on('click', function() {
  420. var c = $('#nota-btn').find("i");
  421. c.removeClass('icofont-close');
  422. c.addClass('icofont-edit');
  423. $('#view-nota').show();
  424. $('#edit-nota').hide();
  425. });
  426. $('#nota-btn').on('click', function() {
  427. var b = $(this).find("i");
  428. var edit_class = b.attr('class');
  429. if (edit_class == 'icofont icofont-edit') {
  430. b.removeClass('icofont-edit');
  431. b.addClass('icofont-close');
  432. $('#view-nota').hide();
  433. $('#edit-nota').show();
  434. } else {
  435. b.removeClass('icofont-close');
  436. b.addClass('icofont-edit');
  437. $('#view-nota').show();
  438. $('#edit-nota').hide();
  439. }
  440. });
  441. });
  442. </script>
  443. @endsection