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.

enforcer.blade.php 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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. .glyphicon { margin-right:10px; }
  13. th { font-weight: 600; text-align: center}
  14. table.dataTable.nowrap th, table.dataTable.nowrap td {
  15. white-space: pre-line !important;
  16. }
  17. table.nowrap th, table.nowrap td {
  18. white-space: pre-line !important;
  19. }
  20. </style>
  21. <div class="inner-page">
  22. <div class="row">
  23. <div class="col-md-2">
  24. <div class="card">
  25. <div class="card-block">
  26. {{-- <div class="form-group" style="margin-top: 1.25em">
  27. <label><b>Tahun <code>*</code></b></label>
  28. <select name="tahun" id="tahun" class="form-control" required>
  29. <option value="null">Pilih tahun</option>
  30. <option value="2016">2016</option>
  31. <option value="2017">2017</option>
  32. <option value="2018">2018</option>
  33. <option value="2019">2019</option>
  34. <option value="2020">2020</option>
  35. </select>
  36. </div> --}}
  37. <div class="form-group" style="margin-top: 1.25em">
  38. <label><b>Tahun <code>*</code></b></label>
  39. <input type="month" name="tahun" id="tahun" class="form-control" required>
  40. </div>
  41. <div class="form-group" style="margin-top: 1.25em">
  42. <label><b>Jabatan <code>*</code></b></label>
  43. <select name="jabatan" id="jabatan" class="form-control" required>
  44. <option value="null">Pilih jabatan</option>
  45. @foreach($department as $d)
  46. <option value="{{ $d->_id }}">{{ $d->jbkod }}</option>
  47. @endforeach
  48. </select>
  49. </div>
  50. <div class="form-group">
  51. <button id="jana" class="btn btn-info btn-block waves-effect waves-light">Jana Report</button>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="col-sm-10">
  57. <div class="card">
  58. <div class="card-header">
  59. <h5>Statistik Pengeluaran Kompaun</h5>
  60. <div id="link" style="float:right"></div>
  61. </div>
  62. <div class="card-block">
  63. <div class="row m-b-30">
  64. <div class="col-lg-12 col-xl-12">
  65. <!-- Nav tabs -->
  66. <ul class="nav nav-tabs md-tabs" role="tablist">
  67. <li class="nav-item">
  68. <a class="nav-link active" data-toggle="tab" href="#keping" role="tab">Keping</a>
  69. <div class="slide"></div>
  70. </li>
  71. <li class="nav-item">
  72. <a class="nav-link" data-toggle="tab" href="#jumlah" role="tab">Jumlah</a>
  73. <div class="slide"></div>
  74. </li>
  75. </ul>
  76. <!-- Tab panes -->
  77. <div class="tab-content card-block">
  78. <div class="tab-pane active" id="keping" role="tabpanel">
  79. <div class="dt-responsive table-responsive">
  80. <table id="reportK" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  81. <thead>
  82. <tr>
  83. <th rowspan="2">BIL</th>
  84. <th rowspan="2">NAMA ANGGOTA</th>
  85. <th colspan="12">Bulan</th>
  86. <th rowspan="2">JUM</th>
  87. </tr>
  88. <tr>
  89. <th>JAN</th>
  90. <th>FEB</th>
  91. <th>MAC</th>
  92. <th>APRIL</th>
  93. <th>MEI</th>
  94. <th>JUN</th>
  95. <th>JULAI</th>
  96. <th>OGOS</th>
  97. <th>SEPT</th>
  98. <th>OKT</th>
  99. <th>NOV</th>
  100. <th>DIS</th>
  101. </tr>
  102. </thead>
  103. <tfoot>
  104. <tr>
  105. <th></th>
  106. <th>JUMLAH BESAR</th>
  107. <th>FEB</th>
  108. <th>MAC</th>
  109. <th>APRIL</th>
  110. <th>MEI</th>
  111. <th>JUN</th>
  112. <th>JULAI</th>
  113. <th>OGOS</th>
  114. <th>SEPT</th>
  115. <th>OKT</th>
  116. <th>NOV</th>
  117. <th>DIS</th>
  118. <th>DIS</th>
  119. <th>JUM</th>
  120. </tr>
  121. </tfoot>
  122. </table>
  123. </div>
  124. </div>
  125. <div class="tab-pane" id="jumlah" role="tabpanel">
  126. <div class="dt-responsive table-responsive">
  127. <table id="reportJ" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  128. <thead>
  129. <tr>
  130. <th rowspan="2">BIL</th>
  131. <th rowspan="2">NAMA ANGGOTA</th>
  132. <th colspan="12">Bulan</th>
  133. <th rowspan="2">JUM</th>
  134. </tr>
  135. <tr>
  136. <th>JAN</th>
  137. <th>FEB</th>
  138. <th>MAC</th>
  139. <th>APRIL</th>
  140. <th>MEI</th>
  141. <th>JUN</th>
  142. <th>JULAI</th>
  143. <th>OGOS</th>
  144. <th>SEPT</th>
  145. <th>OKT</th>
  146. <th>NOV</th>
  147. <th>DIS</th>
  148. </tr>
  149. </thead>
  150. <tfoot>
  151. <tr>
  152. <th></th>
  153. <th>JUMLAH BESAR</th>
  154. <th>FEB</th>
  155. <th>MAC</th>
  156. <th>APRIL</th>
  157. <th>MEI</th>
  158. <th>JUN</th>
  159. <th>JULAI</th>
  160. <th>OGOS</th>
  161. <th>SEPT</th>
  162. <th>OKT</th>
  163. <th>NOV</th>
  164. <th>DIS</th>
  165. <th>DIS</th>
  166. <th>JUM</th>
  167. </tr>
  168. </tfoot>
  169. </table>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. @endsection
  181. @section('external_js')
  182. <script type="text/javascript">
  183. var current_id = "{{ $user->_id }}";
  184. $.ajaxSetup({
  185. headers: {
  186. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  187. }
  188. });
  189. var table;
  190. $(document).ready(function() {
  191. table1 = $('#reportK').DataTable({
  192. "ordering": false,
  193. "searching": false,
  194. "lengthChange": false,
  195. "pageLength": -1,
  196. "paging": false,
  197. "processing": true,
  198. "serverSide": true,
  199. "ajax": {
  200. "url": "{{ url('api/get/statistic-compound/enforcer') }}",
  201. "data": {
  202. "year": function() { return $('#tahun').val() },
  203. "jabatan": function() { return $('#jabatan').val() },
  204. "jenis": "keping",
  205. "current_id": current_id,
  206. }
  207. },
  208. "columns": [
  209. { "data": "index", "name": "index" },
  210. { "data" : "name", "name": "name" },
  211. { "data": "jan", "jan": "kpd" },
  212. { "data": "feb", "name": "feb" },
  213. { "data": "mac", "name": "mac" },
  214. { "data": "apr", "name": "apr" },
  215. { "data": "mei", "name": "mei" },
  216. { "data": "jun", "name": "jun" },
  217. { "data": "july", "name": "july" },
  218. { "data": "ogos", "name": "ogos" },
  219. { "data": "sept", "name": "sept" },
  220. { "data": "okt", "name": "okt" },
  221. { "data": "nov", "name": "nov" },
  222. { "data": "dis", "name": "dis" },
  223. { "data": "total", "name": "total" },
  224. ],
  225. "columnDefs": [
  226. {
  227. "render": function ( data, type, row, meta ) {
  228. return (meta.row+1);
  229. },
  230. "targets": 0,
  231. },
  232. ],
  233. "footerCallback": function(row, data, start, end, display) {
  234. var api = this.api();
  235. var jan,feb,mar,apr,mei,jun,jul,ogos,sept,okt,nov,dis,jum;
  236. jan = api.column( 2 ).data().reduce( function (a, b) {
  237. return parseFloat(a) + parseFloat(b);
  238. }, 0 );
  239. $( api.column( 2 ).footer() ).html(jan);
  240. feb = api.column( 3 ).data().reduce( function (a, b) {
  241. return parseFloat(a) + parseFloat(b);
  242. }, 0 );
  243. $( api.column( 3 ).footer() ).html(feb);
  244. mar = api.column( 4 ).data().reduce( function (a, b) {
  245. return parseFloat(a) + parseFloat(b);
  246. }, 0 );
  247. $( api.column( 4 ).footer() ).html(mar);
  248. apr = api.column( 5 ).data().reduce( function (a, b) {
  249. return parseFloat(a) + parseFloat(b);
  250. }, 0 );
  251. $( api.column( 5 ).footer() ).html(apr);
  252. mei = api.column( 6 ).data().reduce( function (a, b) {
  253. return parseFloat(a) + parseFloat(b);
  254. }, 0 );
  255. $( api.column( 6 ).footer() ).html(mei);
  256. jun = api.column( 7 ).data().reduce( function (a, b) {
  257. return parseFloat(a) + parseFloat(b);
  258. }, 0 );
  259. $( api.column( 7 ).footer() ).html(jun);
  260. jul = api.column( 8 ).data().reduce( function (a, b) {
  261. return parseFloat(a) + parseFloat(b);
  262. }, 0 );
  263. $( api.column( 8 ).footer() ).html(jul);
  264. ogos = api.column( 9 ).data().reduce( function (a, b) {
  265. return parseFloat(a) + parseFloat(b);
  266. }, 0 );
  267. $( api.column( 9 ).footer() ).html(ogos);
  268. sept = api.column( 10 ).data().reduce( function (a, b) {
  269. return parseFloat(a) + parseFloat(b);
  270. }, 0 );
  271. $( api.column( 10 ).footer() ).html(sept);
  272. okt = api.column( 11 ).data().reduce( function (a, b) {
  273. return parseFloat(a) + parseFloat(b);
  274. }, 0 );
  275. $( api.column( 11 ).footer() ).html(okt);
  276. nov = api.column( 12 ).data().reduce( function (a, b) {
  277. return parseFloat(a) + parseFloat(b);
  278. }, 0 );
  279. $( api.column( 12 ).footer() ).html(nov);
  280. dis = api.column( 13 ).data().reduce( function (a, b) {
  281. return parseFloat(a) + parseFloat(b);
  282. }, 0 );
  283. $( api.column( 13 ).footer() ).html(dis);
  284. jum = api.column( 14 ).data().reduce( function (a, b) {
  285. return parseFloat(a) + parseFloat(b);
  286. }, 0 );
  287. $( api.column( 14 ).footer() ).html(jum);
  288. },
  289. "drawCallback": function(settings) {
  290. var api = this.api();
  291. // Output the data for the visible rows to the browser's console
  292. var data = api.rows( {page:'current'} ).data().toArray();
  293. if (data && data.length > 0) {
  294. var link = "{{ url('main/export/report/enforcer') }}/"+$('#tahun').val()+"/"+$('#jenis').val()+"/"+$('#jabatan').val();
  295. $('#link').html('<a target="_blank" href="'+link+'" class="btn btn-primary btn-sm waves-effect waves-light">Excel</a>');
  296. }
  297. },
  298. });
  299. table2 = $('#reportJ').DataTable({
  300. "ordering": false,
  301. "searching": false,
  302. "lengthChange": false,
  303. "pageLength": -1,
  304. "paging": false,
  305. "processing": true,
  306. "serverSide": true,
  307. "ajax": {
  308. "url": "{{ url('api/get/statistic-compound/enforcer') }}",
  309. "data": {
  310. "date": function() { return $('#tahun').val() },
  311. "jabatan": function() { return $('#jabatan').val() },
  312. "jenis": "jumlah",
  313. "current_id": current_id,
  314. }
  315. },
  316. "columns": [
  317. { "data": "index", "name": "index" },
  318. { "data" : "name", "name": "name" },
  319. { "data": "jan", "jan": "kpd" },
  320. { "data": "feb", "name": "feb" },
  321. { "data": "mac", "name": "mac" },
  322. { "data": "apr", "name": "apr" },
  323. { "data": "mei", "name": "mei" },
  324. { "data": "jun", "name": "jun" },
  325. { "data": "july", "name": "july" },
  326. { "data": "ogos", "name": "ogos" },
  327. { "data": "sept", "name": "sept" },
  328. { "data": "okt", "name": "okt" },
  329. { "data": "nov", "name": "nov" },
  330. { "data": "dis", "name": "dis" },
  331. { "data": "total", "name": "total" },
  332. ],
  333. "columnDefs": [
  334. {
  335. "render": function ( data, type, row, meta ) {
  336. return (meta.row+1);
  337. },
  338. "targets": 0,
  339. },
  340. ],
  341. "footerCallback": function(row, data, start, end, display) {
  342. var api = this.api();
  343. var jan,feb,mar,apr,mei,jun,jul,ogos,sept,okt,nov,dis,jum;
  344. jan = api.column( 2 ).data().reduce( function (a, b) {
  345. return parseFloat(a) + parseFloat(b);
  346. }, 0 );
  347. $( api.column( 2 ).footer() ).html(jan);
  348. feb = api.column( 3 ).data().reduce( function (a, b) {
  349. return parseFloat(a) + parseFloat(b);
  350. }, 0 );
  351. $( api.column( 3 ).footer() ).html(feb);
  352. mar = api.column( 4 ).data().reduce( function (a, b) {
  353. return parseFloat(a) + parseFloat(b);
  354. }, 0 );
  355. $( api.column( 4 ).footer() ).html(mar);
  356. apr = api.column( 5 ).data().reduce( function (a, b) {
  357. return parseFloat(a) + parseFloat(b);
  358. }, 0 );
  359. $( api.column( 5 ).footer() ).html(apr);
  360. mei = api.column( 6 ).data().reduce( function (a, b) {
  361. return parseFloat(a) + parseFloat(b);
  362. }, 0 );
  363. $( api.column( 6 ).footer() ).html(mei);
  364. jun = api.column( 7 ).data().reduce( function (a, b) {
  365. return parseFloat(a) + parseFloat(b);
  366. }, 0 );
  367. $( api.column( 7 ).footer() ).html(jun);
  368. jul = api.column( 8 ).data().reduce( function (a, b) {
  369. return parseFloat(a) + parseFloat(b);
  370. }, 0 );
  371. $( api.column( 8 ).footer() ).html(jul);
  372. ogos = api.column( 9 ).data().reduce( function (a, b) {
  373. return parseFloat(a) + parseFloat(b);
  374. }, 0 );
  375. $( api.column( 9 ).footer() ).html(ogos);
  376. sept = api.column( 10 ).data().reduce( function (a, b) {
  377. return parseFloat(a) + parseFloat(b);
  378. }, 0 );
  379. $( api.column( 10 ).footer() ).html(sept);
  380. okt = api.column( 11 ).data().reduce( function (a, b) {
  381. return parseFloat(a) + parseFloat(b);
  382. }, 0 );
  383. $( api.column( 11 ).footer() ).html(okt);
  384. nov = api.column( 12 ).data().reduce( function (a, b) {
  385. return parseFloat(a) + parseFloat(b);
  386. }, 0 );
  387. $( api.column( 12 ).footer() ).html(nov);
  388. dis = api.column( 13 ).data().reduce( function (a, b) {
  389. return parseFloat(a) + parseFloat(b);
  390. }, 0 );
  391. $( api.column( 13 ).footer() ).html(dis);
  392. jum = api.column( 14 ).data().reduce( function (a, b) {
  393. return parseFloat(a) + parseFloat(b);
  394. }, 0 );
  395. $( api.column( 14 ).footer() ).html(jum);
  396. },
  397. });
  398. $('#jana').on('click', function(e){
  399. e.preventDefault();
  400. if($('#tahun').val() == 'null' || $('#jabatan').val() == 'null'){
  401. alert('Sila pilih tahun dan jabatan');
  402. }else {
  403. console.log("tahun " + $('#tahun').val());
  404. table1.ajax.reload();
  405. table2.ajax.reload();
  406. }
  407. });
  408. });
  409. </script>
  410. @endsection