| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <script src="http://code.highcharts.com/highcharts.js"></script>
- <script src="http://code.highcharts.com/maps/modules/map.js"></script>
- <script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
- <script src="http://code.highcharts.com/mapdata/countries/us/us-all.js"></script>
- <script>
- Highcharts.chart('inspeksi-kegiatan', {
- chart: {
- type: 'bar'
- },
- title:false,
- <?php
- $upt = \App\Model\Setting\UPT::select('office_name','office_id')->distinct()->get();
- ?>
- xAxis: {
- categories: [
- @foreach($upt as $key => $value)
- '{{$value->office_name}}',
- @endforeach
- ],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Capaian Kegiatan Inspeksi',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: 'Kegiatan'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor:
- Highcharts.defaultOptions.legend.backgroundColor || '#000',
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [
- {
- name: 'Total Kegiatan Inspeksi',
- data: [
- @foreach($upt as $key => $value)
- {{\App\Model\Inspeksi\Inspeksi::where('kode_upt',$value->office_id)->count()}},
- @endforeach
- ]
- },
- ]
- });
- </script>
- <script>
- Highcharts.chart('inspeksi-capaian-total', {
- chart: {
- type: 'bar'
- },
- title:false,
- xAxis: {
- categories: [
- 'Jumlah Kegiatan',
- 'Capaian Hasil Inspeksi',
- ],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Capaian Total',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: '%'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor:
- Highcharts.defaultOptions.legend.backgroundColor || '#000',
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [
- {
- name: 'Berdasarkan Capaian Hasil',
- data: [
- <?php
- $jumlahdata = \App\Model\Inspeksi\Inspeksi::count();
- ?>
- {{$jumlahdata}},
- {{number_format($capaian, 2)}},
- ]
- },
- ]
- });
- </script>
- <script>
- Highcharts.chart('inspeksi-hasil', {
- chart: {
- type: 'bar'
- },
- title:false,
- <?php
- $upt = \App\Model\Setting\UPT::select('office_name','office_id')->distinct()->get();
- ?>
- xAxis: {
- categories: [
- @foreach($upt as $key => $value)
- '{{$value->office_name}}',
- @endforeach
- ],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Capaian Hasil Inspeksi',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: '%'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor:
- Highcharts.defaultOptions.legend.backgroundColor || '#000',
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [
- {
- name: 'Berdasarkan Capaian Hasil',
- data: [
- @foreach($upt as $key => $value)
- <?php
- $date = \App\Model\Inspeksi\Inspeksi::select('tanggal_lapor')->where('kode_upt',$value->office_id)->orderBy('tanggal_lapor','desc')->first();
- $time=strtotime($date->tanggal_lapor);
- $month=date("m",$time);
- $year=date("Y",$time);
- $hi_sesuai_isr = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',$value->office_id)->sum('hi_sesuai_isr');
- $tl_sesuai_isr = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',$value->office_id)->sum('tl_sesuai_isr');
- $data_sampling = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',$value->office_id)->sum('data_sampling');
- if($data_sampling == 0){
- $capaian = 0;
- }else{
- $capaian = ( $hi_sesuai_isr + $tl_sesuai_isr ) / ($data_sampling) * 100;
- }
- if ($capaian >= 100) {
- $capaian = 100;
- }
- ?>
- {{number_format($capaian, 2)}},
- @endforeach
- ]
- },
- ]
- });
- </script>
- <?php
- $getUptName = \App\Model\Setting\UPT::where('office_id',Auth::user()->upt)->select('office_name')->distinct()->value('office_name');
- $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
- ?>
- @if($getStatus != 'administator')
- <script>
- Highcharts.chart('inspeksi-kegiatan-operator', {
- chart: {
- type: 'bar'
- },
- title:false,
- xAxis: {
- categories: [
- '{{$getUptName}}',
- ],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Capaian Kegiatan Inspeksi',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: 'Kegiatan'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor:
- Highcharts.defaultOptions.legend.backgroundColor || '#000',
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [
- {
- name: 'Total Kegiatan Inspeksi',
- data: [
- {{\App\Model\Inspeksi\Inspeksi::where('kode_upt',Auth::user()->upt)->count()}},
- ]
- },
- ]
- });
- </script>
- <script>
- Highcharts.chart('inspeksi-hasil-operator', {
- chart: {
- type: 'bar'
- },
- title:false,
- xAxis: {
- categories: [
- '{{$getUptName}}',
- ],
- title: {
- text: null
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: 'Capaian Hasil Inspeksi',
- align: 'high'
- },
- labels: {
- overflow: 'justify'
- }
- },
- tooltip: {
- valueSuffix: '%'
- },
- plotOptions: {
- bar: {
- dataLabels: {
- enabled: true
- }
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -40,
- y: 80,
- floating: true,
- borderWidth: 1,
- backgroundColor:
- Highcharts.defaultOptions.legend.backgroundColor || '#000',
- shadow: true
- },
- credits: {
- enabled: false
- },
- series: [
- {
- name: 'Berdasarkan Capaian Hasil',
- data: [
- <?php
- $date = \App\Model\Inspeksi\Inspeksi::select('tanggal_lapor')->where('kode_upt',Auth::user()->upt)->orderBy('tanggal_lapor','desc')->first();
- if($date != null && $date != ""){
- $time=strtotime($date->tanggal_lapor);
- $month=date("m",$time);
- $year=date("Y",$time);
- $hi_sesuai_isr = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',Auth::user()->upt)->sum('hi_sesuai_isr');
- $tl_sesuai_isr = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',Auth::user()->upt)->sum('tl_sesuai_isr');
- $data_sampling = \App\Model\Inspeksi\Inspeksi::where('status',1)->whereMonth('tanggal_lapor',$month)->whereYear('tanggal_lapor',$year)->where('kode_upt',Auth::user()->upt)->sum('data_sampling');
- if($data_sampling == 0){
- $calculationData = 0;
- }else{
- $calculationData = ( $hi_sesuai_isr + $tl_sesuai_isr ) / ($data_sampling) * 100;
- }
- if ($calculationData >= 100) {
- $calculationData = 100;
- }
- }else{
- $calculationData = 0;
- }
- ?>
- {{number_format($calculationData, 2)}},
- ]
- },
- ]
- });
- </script>
- @endif
- <script type="text/javascript">
- var map = am4core.create("chartdiv", am4maps.MapChart);
- </script>
- <script type="text/javascript">
- $('form#inspeksi-save').submit(function(event) {
- var data_sampling = parseInt($('#data_sampling').val());
- var hi_sesuai_isr = parseInt($('#hi_sesuai_isr').val());
- var hi_proses_isr = parseInt($('#hi_proses_isr').val());
- var hi_tidak_aktif = parseInt($('#hi_tidak_aktif').val());
- var hi_tidak_sesuai_isr = parseInt($('#hi_tidak_sesuai_isr').val());
- var jumlah_hi = parseInt(hi_sesuai_isr + hi_proses_isr + hi_tidak_aktif + hi_tidak_sesuai_isr);
-
- if (jumlah_hi > data_sampling) {
- $("#data_sampling").addClass("is-invalid");
- $("#data_sampling").focus();
- return false;
- }
- else {
- $("#data_sampling").removeClass("is-invalid");
- return true;
- }
- });
- $('#data_sampling').keydown(function(event) {
- $("#data_sampling").removeClass("is-invalid");
- });
- </script>
|