Browse Source

change base to monthly pen

main^2
dfoso 1 year ago committed by =
parent
commit
939b6494e3
  1. 9
      app/Controllers/Home.php
  2. 6
      app/Models/Mpemby.php
  3. 6
      app/Views/ppm/dashboard.php

9
app/Controllers/Home.php

@ -17,12 +17,19 @@ class Home extends BaseController
$model = new Mpemby();
$ptahun = $this->request->getPost('tahun');
$pbulan = $this->request->getPost('bulan');
if (empty($ptahun)) {
$tahun = date('Y');
} else {
$tahun = $ptahun;
}
$param = array('tahun' => $tahun);
if (empty($pbulan)) {
$bulan = date('m');
} else {
$bulan = $pbulan;
}
$param = array('tahun' => $tahun, 'bln' => $bulan);
$p['tahunx'] = $tahun;
$p['penerimaan'] = $model->getPenn($param)->getResult();
$p['updatex'] = $model->getUpd()->getFirstRow('array');

6
app/Models/Mpemby.php

@ -10,7 +10,7 @@ class Mpemby extends Model
function getPenn($param)
{
$tahun = $param['tahun'];
$bln = date('m');
$bln = $param['bln'];
$query = $this->db->query("SELECT NM_KANWIL, TARGET, SUM(PENERIMAAN_BERJALAN) PENB, SUM(PENERIMAAN_LALU) PENL,
(SUM(PENERIMAAN_BERJALAN)/TARGET)*100 PENCAPAIAN, ((SUM(PENERIMAAN_BERJALAN)-SUM(PENERIMAAN_LALU))/SUM(PENERIMAAN_LALU))*100 PERTUMBUHAN
FROM KINERJA_PENERIMAAN
@ -34,7 +34,7 @@ class Mpemby extends Model
{
$tahun = $param['tahun'];
$tahunl = $tahun - 1;
$bln = date('m');
$bln = $param['bln'];
$query = $this->db->query("SELECT CASE WHEN KD_KATEGORI IS NULL THEN '-' ELSE KD_KATEGORI END KODE,
CASE WHEN KD_KATEGORI IS NULL THEN 'UNKNOWN' ELSE NM_KATEGORI END NMKAT,
SUM(CASE WHEN THNBYR = '" . $tahun . "' AND BLNBYR = '" . $bln . "' THEN WPBAYAR ELSE 0 END)WPBYRN,
@ -53,7 +53,7 @@ class Mpemby extends Model
{
$tahun = $param['tahun'];
$tahunl = $tahun - 1;
$bln = date('m');
$bln = $param['bln'];
$query = $this->db->query("SELECT NM_PAJAK,TOTALN PENERIMAAN, TOTALP PENL,
(SELECT ROUND(SUM(TOTAL)) FROM PERJENIS_MV WHERE THNBYR = '" . $tahun . "' AND BLNBYR <= '" . $bln . "') PENERIMAAN_TOT,
(SELECT ROUND(SUM(TOTAL)) FROM PERJENIS_MV WHERE THNBYR = '" . $tahunl . "' AND BLNBYR <= '" . $bln . "') PENERIMAAN_TOTL

6
app/Views/ppm/dashboard.php

@ -174,7 +174,7 @@ $datapaycomp = $datapaycomp . "]";
<small class="text-small mt-10 d-block">update <?= $updatex['UPD'] ?></small>
</div>
<div class="progress progress-sm">
<div class="progress-bar bg-info" role="progressbar" aria-valuenow="<?= date('n') ?>" aria-valuemin="0" aria-valuemax="12" style="width: <?= date('n') ?>%;"></div>
<div class="progress-bar bg-info" role="progressbar" aria-valuenow="<?= idate('d') ?>" aria-valuemin="1" aria-valuemax="<?= idate('t') ?>" style="width: <?= idate('t') / idate('d') * 100 ?>%;"></div>
</div>
</div>
</div>
@ -222,7 +222,7 @@ $datapaycomp = $datapaycomp . "]";
</div>
<div class="row mb-15">
<div class="col-9">Jumlah WP</div>
<div class="col-9">WP Terdaftar</div>
<div class="col-3 text-right">28%</div>
<div class="col-12">
<div class="progress progress-sm mt-5">
@ -283,7 +283,7 @@ $datapaycomp = $datapaycomp . "]";
</div>
</div>
<div class="row mb-15">
<div class="col-9">Jumlah WP</div>
<div class="col-9">WP Terdaftar</div>
<div class="col-3 text-right">28%</div>
<div class="col-12">
<div class="progress progress-sm mt-5">

Loading…
Cancel
Save