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.
139 lines
4.3 KiB
139 lines
4.3 KiB
<?php |
|
|
|
namespace App\Controllers\Bendahara; |
|
|
|
use App\Models\Bendahara\MGeneral; |
|
use App\Models\Bendahara\MApbd; |
|
use App\Controllers\BaseController; |
|
|
|
class Apbd extends BaseController { |
|
|
|
public function index() { |
|
if (session('isLogin')) { |
|
$general = new MGeneral(); |
|
$apbd = new MApbd(); |
|
|
|
$cari_tahun = $this->request->getGet('cari_tahun'); |
|
$cari_bulan_awal = $this->request->getGet('cari_bulan_awal'); |
|
$cari_bulan_akhir = $this->request->getGet('cari_bulan_akhir'); |
|
$cari_kanwil = $this->request->getGet('cari_kanwil'); |
|
$cari_kpp = $this->request->getGet('cari_kpp'); |
|
$cari_seksi = $this->request->getGet('cari_seksi'); |
|
$cari_ar = $this->request->getGet('cari_ar'); |
|
$cari_kabkot = $this->request->getGet('cari_kabkot'); |
|
$cari_limit = $this->request->getGet('cari_limit'); |
|
$cari_page = $this->request->getGet('cari_page'); |
|
|
|
if (empty($cari_tahun)) $cari_tahun = date('Y'); |
|
if (empty($cari_bulan_awal)) $cari_bulan_awal = "01"; |
|
if (empty($cari_bulan_akhir)) $cari_bulan_akhir = date('m'); |
|
if (empty($cari_limit)) $cari_limit = '25'; |
|
if (empty($cari_page)) $cari_page = '1'; |
|
|
|
if (session('tpkantor') == 'KPP') { |
|
$cari_kanwil = session('kwladm'); |
|
$cari_kpp = session('kppadm'); |
|
} |
|
else if (session('tpkantor') == 'Kanwil') { |
|
$cari_kanwil = session('kwladm'); |
|
} |
|
|
|
$param = array( |
|
'cari_tahun' => $cari_tahun, |
|
'cari_bulan_awal' => $cari_bulan_awal, |
|
'cari_bulan_akhir' => $cari_bulan_akhir, |
|
'cari_kanwil' => $cari_kanwil, |
|
'cari_kpp' => $cari_kpp, |
|
'cari_seksi' => $cari_seksi, |
|
'cari_ar' => $cari_ar, |
|
'cari_kabkot' => $cari_kabkot, |
|
'cari_limit' => $cari_limit, |
|
'cari_page' => $cari_page |
|
); |
|
|
|
$p['cari_tahun'] = $cari_tahun; |
|
$p['cari_bulan_awal'] = $cari_bulan_awal; |
|
$p['cari_bulan_akhir'] = $cari_bulan_akhir; |
|
$p['cari_kanwil'] = $cari_kanwil; |
|
$p['cari_kpp'] = $cari_kpp; |
|
$p['cari_seksi'] = $cari_seksi; |
|
$p['cari_ar'] = $cari_ar; |
|
$p['cari_kabkot'] = $cari_kabkot; |
|
$p['cari_limit'] = $cari_limit; |
|
$p['cari_page'] = $cari_page; |
|
$p['ref_tahun'] = $general->get_ref_tahun(); |
|
$p['ref_bulan'] = $general->get_ref_bulan(); |
|
$p['ref_kanwil'] = $general->get_ref_kanwil(); |
|
$p['ref_seksi'] = $general->get_ref_seksi(); |
|
$p['data_apbd'] = $apbd->get_data_apbd($param); |
|
$p['data_apbd_total'] = $apbd->get_data_apbd_total($param); |
|
|
|
echo view('inc/head'); |
|
echo view('inc/js'); |
|
echo view('inc/navbar'); |
|
echo view('inc/sidebar'); |
|
echo view('apbd/index', $p); |
|
echo view('inc/footer'); |
|
} |
|
else return redirect()->to(base_url('auth')); |
|
} |
|
|
|
public function data_grafik_timeline() { |
|
if (session('isLogin')) { |
|
$apbdes = new MApbd(); |
|
|
|
$cari_tahun = $this->request->getGet('cari_tahun'); |
|
$cari_bulan_awal = $this->request->getGet('cari_bulan_awal'); |
|
$cari_bulan_akhir = $this->request->getGet('cari_bulan_akhir'); |
|
$cari_kanwil = $this->request->getGet('cari_kanwil'); |
|
$cari_kpp = $this->request->getGet('cari_kpp'); |
|
$cari_seksi = $this->request->getGet('cari_seksi'); |
|
$cari_ar = $this->request->getGet('cari_ar'); |
|
$cari_kabkot = $this->request->getGet('cari_kabkot'); |
|
|
|
if (empty($cari_tahun)) $cari_tahun = date('Y'); |
|
if (empty($cari_bulan_awal)) $cari_bulan_awal = "01"; |
|
if (empty($cari_bulan_akhir)) $cari_bulan_akhir = date('m'); |
|
|
|
if (session('tpkantor') == 'KPP') { |
|
$cari_kanwil = session('kwladm'); |
|
$cari_kpp = session('kppadm'); |
|
} |
|
else if (session('tpkantor') == 'Kanwil') { |
|
$cari_kanwil = session('kwladm'); |
|
} |
|
|
|
$param = array( |
|
'cari_tahun' => $cari_tahun, |
|
'cari_bulan_awal' => $cari_bulan_awal, |
|
'cari_bulan_akhir' => $cari_bulan_akhir, |
|
'cari_kanwil' => $cari_kanwil, |
|
'cari_kpp' => $cari_kpp, |
|
'cari_seksi' => $cari_seksi, |
|
'cari_ar' => $cari_ar, |
|
'cari_kabkot' => $cari_kabkot |
|
); |
|
|
|
$data = $apbdes->get_data_apbd_grafik($param); |
|
|
|
$series_1 = []; |
|
$series_2 = []; |
|
$series_1_temp = 0; |
|
$series_2_temp = 0; |
|
|
|
foreach($data as $idx => $val) { |
|
$series_1_temp += $val->REAL_TOTAL; |
|
$series_2_temp += $val->BAYAR_TOTAL; |
|
|
|
$series_1[$idx] = $series_1_temp; |
|
$series_2[$idx] = $series_2_temp; |
|
} |
|
|
|
$data_lengkap['realisasi_pagu'] = $series_1; |
|
$data_lengkap['realisasi_pajak'] = $series_2; |
|
|
|
echo json_encode($data_lengkap, JSON_NUMERIC_CHECK); |
|
} |
|
} |
|
|
|
}
|
|
|