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_detail.blade.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. @extends('layout.master', ['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. .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. </style>
  60. <div class="inner-page">
  61. <div class="row">
  62. <div class="col-xl-2 col-md-12">
  63. <div class="panel panel-default">
  64. <div class="panel-heading">
  65. <h4 class="panel-title"> Maklumat Terperinci </h4>
  66. </div>
  67. <div class="panel-body">
  68. @if($compound->status == 'Belum Bayar')
  69. <div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
  70. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="active">Kompaun</a></div>
  71. @if($compound->modul == '04')
  72. <!-- <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/investigation" class="{{ Request::is('main/compound/*/investigation') ? 'active' : '' }}">Pengesahan Kompaun</a></div> -->
  73. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  74. @elseif($compound->modul == '05')
  75. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/notice" class="{{ Request::is('main/compound/*/notice') ? 'active' : '' }}">Notis Amaran</a></div>
  76. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  77. @elseif($compound->modul == '06')
  78. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/inventory" class="{{ Request::is('main/compound/*/inventory') ? 'active' : '' }}">Inventori</a></div>
  79. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  80. @elseif($compound->modul == '07')
  81. <div><a href="{{ url('main/compound') }}/{{$compound->kpd}}/inventory/auction" class="{{ Request::is('main/compound/*/inventory/auction') ? 'active' : '' }}">Jualan Lelong</a></div>
  82. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/memo" class="{{ Request::is('main/compound/*/memo') ? 'active' : '' }}">Memo/Nota</a></div>
  83. @endif
  84. <div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
  85. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}/task" class="{{ Request::is('main/compound/*/task') ? 'active' : '' }}">Serahan Modul/PenguatKuasa</a></div>
  86. @elseif($compound->status == 'Berbayar')
  87. <div><a href="{{ url('main/compound') }}/{{ $compound->kpd }}/index" class="{{ Request::is('main/compound/*/index') ? 'active' : '' }}">Garis Masa/Sejarah</a></div>
  88. <div><a href="{{ url('/main/compound') }}/{{$compound->kpd}}" class="{{ Request::is('main/compound/*') ? 'active' : '' }}">Kompaun</a></div>
  89. <div><a target="_blank" href="{{ url('/main/compound') }}/{{$compound->kpd}}/pdf">Cetak/Papar PDF</a></div>
  90. @endif
  91. </div>
  92. </div>
  93. </div>
  94. <div class="col-xl-10 col-md-12">
  95. <!-- Display message -->
  96. <div class="row">
  97. <div class="col-md-12">
  98. <div class="fluid">
  99. @if(count($errors) > 0)
  100. <div class="alert alert-danger icons-alert">
  101. @foreach($errors->all() as $error)
  102. <p>{{$error}}</p>
  103. @endforeach
  104. </div>
  105. @endif
  106. @if(Session::get('error_msg'))
  107. <div class="alert alert-danger icons-alert">
  108. {!! Session::get('error_msg') !!}
  109. </div>
  110. @elseif(Session::get('success_msg'))
  111. <div class="alert alert-success icons-alert">
  112. {!! Session::get('success_msg') !!}
  113. </div>
  114. @endif
  115. </div>
  116. </div>
  117. </div>
  118. <!-- Display message -->
  119. <div class="row">
  120. <div class="col-md-12">
  121. <div class="card">
  122. <div class="card-header">
  123. @if(empty($role))
  124. <h5 class="card-header-text">
  125. Maklumat Kertas Kompaun [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>-</code>]
  126. </h5>
  127. @else
  128. <h5 class="card-header-text">
  129. Maklumat Kertas Kompaun [ No.Kompaun : <code>{{ $compound->kpd }}</code> | No.Siri : <code>{{ $file->no_siri }}</code> | Modul: <code>{{ $role->name }}</code>]
  130. </h5>
  131. @endif
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="row">
  137. <div class="col-md-12">
  138. <div class="card">
  139. <div class="card-header">
  140. <h5>Maklumat Kompaun <code data-toggle="tooltip" data-placement="left" title data-original-title="Tarikh & Masa Kompaun Dikeluarkan">({{ date('d/m/Y h:i:s a', strtotime($compound->created_at)) }})</code></h5>
  141. <span><code>Perhatian!! Semua maklumat yang anda kemaskini disini akan direkodkan dalam kertas siasatan dan bukan pada kertas kompaun/pdf</code></span>
  142. </div>
  143. <div class="card-block">
  144. @if($compound->jenis == 'Pelbagai_KT')
  145. @include('main-dashboard.compound_detail.part.compound_KT')
  146. @elseif($compound->jenis == 'Pelbagai_JPB')
  147. @include('main-dashboard.compound_detail.part.compound_JPB')
  148. @elseif($compound->jenis == "Parkir")
  149. @include('main-dashboard.compound_detail.part.compound_parkir')
  150. @endif
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. @if($compound->modul == '04')
  156. <div class="row">
  157. <div class="col-md-12">
  158. <div class="card">
  159. <div class="card-header">
  160. <h5>Lampiran PDF (SSM/JPJ)</h5>
  161. <button id="lampiran-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 Lampiran">
  162. <i class="icofont icofont-edit"></i>
  163. </button>
  164. </div>
  165. <div class="card-block">
  166. <div id="view-lampiran" class="row">
  167. <div class="col-lg-12">
  168. <div class="data_table_main dt-responsive table-responsive">
  169. <table id="lampiran_ssm_jpj" class="table table-sm table-striped table-bordered nowrap" width="100%">
  170. <thead>
  171. <tr>
  172. <th>Tarikh</th>
  173. <th>Masa</th>
  174. <th>Subjek</th>
  175. <th>Kategori</th>
  176. <th>Tindakan</th>
  177. </tr>
  178. </thead>
  179. <tfoot>
  180. <tr>
  181. <th>Tarikh</th>
  182. <th>Masa</th>
  183. <th>Subjek</th>
  184. <th>Kategori</th>
  185. <th>Tindakan</th>
  186. </tr>
  187. </tfoot>
  188. </table>
  189. </div>
  190. </div>
  191. </div>
  192. <div id="edit-lampiran" class="row">
  193. <div class="col-lg-12 col-md-12">
  194. <form method="POST" action="{{ url('/main/compound/investigation/attachment/add') }}" enctype="multipart/form-data">
  195. <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
  196. <input type="hidden" name="kpd" value="{{ $compound->kpd }}">
  197. <input type="hidden" name="nosiri" value="{{ $file->no_siri }}">
  198. <div class="row">
  199. <div class="col-lg-6 col-md-12">
  200. <div class="form-group form-primary">
  201. <label class="float-label">Subjek</label>
  202. <input type="text" name="subjek" class="form-control" required="">
  203. <span class="form-bar"></span>
  204. </div>
  205. </div>
  206. <div class="col-lg-6 col-md-12">
  207. <div class="form-group form-primary">
  208. <label class="float-label">Kategori</label>
  209. <select id="kategori" name="kategori" class="form-control" required>
  210. <option value="">Pilih Kategori </option>
  211. <option value="SSM">SSM</option>
  212. <option value="JPJ">JPJ</option>
  213. </select>
  214. <span class="form-bar"></span>
  215. </div>
  216. </div>
  217. <div class="col-lg-12 col-md-12">
  218. <div class="form-group form-primary">
  219. <label class="float-label">Lampiran PDF</label>
  220. <input name="attachment" id="attachment" type="file" class="form-control form-control-sm" />
  221. <span class="form-bar"></span>
  222. <code>Format <b>PDF</b> sahaja yang diterima</code>
  223. </div>
  224. </div>
  225. </div>
  226. <hr>
  227. <div class="md-group-add-on"></div>
  228. <div class="f-right m-t-20">
  229. <button type="submit" class="btn btn-sm btn-outline-danger waves-effect">Simpan/Muat Naik</button>
  230. <a href="javascript:;" id="lampiran-cancel" class="btn btn-sm btn-out-dashed waves-effect waves-light btn-default btn-square">Batal</a>
  231. </div>
  232. </form>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. @endif
  240. </div>
  241. </div>
  242. </div>
  243. @endsection
  244. @section('external_js')
  245. @parent
  246. <script type="text/javascript">
  247. $.ajaxSetup({
  248. headers: {
  249. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  250. }
  251. });
  252. var table = $('#lampiran_ssm_jpj').DataTable({
  253. "ordering": false,
  254. "serverSide": true,
  255. "processing": true,
  256. "ajax": "{{ url('/api/investigation') }}/{{$file->no_siri}}/attachment/list",
  257. "columns": [
  258. { "data": "tarikh","name": "tarikh"},
  259. { "data": "masa","name": "masa"},
  260. { "data": "subjek","name": "subjek"},
  261. { "data": "kategori","name": "kategori"},
  262. { "data": "tindakan","name": "tindakan"}
  263. ],
  264. "columnDefs": [
  265. {
  266. "render": function ( data, type, row ) {
  267. if (data.indexOf("Baru/") >= 0) {
  268. var split = data.split('/');
  269. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  270. }else {
  271. return data;
  272. }
  273. },
  274. "targets": 0,
  275. },
  276. {
  277. "render": function ( data, type, row ) {
  278. var kpd = '{{ $compound->kpd }}';
  279. var siri = '{{ $file->no_siri }}';
  280. var staff = "{{ $user->_id }}";
  281. var editLink = "{{ url('/document') }}"+"/"+siri+"/investigation/"+data+".pdf";
  282. //<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 Lampiran"><span class="icofont icofont-ui-edit" style="color:white"></span></a>
  283. var pdfLink = "{{ url('/main/compound/investigation') }}"+"/"+data+"/detail/view";
  284. 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 Lampiran"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.subjek + '\',\'' + staff + '\',\'' + siri + '\')" data-toggle="tooltip" data-placement="top" title="Buang Lampiran" 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>';
  285. },
  286. "targets": 4,
  287. },
  288. ],
  289. "language": {
  290. "paginate": {
  291. "previous": "Sebelum",
  292. "next": "Selepas"
  293. },
  294. "sLengthMenu": "Tunjukkan _MENU_ entri",
  295. "zeroRecords": "Tiada Data Ditemui",
  296. "infoEmpty": "Tiada Rekod Yang Wujud",
  297. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  298. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  299. "sSearch": "Cari:",
  300. }
  301. });
  302. function deleteA(cid,subjek,staff,siri) {
  303. var cid = cid;
  304. var subjek = subjek;
  305. swal({
  306. title: "Adakah anda pasti?",
  307. text: "Anda tidak akan dapat memulihkan rekod lampiran ini ( " + subjek + " )",
  308. html: true,
  309. type: "warning",
  310. showCancelButton: true,
  311. confirmButtonClass: "btn-danger",
  312. confirmButtonText: "Ya!",
  313. cancelButtonText: "Batal!",
  314. closeOnConfirm: false
  315. },
  316. function(isConfirm){
  317. if (!isConfirm) return;
  318. $.ajax({
  319. type: "POST",
  320. url: "{{ url('api/investigation/attachment/delete') }}",
  321. data: { "_token": "{{ csrf_token() }}", id: cid, staff: staff, no_siri: siri},
  322. success:function(data){
  323. if(data['status'] == "true"){
  324. swal({
  325. title: "Berjaya",
  326. text: data['desc'],
  327. type: "success",
  328. showCancelButton: false,
  329. confirmButtonText: "OK!",
  330. closeOnConfirm: true
  331. },
  332. function(){
  333. table.ajax.url("{{ url('/api/investigation') }}/{{$file->no_siri}}/attachment/list").load();
  334. });
  335. }else if(data['status'] == "false"){
  336. swal({
  337. title: "Tidak Berjaya",
  338. text: data['desc'],
  339. type: "error",
  340. showCancelButton: false,
  341. confirmButtonText: "OK!",
  342. closeOnConfirm: true
  343. },
  344. function(){
  345. table.ajax.url("{{ url('/api/investigation') }}/{{$file->no_siri}}/attachment/list").load();
  346. });
  347. }
  348. },
  349. error: function (xhr, ajaxOptions, thrownError) {
  350. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  351. }
  352. });
  353. });
  354. };
  355. $(document).ready(function() {
  356. var origin = window.location.origin;
  357. $(".theme-loader").animate({
  358. opacity: "0"
  359. },1000);
  360. setTimeout(function() {
  361. $(".theme-loader").remove();
  362. }, 800);
  363. $('[data-toggle="tooltip"]').tooltip();
  364. /** Lampiran **/
  365. $('#edit-lampiran').hide();
  366. $('#lampiran-cancel').on('click', function() {
  367. var c = $('#lampiran-btn').find("i");
  368. c.removeClass('icofont-close');
  369. c.addClass('icofont-edit');
  370. $('#view-lampiran').show();
  371. $('#edit-lampiran').hide();
  372. });
  373. $('#lampiran-save').on('click', function() {
  374. var c = $('#lampiran-btn').find("i");
  375. c.removeClass('icofont-close');
  376. c.addClass('icofont-edit');
  377. $('#view-lampiran').show();
  378. $('#edit-lampiran').hide();
  379. });
  380. $('#lampiran-btn').on('click', function() {
  381. var b = $(this).find("i");
  382. var edit_class = b.attr('class');
  383. if (edit_class == 'icofont icofont-edit') {
  384. b.removeClass('icofont-edit');
  385. b.addClass('icofont-close');
  386. $('#view-lampiran').hide();
  387. $('#edit-lampiran').show();
  388. } else {
  389. b.removeClass('icofont-close');
  390. b.addClass('icofont-edit');
  391. $('#view-lampiran').show();
  392. $('#edit-lampiran').hide();
  393. }
  394. });
  395. });
  396. </script>
  397. <script type="text/javascript">
  398. var compoundLatlog = '{{ $compound->latlong }}';
  399. if(compoundLatlog != '') {
  400. var split = compoundLatlog.split(',');
  401. var centerLat = parseFloat(split[0]);
  402. var centerLong = parseFloat(split[1]);
  403. // Standard google maps function
  404. function initialize() {
  405. var map;
  406. var bounds = new google.maps.LatLngBounds();
  407. var myLatlng = new google.maps.LatLng(centerLat, centerLong);
  408. var myOptions = {
  409. zoom: 18,
  410. center: myLatlng,
  411. mapTypeId: google.maps.MapTypeId.ROADMAP
  412. }
  413. map = new google.maps.Map(document.getElementById("map"), myOptions);
  414. displayMarker(bounds, map);
  415. }
  416. // Testing the addMarker function
  417. function displayMarker(bounds, map) {
  418. // Markers
  419. var markers = [
  420. ['Kompaun Dikeluarkan', centerLat, centerLong, 1]
  421. ];
  422. // Info Windows
  423. var infoWindowContent = [
  424. ['<div class="info_content">' + '<small>Kompaun Dikeluarkan </small>' + '</div>']
  425. ];
  426. var infoWindow = new google.maps.InfoWindow(), marker, i;
  427. //<!-- Loop through our array of markers & place each one on the map -->
  428. for( i = 0; i < markers.length; i++ ) {
  429. // Display multiple markers on a map -->
  430. var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
  431. bounds.extend(position);
  432. marker = new google.maps.Marker({
  433. position: position,
  434. map: map,
  435. title: markers[i][0]
  436. });
  437. //<!-- Allow each marker to have an info window -->
  438. google.maps.event.addListener(marker, 'click', (function(marker, i) {
  439. return function() {
  440. infoWindow.setContent(infoWindowContent[i][0]);
  441. infoWindow.open(map, marker);
  442. }
  443. })(marker, i));
  444. //<!-- Automatically center the map fitting all markers on the screen -->
  445. map.fitBounds(bounds);
  446. }
  447. //<!-- Override our map zoom level once our fitBounds function runs (Make sure it only runs once) -->
  448. var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {
  449. this.setZoom(18);
  450. google.maps.event.removeListener(boundsListener);
  451. });
  452. }
  453. }
  454. </script>
  455. @endsection