|
|
|
@ -87,10 +87,10 @@ class Mpemby extends Model
|
|
|
|
|
$tahun = $param['tahun']; |
|
|
|
|
$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 |
|
|
|
|
(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 NO,LAPISAN,SUM(ROUND(WPBYR/2)) WPBYR,SUM(ROUND(TOTAL)) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "' AND BLNBYR < = '".$bln."' |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
@ -104,7 +104,7 @@ class Mpemby extends Model
|
|
|
|
|
|
|
|
|
|
function getWpsk() |
|
|
|
|
{ |
|
|
|
|
$query= $this->db->query("SELECT SUM(CASE WHEN FLAG_WPS_WPK = 'WPK' THEN JUMLAHWP ELSE 0 END) WPK, |
|
|
|
|
$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; |
|
|
|
@ -115,7 +115,7 @@ class Mpemby extends Model
|
|
|
|
|
$tahun = $param['tahun']; |
|
|
|
|
$tahunl = $tahun - 1; |
|
|
|
|
$bln = $param['bln']; |
|
|
|
|
$query= $this->db->query("SELECT |
|
|
|
|
$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, |
|
|
|
@ -132,13 +132,23 @@ class Mpemby extends Model
|
|
|
|
|
{ |
|
|
|
|
$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 |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function laporTahunan($param) |
|
|
|
|
{ |
|
|
|
|
$tahun = $param['tahun']; |
|
|
|
|
$tahunl = $tahun - 1; |
|
|
|
|
|
|
|
|
|
$query = $this->db->query("SELECT SUM(CASE WHEN TAHUN = '" . $tahun . "' THEN JMLLAPOR ELSE 0 END) LAPORNOW, |
|
|
|
|
SUM(CASE WHEN TAHUN = '" . $tahunl . "' THEN JMLLAPOR ELSE 0 END) LAPORPAST |
|
|
|
|
FROM DASH_SPTTAHUNAN"); |
|
|
|
|
return $query; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|