Browse Source

identifikasi lapangan bulan terpilih

main
pecintaseni 7 months ago
parent
commit
f35f22c02c
  1. 64
      app/Controllers/Kewilayahan/Sebaran/IdentifikasiLapangan.php
  2. 6
      app/Views/kewilayahan/dist/kpdl.js
  3. 34
      app/Views/kewilayahan/kytp/componentProgresifitas/ChartKPDL.js

64
app/Controllers/Kewilayahan/Sebaran/IdentifikasiLapangan.php

@ -2,74 +2,10 @@
namespace App\Controllers\Kewilayahan\Sebaran;
use App\Libraries\KpdlLibrary;
use CodeIgniter\Database\RawSql;
class IdentifikasiLapangan extends \App\Controllers\Kewilayahan\Kytp
{
protected function dataAgg($request, $bulan)
{
$opsiWilZona = $request->getPost('opsiWilZona');
$adm4_pcode = $request->getPost('adm4_pcode') ?? [];
$id_poly_zona = $request->getPost('id_poly_zona') ?? [];
$db = \Config\Database::connect();
$KpdlLibrary = new KpdlLibrary;
if ($bulan == 'semua') {
$npwp = $db->table('KPDL_MV_JML_KPDL_AGG A')
->select('BULAN, SUM(JML) JML')
->where("TAHUN =" . date('Y'))
->where('BULAN <=', date('m'))
->groupBy('BULAN');
if ($opsiWilZona == 'wilayah') {
$npwp = $npwp->whereIn('ADM4_PCODE', $adm4_pcode);
}
if ($opsiWilZona == 'zona') {
$npwp = $npwp->whereIn('ID_POLY_ZONA', $id_poly_zona);
}
$npwp = $npwp->getCompiledSelect();
$data = $db->table('BULAN A')
->select("A.KODE AS BULAN, C.JML")
->join("(" . $npwp . ") C", 'A.KODE = C.BULAN', 'left')
->orderBy('BULAN');
return $KpdlLibrary->single_array($data->get()->getResult(), 'JML');
} else {
$tgl_format = date('Y') . '-' . $bulan . '-' . '01';
$generateTgl = $db->newQuery(new RawSql("SELECT trunc(LAST_DAY(to_date('" . $tgl_format . "','YYYY-MM-DD')) - level + 1) AS TGL
FROM
dual
CONNECT BY LEVEL <= (trunc(LAST_DAY(to_date('" . $tgl_format . "','YYYY-MM-DD'))) - to_date('" . $tgl_format . "','YYYY-MM-DD') + 1)"));
$data = $db->table('KPDL_MV_LOKASI_SUBJEK B')
->select("TO_CHAR(CREATION_DATE,'DD') as TGL, COUNT(1) JML")
->where("to_char(CREATION_DATE,'YYYY') = ", date('Y'))
->where("to_char(CREATION_DATE,'MM') = ", $bulan)
->groupBy("TO_CHAR(CREATION_DATE,'DD')");
if ($opsiWilZona == 'wilayah') {
$data = $data->whereIn('ADM4_PCODE', $adm4_pcode);
}
if ($opsiWilZona == 'zona') {
$data = $data->whereIn('ID_POLY_ZONA', $id_poly_zona);
}
$data = $data->getCompiledSelect();
$dataRet = $db->newQuery()
->select("A.TGL, B.JML")
->from($generateTgl, "A")
->join("(" . $data . ") B", "A.TGL = B.TGL", 'left')
->orderBy("TGL");
return $KpdlLibrary->single_array($dataRet->get()->getResult(), 'JML');
}
}
protected function dataKpdl($request, $bulan)
{

6
app/Views/kewilayahan/dist/kpdl.js vendored

@ -62915,8 +62915,8 @@ const ChartKpdl = ({
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(es_Row, null, /*#__PURE__*/react.createElement(es_Col, {
md: "12"
}, /*#__PURE__*/react.createElement("div", {
className: "d-flex justify-content-start "
}, /*#__PURE__*/react.createElement("span", {
className: "d-flex justify-content-between "
}, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("span", {
className: "mr-2"
}, "Bulan :"), bulan.map((val, idx) => {
return /*#__PURE__*/react.createElement(badge_esm_Badge, {
@ -62927,7 +62927,7 @@ const ChartKpdl = ({
className: "ref_bulan_a cursor-pointer mr-10",
onClick: e => refBulanOnClick(e)
});
})))), /*#__PURE__*/react.createElement(es_Row, null, /*#__PURE__*/react.createElement(es_Col, null, /*#__PURE__*/react.createElement((highcharts_react_min_default()), {
})), /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("span", null, "Bulan terpilih : "), /*#__PURE__*/react.createElement("span", null, selectedBulan))))), /*#__PURE__*/react.createElement(es_Row, null, /*#__PURE__*/react.createElement(es_Col, null, /*#__PURE__*/react.createElement((highcharts_react_min_default()), {
ref: refChart,
highcharts: (highcharts_default()),
options: optionsChart1()

34
app/Views/kewilayahan/kytp/componentProgresifitas/ChartKPDL.js

@ -156,20 +156,26 @@ const ChartKpdl = ({ dataSend }) => {
<>
<Row>
<Col md="12">
<div className="d-flex justify-content-start ">
<span className="mr-2">Bulan :</span>
{bulan.map((val, idx) => {
return (
<Badge
id={idx}
data-value={val}
severity="warning"
value={val}
className="ref_bulan_a cursor-pointer mr-10"
onClick={(e) => refBulanOnClick(e)}
></Badge>
)
})}
<div className="d-flex justify-content-between ">
<div>
<span className="mr-2">Bulan :</span>
{bulan.map((val, idx) => {
return (
<Badge
id={idx}
data-value={val}
severity="warning"
value={val}
className="ref_bulan_a cursor-pointer mr-10"
onClick={(e) => refBulanOnClick(e)}
></Badge>
)
})}
</div>
<div>
<span>Bulan terpilih : </span>
<span>{selectedBulan}</span>
</div>
</div>
</Col>
</Row>

Loading…
Cancel
Save