Dashboard sipadu mbip
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

compound_index.blade.php 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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. console.log("kpd checked = " + $('#check_kpd').prop("checked"));
  297. if($('#check_kpd').prop("checked") == false){
  298. $('#kpd').val('');
  299. }
  300. if($('#check_date').prop("checked") == false){
  301. $('#start_date').val('');
  302. $('#end_date').val('');
  303. }
  304. if($('#checkPlateNo').prop("checked") == false){
  305. $('#plate_no').val('');
  306. }
  307. if($('#checkCompanyNo').prop("checked") == false){
  308. $('#company_no').val('');
  309. }
  310. if($('#checkNric').prop("checked") == false){
  311. $('#nric').val('');
  312. }
  313. if($('#checkLicense').prop("checked") == false){
  314. $('#license').val('');
  315. }
  316. if($('#checkName').prop("checked") == false){
  317. $('#nameP').val('');
  318. }
  319. if($('#checkCompanyName').prop("checked") == false){
  320. $('#company_name').val('');
  321. }
  322. // Sumbit Search
  323. var form_data = $('#filter_form').serialize();
  324. if($('#type_C').val() == 'Parkir'){
  325. queryString1 = '?'+form_data;
  326. $('#viewPelbagai').hide();
  327. $('#viewParkir').show();
  328. $('#viewNotis').hide();
  329. tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();
  330. }
  331. else if($('#type_C').val() == "Pelbagai_JPB"){
  332. queryString2 = '?'+form_data;
  333. $('#viewPelbagai').show();
  334. $('#viewParkir').hide();
  335. $('#viewNotis').hide();
  336. tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  337. }
  338. else if($('#type_C').val() == "Pelbagai_KT"){
  339. queryString2 = '?'+form_data;
  340. $('#viewPelbagai').show();
  341. $('#viewParkir').hide();
  342. $('#viewNotis').hide();
  343. tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  344. }
  345. else if($('#type_C').val() == 'Notis_NPPM'){
  346. queryString2 = '?'+form_data;
  347. $('#viewPelbagai').hide();
  348. $('#viewParkir').hide();
  349. $('#viewNotis').show();
  350. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  351. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  352. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  353. }else if($('#type_C').val() == "Notis_NMH"){
  354. queryString2 = '?'+form_data;
  355. $('#viewPelbagai').hide();
  356. $('#viewParkir').hide();
  357. $('#viewNotis').show();
  358. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  359. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  360. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  361. }else if($('#type_C').val() == "Notis_NHN"){
  362. queryString2 = '?'+form_data;
  363. $('#viewPelbagai').show();
  364. $('#viewParkir').hide();
  365. $('#viewNotis').show();
  366. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  367. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  368. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  369. }else if($('#type_C').val() == "Notis_NKG"){
  370. queryString2 = '?'+form_data;
  371. $('#viewPelbagai').show();
  372. $('#viewParkir').hide();
  373. $('#viewNotis').show();
  374. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  375. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  376. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  377. }else if($('#type_C').val() == "Notis_PA"){
  378. queryString2 = '?'+form_data;
  379. $('#viewPelbagai').show();
  380. $('#viewParkir').hide();
  381. $('#viewNotis').show();
  382. tableP1.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  383. tableP3.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  384. tableP7.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  385. }
  386. console.log(SITEURL +'/api/list/compound'+ queryString1);
  387. console.log(SITEURL +'/api/list/compound'+ queryString2);
  388. }
  389. return false;
  390. });
  391. $('#submit').on('click', function (e) {
  392. e.preventDefault();
  393. var form = $("#updateSt")[0];
  394. if(form.checkValidity() === false) {
  395. e.stopPropagation();
  396. var isValid = form.reportValidity();
  397. }else {
  398. var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
  399. if (input == "yes") {
  400. var form_data = $('#updateSt').serialize();
  401. // alert(form_data);
  402. $.ajax({
  403. type: "POST",
  404. url: "{{ url('/api/update/compound/via-dashboard') }}",
  405. data: form_data,
  406. success:function(data){
  407. if(data['success'] == true){
  408. if($('#type_C').val() == 'Parkir'){
  409. $('#viewPelbagai').hide();
  410. $('#viewParkir').show();
  411. tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();
  412. $('#kemaskiniC').modal('hide');
  413. }else if($('#type_C').val() == "Pelbagai"){
  414. $('#viewPelbagai').show();
  415. $('#viewParkir').hide();
  416. tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
  417. $('#kemaskiniC').modal('hide');
  418. }
  419. }else if(data['success'] == false){
  420. alert(response.data.message);
  421. $('#kemaskiniC').modal('hide');
  422. }
  423. },
  424. error: function (xhr, ajaxOptions, thrownError) {
  425. console.log(thrownError);
  426. // swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  427. }
  428. });
  429. }else{
  430. alert('Kemaskini status dibatalkan');
  431. $('#kemaskiniC').modal('hide');
  432. }
  433. }
  434. });
  435. function getDetail(id) {
  436. $('#datePay').hide();
  437. $('#id').val(id);
  438. if($('#type_C').val() == 'Parkir'){
  439. $('#datePay').hide();
  440. $('#tarikh_bayar').prop('required', false);
  441. }else {
  442. $('#datePay').show();
  443. $('#tarikh_bayar').prop('required', true);
  444. }
  445. $('#kemaskiniC').modal({
  446. show: true
  447. })
  448. };
  449. </script>
  450. @endsection