You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.3 KiB

<?php
namespace App\Controllers;
use App\Models\Mpemby;
class Home extends BaseController
{
public function index()
{
if (session('isLogin')) {
$model = new Mpemby();
$ptahun = $this->request->getPost('tahun');
$pbulan = $this->request->getPost('bulan');
if (empty($ptahun)) {
$tahun = date('Y');
} else {
$tahun = $ptahun;
}
if (empty($pbulan)) {
$bulan = date('m');
} else {
$bulan = $pbulan;
}
$param = array('tahun' => $tahun, 'bln' => $bulan);
$p['tahunx'] = $tahun;
$p['bulanx'] = $bulan;
$p['penerimaan'] = $model->getPenn($param)->getResult();
$p['updatex'] = $model->getUpd()->getFirstRow('array');
$p['perkategori'] = $model->getKat($param)->getResult();
$p['pie_penerimaan'] = $model->getPiePen($param)->getResult();
$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');
echo view('inc/head');
echo view('inc/navbar');
echo view('inc/sidebar');
echo view('ppm/dashboard', $p);
echo view('inc/footer');
} else {
return redirect()->to('auth');
}
}
}