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 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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. .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: #fff !important; }
  41. .panel-body .table, .panel-body div {margin-bottom: 0px; }
  42. .r-padd { padding-right: 5%; }
  43. .active { color: #333333; }
  44. .active:hover { color: #333333; }
  45. th { font-weight: 600; }
  46. table.dataTable.nowrap th, table.dataTable.nowrap td {
  47. white-space: pre-line !important;
  48. }
  49. table.nowrap th, table.nowrap td {
  50. white-space: pre-line !important;
  51. }
  52. /*.dataTables_length {
  53. float:right !important;
  54. }*/
  55. </style>
  56. <div class="inner-page">
  57. <div class="row">
  58. @include('main-dashboard.compound._part.menu_category')
  59. @include('main-dashboard.compound._part.filter_form')
  60. </div>
  61. <div class="row">
  62. <div class="col-md-12">
  63. <div class="card">
  64. <div class="card-header">
  65. <div class="row">
  66. <div class="col-md-8">
  67. <h5>Senarai Semua Kompaun</h5>
  68. </div>
  69. <div class="col-md-4">
  70. <div id="link" style="float:right"></div>
  71. <div id="link1" style="float:right"></div>
  72. <div id="link2" style="float:right"></div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="card-body">
  77. <div id="viewParkir">
  78. @include('main-dashboard.compound._part.compound_parkir')
  79. </div>
  80. <div id="viewPelbagai">
  81. @include('main-dashboard.compound._part.compound_pelbagai')
  82. </div>
  83. <div id="viewNotis">
  84. <div class="col-lg-12 col-xl-12">
  85. <!-- Nav tabs -->
  86. <ul class="nav nav-tabs md-tabs" role="tablist">
  87. <li class="nav-item">
  88. <a class="nav-link active" data-toggle="tab" href="#default" role="tab">Tarikh Mula</a>
  89. <div class="slide"></div>
  90. </li>
  91. <li class="nav-item">
  92. <a class="nav-link" data-toggle="tab" href="#hari3" role="tab">3 Hari Sebelum</a>
  93. <div class="slide"></div>
  94. </li>
  95. <li class="nav-item">
  96. <a class="nav-link" data-toggle="tab" href="#hari7" role="tab">7 Hari Sebelum</a>
  97. <div class="slide"></div>
  98. </li>
  99. </ul>
  100. <!-- Tab panes -->
  101. <div class="tab-content card-block">
  102. <div class="tab-pane active" id="default" role="tabpanel">
  103. <div class="dt-responsive table-responsive">
  104. <table id="reportD" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  105. <thead>
  106. <tr>
  107. <th>#</th>
  108. <th>Modul</th>
  109. <th>No Kpn</th>
  110. <th>Jenis</th>
  111. <th>Tarikh Masa</th>
  112. <th>Kesalahan</th>
  113. <th>Nric</th>
  114. <th>Nama</th>
  115. <th>PenguatKuasa</th>
  116. <th>Tindakan</th>
  117. </tr>
  118. </thead>
  119. <tfoot>
  120. <tr>
  121. <th>#</th>
  122. <th>Modul</th>
  123. <th>No Kpn</th>
  124. <th>Jenis</th>
  125. <th>Tarikh Masa</th>
  126. <th>Kesalahan</th>
  127. <th>Nric</th>
  128. <th>Nama</th>
  129. <th>PenguatKuasa</th>
  130. <th>Tindakan</th>
  131. </tr>
  132. </tfoot>
  133. </table>
  134. </div>
  135. </div>
  136. <div class="tab-pane" id="hari3" role="tabpanel">
  137. <div class="dt-responsive table-responsive">
  138. <table id="report3" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  139. <thead>
  140. <tr>
  141. <th>#</th>
  142. <th>Modul</th>
  143. <th>No Kpn</th>
  144. <th>Jenis</th>
  145. <th>Tarikh Masa</th>
  146. <th>Kesalahan</th>
  147. <th>Nric</th>
  148. <th>Nama</th>
  149. <th>PenguatKuasa</th>
  150. <th>Tindakan</th>
  151. </tr>
  152. </thead>
  153. <tfoot>
  154. <tr>
  155. <th>#</th>
  156. <th>Modul</th>
  157. <th>No Kpn</th>
  158. <th>Jenis</th>
  159. <th>Tarikh Masa</th>
  160. <th>Kesalahan</th>
  161. <th>Nric</th>
  162. <th>Nama</th>
  163. <th>PenguatKuasa</th>
  164. <th>Tindakan</th>
  165. </tr>
  166. </tfoot>
  167. </table>
  168. </div>
  169. </div>
  170. <div class="tab-pane" id="hari7" role="tabpanel">
  171. <div class="dt-responsive table-responsive">
  172. <table id="report7" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  173. <thead>
  174. <tr>
  175. <th>#</th>
  176. <th>Modul</th>
  177. <th>No Kpn</th>
  178. <th>Jenis</th>
  179. <th>Tarikh Masa</th>
  180. <th>Kesalahan</th>
  181. <th>Nric</th>
  182. <th>Nama</th>
  183. <th>PenguatKuasa</th>
  184. <th>Tindakan</th>
  185. </tr>
  186. </thead>
  187. <tfoot>
  188. <tr>
  189. <th>#</th>
  190. <th>Modul</th>
  191. <th>No Kpn</th>
  192. <th>Jenis</th>
  193. <th>Tarikh Masa</th>
  194. <th>Kesalahan</th>
  195. <th>Nric</th>
  196. <th>Nama</th>
  197. <th>PenguatKuasa</th>
  198. <th>Tindakan</th>
  199. </tr>
  200. </tfoot>
  201. </table>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="modal fade" id="kemaskiniC" tabindex="-1" role="dialog">
  212. <div class="modal-dialog" role="document">
  213. <div class="modal-content">
  214. <form class="form-horizontal" id="updateSt">
  215. <div class="modal-header">
  216. <h5 class="modal-title">Kemaskini Status Kompaun</h5>
  217. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  218. <span aria-hidden="true">&times;</span>
  219. </button>
  220. </div>
  221. <div class="modal-body">
  222. <input type="hidden" name="id" id="id" value="" required/>
  223. <input type="hidden" name="typeK" id="typeK" value="" required/>
  224. <input type="hidden" name="current_id" id="current_id" value="{{ $user->_id }}" required/>
  225. <div class="form-group">
  226. <label class="col-sm-6 control-label"><b>Status</b></label>
  227. <div class="col-sm-12">
  228. <select class="form-control" name="status" required>
  229. <option value="Belum Bayar">Belum Bayar</option>
  230. <option value="Berbayar">Berbayar</option>
  231. <option value="Batal">Batal</option>
  232. <option value="Buang">Batal (Sistem)</option>
  233. </select>
  234. </div>
  235. </div>
  236. <div class="form-group">
  237. <label class="col-sm-6 control-label"><b>Catatan <code>*</code></b></label>
  238. <div class="col-sm-12">
  239. <textarea class="form-control" name="remark"></textarea>
  240. </div>
  241. </div>
  242. <div class="form-group">
  243. <label class="col-sm-6 control-label"><b>Jumlah Dibayar <code>*</code></b></label>
  244. <div class="col-sm-12">
  245. <input type="text" class="form-control autonumber" name="amount" data-v-min="0.00" data-v-max="99999.00"placeholder="0.00" required/>
  246. </div>
  247. </div>
  248. <div class="form-group">
  249. <label class="col-sm-6 control-label"><b>Amaun Tunggakan</b> <code>*</code></label>
  250. <div class="col-sm-12">
  251. <input type="text" class="form-control autonumber" name="tunggakan" data-v-min="0.00" data-v-max="99999.00" placeholder="0.00" required/>
  252. <code>Sekiranya tiada amaun tunggakan, sila letak 0. Amaun tunggakan ini akan diguna untuk laporan</code>
  253. </div>
  254. </div>
  255. <div class="form-group" id="datePay">
  256. <label class="col-sm-6 control-label"><b>Tarikh Bayar</b> <code>*</code></label>
  257. <div class="col-sm-12">
  258. <input type="datetime-local" class="form-control" name="tarikh_bayar" id="tarikh_bayar"/>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="modal-footer">
  263. <button type="button" class="btn btn-sm btn-secondary mobtn" data-dismiss="modal">Close</button>
  264. <button id="submit" class="btn btn-sm btn-primary waves-effect waves-light">KEMASKINI</button>
  265. </div>
  266. </form>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. @endsection
  272. @section('external_js')
  273. <script type="text/javascript">
  274. var SITEURL = '{{URL::to('')}}';
  275. var tableP, tableP2, tableP1, tableP3, tableP7;
  276. var queryString1 = '', queryString2 = '', token = "{{ csrf_token() }}";
  277. $('#viewParkir').hide(); $('#link').hide();
  278. $('#viewPelbagai').hide(); $('#link1').hide();
  279. $('#viewNotis').hide(); $('#link2').hide();
  280. </script>
  281. <script type="text/javascript" src="{{ asset('js/dataParkir.js') }}"></script>
  282. <script type="text/javascript" src="{{ asset('js/dataPelbagai.js') }}"></script>
  283. <script type="text/javascript" src="{{ asset('js/dataNotis.js') }}"></script>
  284. <script type="text/javascript" src="{{ asset('js/function_checkbox.js') }}"></script>
  285. <script type="text/javascript">
  286. $('#tapis').on('click', function (e) {
  287. e.preventDefault();
  288. $('#link').hide(); $('#link1').hide();
  289. var form = $("#filter_form")[0];
  290. if(form.checkValidity() === false) {
  291. e.stopPropagation();
  292. var isValid = form.reportValidity();
  293. }else {
  294. $('#viewPelbagai').hide();
  295. $('#viewParkir').hide();
  296. $('#viewNotis').hide();
  297. console.log("kpd checked = " + $('#check_kpd').prop("checked"));
  298. if($('#check_kpd').prop("checked") == false){
  299. $('#kpd').val('');
  300. }
  301. if($('#check_date').prop("checked") == false){
  302. $('#start_date').val('');
  303. $('#end_date').val('');
  304. }
  305. if($('#checkPlateNo').prop("checked") == false){
  306. $('#plate_no').val('');
  307. }
  308. if($('#checkCompanyNo').prop("checked") == false){
  309. $('#company_no').val('');
  310. }
  311. if($('#checkNric').prop("checked") == false){
  312. $('#nric').val('');
  313. }
  314. if($('#checkLicense').prop("checked") == false){
  315. $('#license').val('');
  316. }
  317. if($('#checkName').prop("checked") == false){
  318. $('#nameP').val('');
  319. }
  320. if($('#checkCompanyName').prop("checked") == false){
  321. $('#company_name').val('');
  322. }
  323. // Sumbit Search
  324. var form_data = $('#filter_form').serialize();
  325. if($('#type_C').val() == 'Parkir'){
  326. queryString1 = '?'+form_data;
  327. $('#viewPelbagai').hide();
  328. $('#viewParkir').show();
  329. $('#viewNotis').hide();
  330. tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();
  331. }
  332. else if($('#type_C').val() == "Pelbagai_JPB"){
  333. queryString2 = '?'+form_data;
  334. $('#viewPelbagai').show();
  335. $('#viewParkir').hide();
  336. $('#viewNotis').hide();
  337. tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  338. }
  339. else if($('#type_C').val() == "Pelbagai_KT"){
  340. queryString2 = '?'+form_data;
  341. $('#viewPelbagai').show();
  342. $('#viewParkir').hide();
  343. $('#viewNotis').hide();
  344. tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  345. }
  346. else if($('#type_C').val() == 'Notis_NPPM'){
  347. queryString2 = '?'+form_data;
  348. $('#viewPelbagai').hide();
  349. $('#viewParkir').hide();
  350. $('#viewNotis').show();
  351. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  352. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  353. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  354. }else if($('#type_C').val() == "Notis_NMH"){
  355. queryString2 = '?'+form_data;
  356. $('#viewPelbagai').hide();
  357. $('#viewParkir').hide();
  358. $('#viewNotis').show();
  359. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  360. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  361. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  362. }else if($('#type_C').val() == "Notis_NHN"){
  363. queryString2 = '?'+form_data;
  364. $('#viewPelbagai').hide();
  365. $('#viewParkir').hide();
  366. $('#viewNotis').show();
  367. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  368. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  369. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  370. }else if($('#type_C').val() == "Notis_NKG"){
  371. queryString2 = '?'+form_data;
  372. $('#viewPelbagai').hide();
  373. $('#viewParkir').hide();
  374. $('#viewNotis').show();
  375. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  376. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  377. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  378. }else if($('#type_C').val() == "Notis_PA"){
  379. queryString2 = '?'+form_data;
  380. $('#viewPelbagai').hide();
  381. $('#viewParkir').hide();
  382. $('#viewNotis').show();
  383. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  384. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  385. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  386. }
  387. console.log(SITEURL +'/api/list/compound'+ queryString1);
  388. console.log(SITEURL +'/api/list/compound'+ queryString2);
  389. }
  390. return false;
  391. });
  392. $('#submit').on('click', function (e) {
  393. e.preventDefault();
  394. var form = $("#updateSt")[0];
  395. if(form.checkValidity() === false) {
  396. e.stopPropagation();
  397. var isValid = form.reportValidity();
  398. }else {
  399. var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
  400. if (input == "yes") {
  401. var form_data = $('#updateSt').serialize();
  402. // alert(form_data);
  403. $.ajax({
  404. type: "POST",
  405. url: "{{ url('/api/update/compound/via-dashboard') }}",
  406. data: form_data,
  407. success:function(data){
  408. if(data['success'] == true){
  409. if($('#type_C').val() == 'Parkir'){
  410. $('#viewPelbagai').hide();
  411. $('#viewParkir').show();
  412. tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();
  413. $('#kemaskiniC').modal('hide');
  414. }else if($('#type_C').val() == "Pelbagai"){
  415. $('#viewPelbagai').show();
  416. $('#viewParkir').hide();
  417. tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  418. $('#kemaskiniC').modal('hide');
  419. }
  420. }else if(data['success'] == false){
  421. alert(response.data.message);
  422. $('#kemaskiniC').modal('hide');
  423. }
  424. },
  425. error: function (xhr, ajaxOptions, thrownError) {
  426. console.log(thrownError);
  427. // swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  428. }
  429. });
  430. }else{
  431. alert('Kemaskini status dibatalkan');
  432. $('#kemaskiniC').modal('hide');
  433. }
  434. }
  435. });
  436. function getDetail(id) {
  437. $('#datePay').hide();
  438. $('#id').val(id);
  439. if($('#type_C').val() == 'Parkir'){
  440. $('#datePay').hide();
  441. $('#tarikh_bayar').prop('required', false);
  442. }else {
  443. $('#datePay').show();
  444. $('#tarikh_bayar').prop('required', true);
  445. }
  446. $('#kemaskiniC').modal({
  447. show: true
  448. })
  449. };
  450. </script>
  451. @endsection