diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 0d000785..3e0320cd 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -39,6 +39,9 @@ class Home extends BaseController $p['paycomp'] = $model->paycompNas($param)->getResult(); $p['parsesof'] = $model->sofNas($param)->getResult(); $p['refbulan'] = $model->getBln(); + $p['wp_terdaftar'] =$model->getWpsk()->getFirstRow('array'); + $p['wp_sk'] =$model->getBreakdownPen($param)->getFirstRow('array'); + $p['wpadm'] = $model->getWPterdaftar($param)->getFirstRow('array'); diff --git a/app/Models/Mpemby.php b/app/Models/Mpemby.php index 61bc154d..018708a6 100644 --- a/app/Models/Mpemby.php +++ b/app/Models/Mpemby.php @@ -71,7 +71,7 @@ class Mpemby extends Model { $tahun = $param['tahun']; $tahunl = $tahun - 1; - $bln = $param['bulan']; + $bln = $param['bln']; $query = $this->db->query("SELECT A.JMLBULAN, A.JUMLAHWP,B.JUMLAHWP JUMLAHWPP FROM (SELECT TO_NUMBER(BLNBYR) JMLBULAN,JUMLAHWP FROM PAYCOMPNAS WHERE THNBYR = '" . $tahun . "') A, @@ -85,11 +85,13 @@ class Mpemby extends Model function sofNas($param) { $tahun = $param['tahun']; - $query = $this->db->query("SELECT LAPISAN,SUM(WPBYR) WPBYR,SUM(TOTAL) TOTAL, - (SELECT SUM(WPBYR) FROM SOFNAS WHERE THNBYR = '" . $tahun . "') TOTWPBYR, - (SELECT SUM(TOTAL) FROM SOFNAS WHERE THNBYR = '" . $tahun . "') TOTALL + $bln = $param['bln']; + $query = $this->db->query("SELECT NO,LAPISAN,WPBYR,TOTAL, + (SELECT SUM(ROUND(WPBYR/2)) FROM SOFNAS WHERE THNBYR = '" . $tahun ."' AND BLNBYR < = '" . $bln . "') TOTWPBYR, + (SELECT SUM(TOTAL) FROM SOFNAS WHERE THNBYR = '" . $tahun ."' AND BLNBYR < = '" . $bln . "') TOTALL FROM ( - SELECT LAPISAN,TO_NUMBER(WPBYR) WPBYR,ROUND(TOTAL) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "') GROUP BY LAPISAN ORDER BY LAPISAN ASC"); + SELECT NO,LAPISAN,SUM(ROUND(WPBYR/2)) WPBYR,SUM(ROUND(TOTAL)) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "' AND BLNBYR < = '".$bln."' + GROUP BY NO,LAPISAN) ORDER BY NO ASC "); return $query; } @@ -99,4 +101,44 @@ class Mpemby extends Model $builder->select('*'); return $builder->get()->getResult(); } + + function getWpsk() + { + $query= $this->db->query("SELECT SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' THEN JUMLAHWP ELSE 0 END) WPK, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPS' THEN JUMLAHWP ELSE 0 END) WPS + FROM WPSK_MV"); + return $query; + } + + function getBreakdownPen($param) + { + $tahun = $param['tahun']; + $tahunl = $tahun - 1; + $bln = $param['bln']; + $query= $this->db->query("SELECT + SUM(CASE WHEN FLAG_WPS_WPK = 'WPS' AND THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "' THEN WPBYR ELSE 0 END) WPSWP, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPS' AND THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "' THEN WPBYR ELSE 0 END) WPSWPL, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPS' AND THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) WPSBYRN, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPS' AND THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) WPSBYRP, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' AND THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "' THEN WPBYR ELSE 0 END) WPKWP, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' AND THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "' THEN WPBYR ELSE 0 END) WPKWPL, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' AND THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) WPKBYRN, + SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' AND THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) WPKBYRP + FROM BREAKDOWN_PEN"); + return $query; + } + + function getWPterdaftar($param) + { + $tahun = $param['tahun']; + $tahunl = $tahun - 1; + + + $query = $this->db->query("SELECT + SUM(CASE WHEN TAHUN <= '".$tahun."' THEN JUMLAHWP ELSE 0 END) WPADMNOW, + SUM(CASE WHEN TAHUN <= '".$tahunl."' THEN JUMLAHWP ELSE 0 END) WPADMPAST + FROM WP_TERDAFTAR"); + return $query; + + } } diff --git a/app/Views/ppm/dashboard.php b/app/Views/ppm/dashboard.php index 53747f2d..633eb762 100644 --- a/app/Views/ppm/dashboard.php +++ b/app/Views/ppm/dashboard.php @@ -53,8 +53,8 @@ foreach ($penerimaan as $row) { $penpast += $row->PENL; $capaian = ($pennow / $tgt) * 100; $growth = (($pennow - $penpast) / $penpast) * 100; - $selisih = $penpast - $pennow; - $carryover = $tgt - $pennow; + $selisih = $pennow - $penpast; + $carryover = $pennow - $tgt; } @@ -204,7 +204,7 @@ $hariini = date('d-m-y');
Tahun | +WP TERDAFTAR | +WP BAYAR | +Ratio (%) | +
---|---|---|---|
+ | = number_format($wpadm['WPADMNOW'], 0, ',', '.') ?> | += number_format($totwpskbyr, 0, ',', '.') ?> | += number_format(($totwpskbyr / $totwpall) * 100, 2) ?> | +
+ | = number_format($wpadm['WPADMPAST'], 0, ',', '.') ?> | += number_format($totwpskbyrl, 0, ',', '.') ?> | += number_format(($totwpskbyrl / $wpadm['WPADMPAST']) * 100, 2) ?> | +
Delta | += number_format(($wpadm['WPADMNOW'] - $wpadm['WPADMPAST']) / $wpadm['WPADMPAST'] * 100, 2) ?>% | += number_format(($totwpskbyr - $totwpskbyrl) / $totwpskbyrl * 100, 2) ?>% | +- | +