WPLPR / $row->JMLWP ?: 0)) * 100;
$kanwilData[] = [
'y' => $y,
'name' => addslashes($row->NAMA),
'drilldown' => (string)$row->KWLADM,
'jmlwp' => $row->JMLWP,
'wplpr' => $row->WPLPR
];
}
// Sort the data by the 'y' value in descending order
usort($kanwilData, function ($a, $b) {
return $b['y'] <=> $a['y'];
});
// Convert the sorted array to a JSON string
$dataraporkwl = json_encode($kanwilData);
$drilldownSeries = [];
// Prepare KPP drilldown
foreach ($raporlpr as $kanwil) {
$kppData = [];
foreach ($raporlprkpp as $kpp) {
if ($kpp->KWLADM == $kanwil->KWLADM) {
$kppData[] = [
'name' => $kpp->NAMA,
'y' => ($kpp->WPLPR / ($kpp->JMLWP ?: 1)) * 100,
'drilldown' => (string)$kpp->KPPADM,
'jmlwp' => $kpp->JMLWP,
'wplpr' => $kpp->WPLPR
];
}
}
// Sort the KPP data by the 'y' value in descending order
usort($kppData, function ($a, $b) {
return $b['y'] <=> $a['y'];
});
$drilldownSeries[] = [
'id' => (string)$kanwil->KWLADM,
'name' => "KPP in " . $kanwil->NAMA,
'data' => $kppData
];
}
// Prepare Seksi drilldown
foreach ($raporlprkpp as $kpp) {
$sieData = [];
foreach ($raporlprsie as $sie) {
if ($sie->KPPADM == $kpp->KPPADM) {
$sieData[] = [
'name' => $sie->NAMA,
'y' => ($sie->WPLPR / ($sie->JMLWP ?: 1)) * 100,
'drilldown' => (string)($kpp->KPPADM . '_' . $sie->KODESIE),
'jmlwp' => $sie->JMLWP,
'wplpr' => $sie->WPLPR
];
}
}
// Sort the Seksi data by the 'y' value in descending order
usort($sieData, function ($a, $b) {
return $b['y'] <=> $a['y'];
});
$drilldownSeries[] = [
'id' => (string)$kpp->KPPADM,
'name' => "Seksi in " . $kpp->NAMA,
'data' => $sieData
];
}
// Prepare Pegawai drilldown (if available)
if (isset($raporlprpeg)) {
foreach ($raporlprsie as $sie) {
$pegData = [];
foreach ($raporlprpeg as $peg) {
if ($peg->KPPADM == $sie->KPPADM && $peg->KODESIE == $sie->KODESIE) {
$pegData[] = [
'name' => $peg->NAMA,
'y' => ($peg->WPLPR / ($peg->JMLWP ?: 1)) * 100,
'jmlwp' => $peg->JMLWP,
'wplpr' => $peg->WPLPR
];
}
}
// Sort the Pegawai data by the 'y' value in descending order
usort($pegData, function ($a, $b) {
return $b['y'] <=> $a['y'];
});
$drilldownSeries[] = [
'id' => (string)($sie->KPPADM . '_' . $sie->KODESIE),
'name' => "Pegawai in " . $sie->NAMA,
'data' => $pegData
];
}
}
?>
No |
Unit |
Persentase WP Lapor |
Jumlah WP |
WP Lapor |
= $no++ ?> |
= $row['name'] ?> |
= number_format($row['y'], 2) ?>% |
= number_format($row['jmlwp'], 0, ',', '.') ?> |
= number_format($row['wplpr'], 0, ',', '.') ?> |
Total |
= number_format(($totalWPLapor / ($totalJmlWP ?: 1)) * 100, 2) ?>
%
|
= number_format($totalJmlWP, 0, ',', '.') ?> |
= number_format($totalWPLapor, 0, ',', '.') ?> |