WPBYR;
$totalWPBYRTERATUR += $row->WPBYRTERATUR;
$totalJMLWP += $row->JMLWP;
}
$nasionalX = ($totalWPBYR / ($totalJMLWP ?: 1)) * 100;
$nasionalY = ($totalWPBYRTERATUR / ($totalWPBYR ?: 1)) * 100;
$area1Count = 0; // Top right
$area2Count = 0; // Top left
$area3Count = 0; // Bottom right
$area4Count = 0; // Bottom left
foreach ($raporbyr as $row) {
$x = ($row->WPBYR / ($row->JMLWP ?: 1)) * 100;
$y = ($row->WPBYRTERATUR / ($row->WPBYR ?: 1)) * 100;
if ($x > $nasionalX && $y > $nasionalY) {
$area1Count++;
} elseif ($x <= $nasionalX && $y > $nasionalY) {
$area2Count++;
} elseif ($x > $nasionalX && $y <= $nasionalY) {
$area3Count++;
} elseif ($x <= $nasionalX && $y <= $nasionalY) {
$area4Count++;
}
}
$dataraporkwl = "[";
$dataraporkwl .= "{x: " . $nasionalX . ", y: " . $nasionalY . ", z: 2, name: 'Nasional', color: '#000000', jmlwp: " . $totalJMLWP . ", wpbyr: " . $totalWPBYR . ", wpbyrteratur: " . $totalWPBYRTERATUR . "},";
foreach ($raporbyr as $row) {
$x = (($row->WPBYR / $row->JMLWP ?: 1)) * 100;
$y = (($row->WPBYRTERATUR / $row->WPBYR ?: 1)) * 100;
$dd = $row->KWLADM;
$dataraporkwl .= "{x: " . $x . ", y: " . $y . ", z: 1, name: '" . addslashes($row->NAMA) . "', drilldown: \"" . $dd . "\", jmlwp: " . $row->JMLWP . ", wpbyr: " . $row->WPBYR . ", wpbyrteratur: " . $row->WPBYRTERATUR . "},";
}
$dataraporkwl = rtrim($dataraporkwl, ',') . "]";
$nasionalX = ($totalWPBYR / ($totalJMLWP ?: 1)) * 100;
$nasionalY = ($totalWPBYRTERATUR / ($totalWPBYR ?: 1)) * 100;
$drilldownSeries = [];
// per KPP
foreach ($drilldownData['kpp'] as $kwladm => $kpps) {
$parentPoint = null;
$data = [];
foreach ($raporbyr as $row) {
if ($row->KWLADM == $kwladm) {
$parentPoint = [
'name' => $row->NAMA,
'x' => ($row->WPBYR / ($row->JMLWP ?: 1)) * 100,
'y' => ($row->WPBYRTERATUR / ($row->WPBYR ?: 1)) * 100,
'color' => '#FF0000',
'dataLabels' => [
'enabled' => true,
'format' => '{point.name}',
'style' => ['fontWeight' => 'bold']
],
'jmlwp' => $row->JMLWP,
'wpbyr' => $row->WPBYR,
'wpbyrteratur' => $row->WPBYRTERATUR
];
break;
}
}
if ($parentPoint) {
$data[] = $parentPoint;
}
foreach ($kpps as $kpp) {
$data[] = [
'name' => $kpp['name'],
'x' => $kpp['x'],
'y' => $kpp['y'],
'z' => $kpp['z'],
'drilldown' => (string)$kpp['drilldown'],
'jmlwp' => $kpp['jmlwp'],
'wpbyr' => $kpp['wpbyr'],
'wpbyrteratur' => $kpp['wpbyrteratur']
];
}
$drilldownSeries[] = [
'id' => (string)$kwladm,
'name' => "KPP in " . $kwladm,
'data' => $data
];
}
// per Seksi
foreach ($drilldownData['sie'] as $kppadm => $sies) {
$parentPoint = null;
$data = [];
foreach ($raporbyrkpp as $row) {
if ($row->KPPADM == $kppadm) {
$parentPoint = [
'name' => $row->NAMA,
'x' => ($row->WPBYR / ($row->JMLWP ?: 1)) * 100,
'y' => ($row->WPBYRTERATUR / ($row->WPBYR ?: 1)) * 100,
'color' => '#00FF00',
'dataLabels' => [
'enabled' => true,
'format' => '{point.name}',
'style' => ['fontWeight' => 'bold']
],
'jmlwp' => $row->JMLWP,
'wpbyr' => $row->WPBYR,
'wpbyrteratur' => $row->WPBYRTERATUR
];
break;
}
}
if ($parentPoint) {
$data[] = $parentPoint;
}
foreach ($sies as $sie) {
$data[] = [
'name' => $sie['name'],
'x' => $sie['x'],
'y' => $sie['y'],
'z' => $sie['z'],
'drilldown' => (string)($kppadm . '_' . $sie['drilldown']),
'jmlwp' => $sie['jmlwp'],
'wpbyr' => $sie['wpbyr'],
'wpbyrteratur' => $sie['wpbyrteratur']
];
}
$drilldownSeries[] = [
'id' => (string)$kppadm,
'name' => "SIE in " . $kppadm,
'data' => $data
];
}
// per Pegawai
foreach ($drilldownData['peg'] as $key => $pegs) {
$parentPoint = null;
$data = [];
list($kppadm, $kodesie) = explode('_', $key);
foreach ($raporbyrsie as $row) {
if ($row->KPPADM == $kppadm && $row->KODESIE == $kodesie) {
$parentPoint = [
'name' => $row->NAMA,
'x' => ($row->WPBYR / ($row->JMLWP ?: 1)) * 100,
'y' => ($row->WPBYRTERATUR / ($row->WPBYR ?: 1)) * 100,
'color' => '#0000FF',
'dataLabels' => [
'enabled' => true,
'format' => '{point.name}',
'style' => ['fontWeight' => 'bold']
],
'jmlwp' => $row->JMLWP,
'wpbyr' => $row->WPBYR,
'wpbyrteratur' => $row->WPBYRTERATUR
];
break;
}
}
if ($parentPoint) {
$data[] = $parentPoint;
}
foreach ($pegs as $peg) {
$data[] = [
'name' => $peg['name'],
'x' => $peg['x'],
'y' => $peg['y'],
'z' => $peg['z'],
'drilldown' => null,
'jmlwp' => $peg['jmlwp'],
'wpbyr' => $peg['wpbyr'],
'wpbyrteratur' => $peg['wpbyrteratur']
];
}
$drilldownSeries[] = [
'id' => (string)$key,
'name' => "PEG in " . $key,
'data' => $data
];
}
$d['drilldownSeries'] = $drilldownSeries;
?>
No |
Unit |
%WP Bayar |
%WP Bayar Teratur |
Jumlah WP |
WP Bayar = $tahunx ?> |
WP Bayar Teratur = $tahunx ?> |
WPBYR / ($row->JMLWP ?: 1)) * 100;
$wpBayarTeraturPercentage = ($row->WPBYRTERATUR / ($row->WPBYR ?: 1)) * 100;
$totalJmlWP += $row->JMLWP;
$totalWPBayar += $row->WPBYR;
$totalWPBayarTeratur += $row->WPBYRTERATUR;
?>
= $no++ ?> |
= $row->KWLADM ?>-= $row->NM_PANJANG ?> |
= number_format($wpBayarPercentage, 2) ?>% |
= number_format($wpBayarTeraturPercentage, 2) ?>% |
= number_format($row->JMLWP, 0, ',', '.') ?> |
= number_format($row->WPBYR, 0, ',', '.') ?> |
= number_format($row->WPBYRTERATUR, 0, ',', '.') ?> |