diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 6dd04686..ab69269a 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -3,8 +3,7 @@ namespace App\Controllers; use App\Models\Mpemby; -use CodeIgniter\HTTP\RequestInterface; -use CodeIgniter\HTTP\ResponseInterface; + class Home extends BaseController { diff --git a/app/Models/Mpemby.php b/app/Models/Mpemby.php index 72bb541c..38e26cc9 100644 --- a/app/Models/Mpemby.php +++ b/app/Models/Mpemby.php @@ -82,7 +82,11 @@ class Mpemby extends Model function sofNas($param) { $tahun = $param['tahun']; - $query = $this->db->query("SELECT LAPISAN,TO_NUMBER(WPBYR) WPBYR,ROUND(TOTAL) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "'"); + $query = $this->db->query("SELECT LAPISAN,WPBYR,TOTAL, + (SELECT SUM(WPBYR) FROM SOFNAS WHERE THNBYR = '" . $tahun . "') TOTWPBYR, + (SELECT SUM(TOTAL) FROM SOFNAS WHERE THNBYR = '" . $tahun . "') TOTALL + FROM ( + SELECT LAPISAN,TO_NUMBER(WPBYR) WPBYR,ROUND(TOTAL) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "')"); return $query; } } diff --git a/app/Views/inc/head.php b/app/Views/inc/head.php index 34091195..5b52e9d1 100644 --- a/app/Views/inc/head.php +++ b/app/Views/inc/head.php @@ -4,7 +4,7 @@ - Engine - Kewilayahan + Engine - Nasional @@ -26,7 +26,7 @@ - + diff --git a/app/Views/ppm/dashboard.php b/app/Views/ppm/dashboard.php index 98e2cbe2..6c88ff4b 100644 --- a/app/Views/ppm/dashboard.php +++ b/app/Views/ppm/dashboard.php @@ -382,27 +382,39 @@ $datapaycomp = $datapaycomp . "]"; Jumlah Jumlah % - WPBYR; - $totjmlsof += $datasof->TOTAL; - - $pctwp = $datasof->WPBYR / $totwpsof * 100; - $pctpen = $datasof->TOTAL / $totjmlsof * 100; - print_r((array_sum(array($totwpsof)))); + WPBYR; + $totwpsof = $row->TOTWPBYR; + $totjmlsof = $row->TOTALL; + + $pctwp = $row->WPBYR / $totwpsof * 100; + $pctpen = $row->TOTAL / $totjmlsof * 100; + + if ($pctwp < 20) { + $mpctwp = "text-danger"; + } else { + $mpctwp = "text-success"; + } + + if ($pctpen < 20) { + $mpctpen = "text-danger"; + } else { + $mpctpen = "text-success"; + } + ?> - - LAPISAN ?> - WPBYR, 0, ',', '.') ?> - - TOTAL, 0, ',', '.') ?> - + LAPISAN; ?> + WPBYR, 0, ',', '.') ?> + + TOTAL, 0, ',', '.') ?> + + *) Nilai Persentase dibawah 20% berwarna merah