chart-search.blade.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="row justify-content-center">
  2. <!-- Grafik -->
  3. <div class="col">
  4. <div class="card shadow">
  5. <div class="card-header bg-transparent">
  6. <div class="row align-items-center">
  7. <div class="col">
  8. <?php
  9. $upts = \App\Model\Setting\UPT::where('office_id',$changeUPT)->select('office_name')->distinct()->value('office_name');
  10. ?>
  11. <h6 class="text-uppercase text-light ls-1 mb-1"><i class="ni ni-chart-pie-35"></i>&nbsp;&nbsp;Grafik Jumlah Per KPKNL {{$upts}}</h6>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="card-body">
  16. <div class="chart">
  17. <div id="loket-pengaduan-search" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
  18. </div>
  19. </div>
  20. <br>
  21. <?php
  22. $count = \App\Model\Service\LoketPengaduan::where('tujuan',1)->where('kode_upt',$changeUPT)->count();
  23. $open = \App\Model\Service\LoketPengaduan::where('active',1)->where('tujuan',1)->where('kode_upt',$changeUPT)->count();
  24. $reopen = \App\Model\Service\LoketPengaduan::where('active',3)->where('tujuan',1)->where('kode_upt',$changeUPT)->count();
  25. $closed = \App\Model\Service\LoketPengaduan::where('active',0)->where('tujuan',1)->where('kode_upt',$changeUPT)->count();
  26. if ($count == 0) {
  27. $fixOpen = 0;
  28. $fixClosed = 0;
  29. }else{
  30. $fixOpen = ( $reopen + $open ) / $count * 100;
  31. $fixClosed = $closed / $count * 100;
  32. }
  33. ?>
  34. <div class="card-footer" style="padding:0px;">
  35. <table style="width: 100%; text-align: center;">
  36. <br>
  37. <center>
  38. <label style="font-size: 20px; font-weight: bold;">PERSENTASE PENGADUAN</label>
  39. </center>
  40. <br>
  41. <tr>
  42. <td style="font-size: 20px; font-weight: bold; border-right: 1px solid #dedede; padding: 10px 0px;">
  43. <label>OPEN : </label> {{number_format($fixOpen, 2)}} %</td>
  44. <td style="font-size: 20px; font-weight: bold;"><label>CLOSED : </label> {{number_format($fixClosed, 2)}} %</td>
  45. </tr>
  46. </table>
  47. </div>
  48. </div>
  49. </div>
  50. </div>