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.
319 lines
10 KiB
319 lines
10 KiB
<?php |
|
|
|
namespace App\Controllers\Bendahara; |
|
use App\Controllers\BaseController; |
|
use App\Models\Bendahara\MGeneral; |
|
use App\Models\Bendahara\MBeranda; |
|
|
|
class Beranda extends BaseController { |
|
|
|
public function index() { |
|
if (session('isLogin')) { |
|
$general = new MGeneral(); |
|
$beranda = new MBeranda(); |
|
|
|
if (session('tpkantor') == 'KPP') return redirect()->to(base_url('Bendahara/beranda/kpp')); |
|
else if (session('tpkantor') == 'Kanwil') return redirect()->to(base_url('Bendahara/beranda/kanwil')); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
$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"; |
|
|
|
$param = array( |
|
'cari_tahun' => $cari_tahun, |
|
'cari_bulan_awal' => $cari_bulan_awal, |
|
'cari_bulan_akhir' => $cari_bulan_akhir, |
|
'cari_sumber_dana' => $cari_sumber_dana, |
|
'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_sumber_dana'] = $cari_sumber_dana; |
|
$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['data_beranda'] = $beranda->get_data_beranda_index($param); |
|
$p['data_beranda_total'] = $beranda->get_data_beranda_index_total($param); |
|
|
|
echo view('inc/head'); |
|
echo view('inc/js'); |
|
echo view('inc/navbar'); |
|
echo view('inc/sidebar'); |
|
echo view('beranda/index', $p); |
|
echo view('inc/footer'); |
|
} |
|
else return redirect()->to(base_url('auth')); |
|
} |
|
|
|
public function data_index_grafik_timeline() { |
|
if (session('isLogin')) { |
|
$beranda = new MBeranda(); |
|
|
|
if (session('tpkantor') == 'KPP') return redirect()->to(base_url('Bendahara/beranda/kpp')); |
|
else if (session('tpkantor') == 'Kanwil') return redirect()->to(base_url('Bendahara/beranda/kanwil')); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
|
|
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'); |
|
|
|
$param = array( |
|
'cari_tahun' => $cari_tahun, |
|
'cari_bulan_awal' => $cari_bulan_awal, |
|
'cari_bulan_akhir' => $cari_bulan_akhir, |
|
'cari_sumber_dana' => $cari_sumber_dana |
|
); |
|
|
|
$data = $beranda->get_data_beranda_index_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); |
|
} |
|
} |
|
|
|
public function kanwil() { |
|
if (session('isLogin')) { |
|
$general = new MGeneral(); |
|
$beranda = new MBeranda(); |
|
|
|
if (session('tpkantor') == 'KPP') return redirect()->to(base_url('Bendahara/beranda/kpp')); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
$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') == '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_sumber_dana' => $cari_sumber_dana, |
|
'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_sumber_dana'] = $cari_sumber_dana; |
|
$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['data_beranda'] = $beranda->get_data_beranda_kanwil($param); |
|
$p['data_beranda_total'] = $beranda->get_data_beranda_kanwil_total($param); |
|
|
|
echo view('inc/head'); |
|
echo view('inc/js'); |
|
echo view('inc/navbar'); |
|
echo view('inc/sidebar'); |
|
echo view('beranda/kanwil', $p); |
|
echo view('inc/footer'); |
|
} |
|
else return redirect()->to(base_url('auth')); |
|
} |
|
|
|
public function data_kanwil_grafik_timeline() { |
|
if (session('isLogin')) { |
|
$beranda = new MBeranda(); |
|
|
|
if (session('tpkantor') == 'KPP') return redirect()->to(base_url('Bendahara/beranda/kpp')); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
|
|
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'); |
|
|
|
$param = array( |
|
'cari_tahun' => $cari_tahun, |
|
'cari_bulan_awal' => $cari_bulan_awal, |
|
'cari_bulan_akhir' => $cari_bulan_akhir, |
|
'cari_kanwil' => $cari_kanwil, |
|
'cari_sumber_dana' => $cari_sumber_dana |
|
); |
|
|
|
$data = $beranda->get_data_beranda_kanwil_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); |
|
} |
|
} |
|
|
|
public function kpp() { |
|
if (session('isLogin')) { |
|
$general = new MGeneral(); |
|
$beranda = new MBeranda(); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
$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_sumber_dana' => $cari_sumber_dana, |
|
'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_sumber_dana'] = $cari_sumber_dana; |
|
$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['data_beranda'] = $beranda->get_data_beranda_kpp($param); |
|
$p['data_beranda_total'] = $beranda->get_data_beranda_kpp_total($param); |
|
|
|
echo view('inc/head'); |
|
echo view('inc/js'); |
|
echo view('inc/navbar'); |
|
echo view('inc/sidebar'); |
|
echo view('beranda/kpp', $p); |
|
echo view('inc/footer'); |
|
} |
|
else return redirect()->to(base_url('auth')); |
|
} |
|
|
|
public function data_kpp_grafik_timeline() { |
|
if (session('isLogin')) { |
|
$beranda = new MBeranda(); |
|
|
|
$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_sumber_dana = $this->request->getGet('cari_sumber_dana'); |
|
|
|
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'); |
|
|
|
$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_sumber_dana' => $cari_sumber_dana |
|
); |
|
|
|
$data = $beranda->get_data_beranda_kpp_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); |
|
} |
|
} |
|
|
|
}
|
|
|