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.

backlog.blade.php 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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>Jabatan <code>*</code></b></label>
  39. <select name="jabatan" id="jabatan" class="form-control" required>
  40. <option value="null">Pilih jabatan</option>
  41. @foreach($department as $d)
  42. <option value="{{ $d->_id }}">{{ $d->jbkod }}</option>
  43. @endforeach
  44. </select>
  45. </div>
  46. <div class="form-group">
  47. <button id="jana" class="btn btn-info btn-block waves-effect waves-light">Jana Report</button>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="col-sm-10">
  53. <div class="card">
  54. <div class="card-header">
  55. <h5>Laporan Tunggakan Tahunan</h5>
  56. <div id="link" style="float:right"></div>
  57. </div>
  58. <div class="card-block">
  59. <!-- <div id='bal'>balance pada tahun </div> -->
  60. <div class="dt-responsive table-responsive">
  61. <table id="reportTt" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  62. <thead>
  63. <tr>
  64. <th>BULAN</th>
  65. <th id='bal' style="width:17%">BAKI </th>
  66. <th>KUTIPAN BULANAN (RM)</th>
  67. <th>JUMLAH KOMPAUN BAYAR</th>
  68. <th>KUTIPAN TERKUMPUL (RM)</th>
  69. <th>BAKI TUNGGAKAN (RM)</th>
  70. <th>BAKI BELUM BAYAR</th>
  71. <th>JUMLAH KURANG (RM)</th>
  72. <th>% KUTIPAN</th>
  73. <th>% TERKUMPUL</th>
  74. </tr>
  75. </thead>
  76. <tfoot>
  77. <tr>
  78. <th></th>
  79. <th>JUMLAH</th>
  80. <th></th>
  81. <th></th>
  82. <th></th>
  83. <th></th>
  84. <th></th>
  85. <th></th>
  86. <th></th>
  87. <th></th>
  88. </tr>
  89. </tfoot>
  90. </table>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. @endsection
  99. @section('external_js')
  100. <script type="text/javascript">
  101. // var current_id = "{{ $user->_id }}";
  102. $.ajaxSetup({
  103. headers: {
  104. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  105. }
  106. });
  107. var table, test;
  108. $(document).ready(function() {
  109. table = $('#reportTt').DataTable({
  110. "ordering": false,
  111. "searching": false,
  112. "lengthChange": false,
  113. "pageLength": -1,
  114. "paging": false,
  115. "processing": true,
  116. "serverSide": true,
  117. "ajax": {
  118. "url": "{{ url('api/get/backlog-compound') }}",
  119. "data": {
  120. "year": function() { return $('#tahun').val() },
  121. "jabatan": function() { return $('#jabatan').val() },
  122. "current_id": '',
  123. }
  124. },
  125. "columns": [
  126. { "data": "bulan", "name": "bulan" }, //1
  127. { "data": "space", "name": "space" }, //2
  128. { "data": "kutipan_bulanan", "name": "kutipan_bulanan" }, //3
  129. { "data": "jumlah_kompaun_bayar", "name": "jumlah_kompaun_bayar" }, //4
  130. { "data": "kutipan_terkumpul", "name": "kutipan_terkumpul" }, //5
  131. { "data": "baki_tunggakan", "name": "baki_tunggakan" }, //6
  132. { "data": "baki_belum_bayar", "name": "baki_belum_bayar" }, //7
  133. { "data": "jumlah_kurang", "name": "jumlah_kurang" }, //8
  134. { "data": "_kutipan", "name": "_kutipan" }, //9
  135. { "data": "_terkumpul", "name": "_terkumpul" }, //10
  136. ],
  137. "rowCallback": function( row, data ) {
  138. var keping, jumlah;
  139. jumlah = parseInt(table.cell(0,2).data()) + parseInt(table.cell(0,5).data());
  140. keping = parseInt(table.cell(0,3).data()) + parseInt(table.cell(0,6).data());
  141. $('#bal').html("BAKI PADA 1.1." + $('#tahun').val() + " \n " + jumlah + " \n " + keping);
  142. },
  143. "footerCallback": function(row, data, start, end, display) {
  144. var api = this.api();
  145. var kutipan_bulanan,jum_kompaun_bayar,jum_kurang;
  146. test = 8;
  147. kutipan_bulanan = api.column( 2 ).data().reduce( function (a, b) {
  148. return parseFloat(a) + parseFloat(b);
  149. }, 0 );
  150. $( api.column( 2 ).footer() ).html(kutipan_bulanan);
  151. jum_kompaun_bayar = api.column( 3 ).data().reduce( function (a, b) {
  152. return parseFloat(a) + parseFloat(b);
  153. }, 0 );
  154. $( api.column( 3 ).footer() ).html(jum_kompaun_bayar);
  155. jum_kurang = api.column( 7 ).data().reduce( function (a, b) {
  156. return parseFloat(a) + parseFloat(b);
  157. }, 0 );
  158. $( api.column( 7 ).footer() ).html(jum_kurang);
  159. },
  160. "drawCallback": function(settings) {
  161. var api = this.api();
  162. // Output the data for the visible rows to the browser's console
  163. var data = api.rows( {page:'current'} ).data().toArray();
  164. if (data && data.length > 0) {
  165. var link = "{{ url('main/export/report/backlog') }}/"+$('#tahun').val()+"/"+$('#jabatan').val();
  166. $('#link').html('<a target="_blank" href="'+link+'" class="btn btn-primary btn-sm waves-effect waves-light">Excel</a>');
  167. }
  168. },
  169. });
  170. $('#jana').on('click', function(e){
  171. e.preventDefault();
  172. // console.log(" data " + $('#tahun').val()+ " dan " + $('#jabatan').val());
  173. $('#bal').html('BAKI');
  174. if($('#tahun').val() == 'null' || $('#jabatan').val() == 'null'){
  175. alert('Sila pilih tahun dan jabatan');
  176. }else {
  177. table.ajax.reload();
  178. }
  179. });
  180. });
  181. </script>
  182. @endsection