From ad8fc3520e7bf873a556da6fbc369258562202c2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 30 Oct 2024 06:57:09 +0700 Subject: [PATCH] apbd --- app/Controllers/Bendahara/Apbd.php | 139 ++++ app/Controllers/Bendahara/Apbdes.php | 139 ++++ app/Controllers/Bendahara/Apbn.php | 139 ++++ app/Controllers/Bendahara/Beranda.php | 319 +++++++++ app/Controllers/Bendahara/General.php | 63 ++ app/Controllers/Home.php | 44 ++ app/Controllers/Kewilayahan/Peta.php | 7 +- app/Controllers/Rapor.php | 2 +- app/Helpers/myhelper_helper.php | 7 + app/Models/Bendahara/.gitkeep | 0 app/Models/Bendahara/MApbd.php | 210 ++++++ app/Models/Bendahara/MApbdes.php | 162 +++++ app/Models/Bendahara/MApbn.php | 210 ++++++ app/Models/Bendahara/MBeranda.php | 926 +++++++++++++++++++++++++ app/Models/Bendahara/MGeneral.php | 69 ++ app/Models/Mpemby.php | 65 ++ app/Views/apbd/index.php | 934 +++++++++++++++++++++++++ app/Views/apbdes/index.php | 843 +++++++++++++++++++++++ app/Views/apbn/index.php | 938 ++++++++++++++++++++++++++ app/Views/beranda/index.php | 776 +++++++++++++++++++++ app/Views/beranda/kanwil.php | 817 ++++++++++++++++++++++ app/Views/beranda/kpp.php | 870 ++++++++++++++++++++++++ app/Views/inc/sidebar.php | 17 + app/Views/kanwil/dashboard.php | 107 ++- app/Views/ppm/dashboard.php | 112 ++- app/Views/ppm/wpskpoc.php | 92 +++ app/Views/ppm/wpsksof.php | 262 +++++++ app/Views/rapor/deltabyr.php | 146 +++- 28 files changed, 8395 insertions(+), 20 deletions(-) create mode 100644 app/Controllers/Bendahara/Apbd.php create mode 100644 app/Controllers/Bendahara/Apbdes.php create mode 100644 app/Controllers/Bendahara/Apbn.php create mode 100644 app/Controllers/Bendahara/Beranda.php create mode 100644 app/Controllers/Bendahara/General.php create mode 100644 app/Models/Bendahara/.gitkeep create mode 100644 app/Models/Bendahara/MApbd.php create mode 100644 app/Models/Bendahara/MApbdes.php create mode 100644 app/Models/Bendahara/MApbn.php create mode 100644 app/Models/Bendahara/MBeranda.php create mode 100644 app/Models/Bendahara/MGeneral.php create mode 100644 app/Views/apbd/index.php create mode 100644 app/Views/apbdes/index.php create mode 100644 app/Views/apbn/index.php create mode 100644 app/Views/beranda/index.php create mode 100644 app/Views/beranda/kanwil.php create mode 100644 app/Views/beranda/kpp.php create mode 100644 app/Views/ppm/wpskpoc.php create mode 100644 app/Views/ppm/wpsksof.php diff --git a/app/Controllers/Bendahara/Apbd.php b/app/Controllers/Bendahara/Apbd.php new file mode 100644 index 00000000..5b162e27 --- /dev/null +++ b/app/Controllers/Bendahara/Apbd.php @@ -0,0 +1,139 @@ +<?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); + } + } + +} diff --git a/app/Controllers/Bendahara/Apbdes.php b/app/Controllers/Bendahara/Apbdes.php new file mode 100644 index 00000000..a96d79bc --- /dev/null +++ b/app/Controllers/Bendahara/Apbdes.php @@ -0,0 +1,139 @@ +<?php + +namespace App\Controllers\Bendahara; + +use App\Controllers\BaseController; +use App\Models\Bendahara\MGeneral; +use App\Models\Bendahara\MApbdes; + +class Apbdes extends BaseController { + + public function index() { + if (session('isLogin')) { + $general = new MGeneral(); + $apbdes = new MApbdes(); + + $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_apbdes'] = $apbdes->get_data_apbdes($param); + $p['data_apbdes_total'] = $apbdes->get_data_apbdes_total($param); + + echo view('inc/head'); + echo view('inc/js'); + echo view('inc/navbar'); + echo view('inc/sidebar'); + echo view('apbdes/index', $p); + echo view('inc/footer'); + } + else return redirect()->to(base_url('auth')); + } + + public function data_grafik_timeline() { + if (session('isLogin')) { + $apbdes = new MApbdes(); + + $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_apbdes_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); + } + } + +} diff --git a/app/Controllers/Bendahara/Apbn.php b/app/Controllers/Bendahara/Apbn.php new file mode 100644 index 00000000..5eecc420 --- /dev/null +++ b/app/Controllers/Bendahara/Apbn.php @@ -0,0 +1,139 @@ +<?php + +namespace App\Controllers\Bendahara; + +use App\Models\Bendahara\MGeneral; +use App\Models\Bendahara\MApbn; +use App\Controllers\BaseController; + +class Apbn extends BaseController { + + public function index() { + if (session('isLogin')) { + $general = new MGeneral(); + $apbn = new MApbn(); + + $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_apbn'] = $apbn->get_data_apbn($param); + $p['data_apbn_total'] = $apbn->get_data_apbn_total($param); + + echo view('inc/head'); + echo view('inc/js'); + echo view('inc/navbar'); + echo view('inc/sidebar'); + echo view('apbn/index', $p); + echo view('inc/footer'); + } + else return redirect()->to(base_url('auth')); + } + + public function data_grafik_timeline() { + if (session('isLogin')) { + $apbdes = new MApbn(); + + $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_apbn_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); + } + } + +} diff --git a/app/Controllers/Bendahara/Beranda.php b/app/Controllers/Bendahara/Beranda.php new file mode 100644 index 00000000..8fe365aa --- /dev/null +++ b/app/Controllers/Bendahara/Beranda.php @@ -0,0 +1,319 @@ +<?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); + } + } + +} diff --git a/app/Controllers/Bendahara/General.php b/app/Controllers/Bendahara/General.php new file mode 100644 index 00000000..58c73397 --- /dev/null +++ b/app/Controllers/Bendahara/General.php @@ -0,0 +1,63 @@ +<?php + +namespace App\Controllers\Bendahara; +use App\Controllers\BaseController; +use App\Models\Bendahara\MGeneral; + +class General extends BaseController { + + public function index() { + + } + + public function get_ref_kpp() { + if (session('isLogin')) { + $general = new MGeneral(); + + $kanwil = $this->request->getGet('kanwil'); + + $param = array( + 'kanwil' => $kanwil + ); + + $data_kpp = $general->get_ref_kpp($param); + + echo json_encode($data_kpp); + } + } + + public function get_ref_ar() { + if (session('isLogin')) { + $general = new MGeneral(); + + $kpp = $this->request->getGet('kpp'); + $seksi = $this->request->getGet('seksi'); + + $param = array( + 'kpp' => $kpp, + 'seksi' => $seksi + ); + + $data_kpp = $general->get_ref_ar($param); + + echo json_encode($data_kpp); + } + } + + public function get_ref_kabkot() { + if (session('isLogin')) { + $general = new MGeneral(); + + $kpp = $this->request->getGet('kpp'); + + $param = array( + 'kpp' => $kpp + ); + + $data_kpp = $general->get_ref_kabkot($param); + + echo json_encode($data_kpp); + } + } + +} diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 39c2654c..9616fa5a 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -356,4 +356,48 @@ class Home extends BaseController return redirect()->to('auth'); } } + + + function wpskpoc(){ + if (session('isLogin')) { + $uri = service('uri'); + $param = array( + 'tahun' => $uri->getSegment('3'), + 'bulan' => $uri->getSegment('4'), + 'kwl' => $uri->getSegment('5'), + 'kpp' => $uri->getSegment('6'), + 'src' => $uri->getSegment('7') + ); + + $p['sourcex'] = $uri->getSegment('7'); + $model = new Mpemby(); + $p['paycomp'] = $model->wpsk_paycompNas($param)->getResult(); + echo view('ppm/wpskpoc', $p); + } else { + return redirect()->to('auth'); + } + + } + + function wpsksof(){ + if (session('isLogin')) { + $uri = service('uri'); + $param = array( + 'tahun' => $uri->getSegment('3'), + 'bulan' => $uri->getSegment('4'), + 'kwl' => $uri->getSegment('5'), + 'kpp' => $uri->getSegment('6'), + 'src' => $uri->getSegment('7') + ); + + $p['sourcex'] = $uri->getSegment('7'); + $p['tahunx'] = $uri->getSegment('3'); + $model = new Mpemby(); + $p['SoF'] = $model->wpsk_sofNas($param)->getResult(); + echo view('ppm/wpsksof', $p); + } else { + return redirect()->to('auth'); + } + + } } diff --git a/app/Controllers/Kewilayahan/Peta.php b/app/Controllers/Kewilayahan/Peta.php index 4481ee99..d089e7ab 100644 --- a/app/Controllers/Kewilayahan/Peta.php +++ b/app/Controllers/Kewilayahan/Peta.php @@ -87,10 +87,13 @@ class Peta extends Controller $data = $db->table('KPDL_MV_POI_GOOGLE A') ->select("ID_DATA, NAMA, ALAMAT, CATEGORY, NM_AR_ZONA, B.NM_KANTOR, TOP_IMAGE_URL, ADM1_EN, ADM2_EN, ADM3_EN, ADM4_EN, - to_number(regexp_replace(RATING , ',', '.')) RATING, + (regexp_replace(RATING , ',' , '.')) RATING, to_number(regexp_replace(REVIEWS , '[^[:digit:]]', '')) REVIEW") ->join('REF_KPP B', 'A.KD_KPP_ZONA =B.KD_KPP', 'left') - ->where('ID_DATA', $id_data)->get()->getRowArray(); + ->where('ID_DATA', $id_data); + // print_r($data->getCompiledSelect()); + //exit; + $data = $data->get()->getRowArray(); return $this->respond(array_change_key_case($data), 200); } diff --git a/app/Controllers/Rapor.php b/app/Controllers/Rapor.php index b04f4ffd..8b9d42d4 100644 --- a/app/Controllers/Rapor.php +++ b/app/Controllers/Rapor.php @@ -368,7 +368,7 @@ class Rapor extends BaseController $p['selkpp'] = $modelref->selKpp($kwl)->getResult(); $p['selseksi'] = $modelref->selSeksi($kpp)->getResult(); $p['refbulan'] = $modelref->getBln(); - $p['data'] = $model->; + //$p['data'] = $model->; echo view('inc/head'); diff --git a/app/Helpers/myhelper_helper.php b/app/Helpers/myhelper_helper.php index 9d14503a..89ba18e7 100644 --- a/app/Helpers/myhelper_helper.php +++ b/app/Helpers/myhelper_helper.php @@ -10,3 +10,10 @@ if (!function_exists('nomor')) { return $nomor; } } + +function remove_url_param($url, $remove) { + parse_str(parse_url($url)['query'], $url_param); + unset($url_param[$remove]); + + return current_url()."?".http_build_query($url_param); +} diff --git a/app/Models/Bendahara/.gitkeep b/app/Models/Bendahara/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/app/Models/Bendahara/MApbd.php b/app/Models/Bendahara/MApbd.php new file mode 100644 index 00000000..377a3a5d --- /dev/null +++ b/app/Models/Bendahara/MApbd.php @@ -0,0 +1,210 @@ +<?php + +namespace App\Models\Bendahara; + +use CodeIgniter\Model; + +class MApbd extends Model { + + function get_data_apbd($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, KODE_SATKER, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU, + + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(ESTI_PPH21_PAGU, 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_PAGU, + (NVL(ESTI_PPH22_PAGU, 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_PAGU, + (NVL(ESTI_PPH23_PAGU, 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_PAGU, + (NVL(ESTI_PPH42_PAGU, 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_PAGU, + (NVL(ESTI_PPN_PAGU, 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_PAGU, + (NVL(ESTI_TOTAL_PAGU, 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_PPH21_REAL), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_REAL, + (NVL(SUM(ESTI_PPH22_REAL), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_REAL, + (NVL(SUM(ESTI_PPH23_REAL), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_REAL, + (NVL(SUM(ESTI_PPH42_REAL), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_REAL, + (NVL(SUM(ESTI_PPN_REAL), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_REAL, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(PAGU_TOTAL, 0), 0))*100), 2) TAX_COLLECTION + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, KODE_SATKER, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU,ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + //echo $query; + //exit; + + return $this->db->query($query)->getResult(); + } + + function get_data_apbd_total($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT + SUM(PAGU_PEGAWAI) PAGU_PEGAWAI, + SUM(PAGU_BARANG) PAGU_BARANG, + SUM(PAGU_MODAL) PAGU_MODAL, + SUM(PAGU_SOSIAL) PAGU_SOSIAL, + SUM(PAGU_LAINNYA) PAGU_LAINNYA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(ESTI_PPH21_PAGU) ESTI_PPH21_PAGU, + SUM(ESTI_PPH22_PAGU) ESTI_PPH22_PAGU, + SUM(ESTI_PPH23_PAGU) ESTI_PPH23_PAGU, + SUM(ESTI_PPH42_PAGU) ESTI_PPH42_PAGU, + SUM(ESTI_PPN_PAGU) ESTI_PPN_PAGU, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(SUM(ESTI_PPH21_PAGU), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_PAGU, + (NVL(SUM(ESTI_PPH22_PAGU), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_PAGU, + (NVL(SUM(ESTI_PPH23_PAGU), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_PAGU, + (NVL(SUM(ESTI_PPH42_PAGU), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_PAGU, + (NVL(SUM(ESTI_PPN_PAGU), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_PAGU, + (NVL(SUM(ESTI_TOTAL_PAGU), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_PPH21_REAL), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_REAL, + (NVL(SUM(ESTI_PPH22_REAL), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_REAL, + (NVL(SUM(ESTI_PPH23_REAL), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_REAL, + (NVL(SUM(ESTI_PPH42_REAL), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_REAL, + (NVL(SUM(ESTI_PPN_REAL), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_REAL, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(PAGU_TOTAL), 0), 0))*100), 2) TAX_COLLECTION, + COUNT(*) KUANTITAS + FROM + (SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU, + + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_SATKER) A"; + //echo $query; + //exit; + + return $this->db->query($query)->getRow(); + } + + function get_data_apbd_grafik($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + + return $this->db->query($query)->getResult(); + } + +} diff --git a/app/Models/Bendahara/MApbdes.php b/app/Models/Bendahara/MApbdes.php new file mode 100644 index 00000000..ba37f712 --- /dev/null +++ b/app/Models/Bendahara/MApbdes.php @@ -0,0 +1,162 @@ +<?php + +namespace App\Models\Bendahara; + +use CodeIgniter\Model; + +class MApbdes extends Model { + + function get_data_apbdes($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KECAMATAN, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_DESA, NAMA_WP, + PAGU_DANA_ADD, PAGU_DANA_DESA, PAGU_BAGI_HASIL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_TOTAL_PAGU, + + SUM(REAL_DANA_ADD) REAL_DANA_ADD, + SUM(REAL_DANA_DESA) REAL_DANA_DESA, + SUM(REAL_BAGI_HASIL) REAL_BAGI_HASIL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(ESTI_TOTAL_PAGU, 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(PAGU_TOTAL, 0), 0))*100), 2) TAX_COLLECTION + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KECAMATAN, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_DESA, NAMA_WP, + PAGU_DANA_ADD, PAGU_DANA_DESA, PAGU_BAGI_HASIL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, KECAMATAN, NAMA_DESA + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + + return $this->db->query($query)->getResult(); + } + + function get_data_apbdes_total($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT + SUM(PAGU_DANA_ADD) PAGU_DANA_ADD, + SUM(PAGU_DANA_DESA) PAGU_DANA_DESA, + SUM(PAGU_BAGI_HASIL) PAGU_BAGI_HASIL, + SUM(PAGU_LAINNYA) PAGU_LAINNYA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(REAL_DANA_ADD) REAL_DANA_ADD, + SUM(REAL_DANA_DESA) REAL_DANA_DESA, + SUM(REAL_BAGI_HASIL) REAL_BAGI_HASIL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(SUM(ESTI_TOTAL_PAGU), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(PAGU_TOTAL), 0), 0))*100), 2) TAX_COLLECTION, + COUNT(*) KUANTITAS + FROM + (SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KECAMATAN, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_DESA, NAMA_WP, + PAGU_DANA_ADD, PAGU_DANA_DESA, PAGU_BAGI_HASIL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_TOTAL_PAGU, + + SUM(REAL_DANA_ADD) REAL_DANA_ADD, + SUM(REAL_DANA_DESA) REAL_DANA_DESA, + SUM(REAL_BAGI_HASIL) REAL_BAGI_HASIL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KECAMATAN, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_DESA, NAMA_WP, + PAGU_DANA_ADD, PAGU_DANA_DESA, PAGU_BAGI_HASIL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, KECAMATAN, NAMA_DESA) A"; + + return $this->db->query($query)->getRow(); + } + + function get_data_apbdes_grafik($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + + return $this->db->query($query)->getResult(); + } + +} diff --git a/app/Models/Bendahara/MApbn.php b/app/Models/Bendahara/MApbn.php new file mode 100644 index 00000000..f296e04a --- /dev/null +++ b/app/Models/Bendahara/MApbn.php @@ -0,0 +1,210 @@ +<?php + +namespace App\Models\Bendahara; + +use CodeIgniter\Model; + +class MApbn extends Model { + + function get_data_apbn($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, KODE_SATKER, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU, + + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(ESTI_PPH21_PAGU, 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_PAGU, + (NVL(ESTI_PPH22_PAGU, 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_PAGU, + (NVL(ESTI_PPH23_PAGU, 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_PAGU, + (NVL(ESTI_PPH42_PAGU, 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_PAGU, + (NVL(ESTI_PPN_PAGU, 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_PAGU, + (NVL(ESTI_TOTAL_PAGU, 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_PPH21_REAL), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_REAL, + (NVL(SUM(ESTI_PPH22_REAL), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_REAL, + (NVL(SUM(ESTI_PPH23_REAL), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_REAL, + (NVL(SUM(ESTI_PPH42_REAL), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_REAL, + (NVL(SUM(ESTI_PPN_REAL), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_REAL, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(PAGU_TOTAL, 0), 0))*100), 2) TAX_COLLECTION + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, KODE_SATKER, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU,ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + //echo $query; + //exit; + + return $this->db->query($query)->getResult(); + } + + function get_data_apbn_total($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT + SUM(PAGU_PEGAWAI) PAGU_PEGAWAI, + SUM(PAGU_BARANG) PAGU_BARANG, + SUM(PAGU_MODAL) PAGU_MODAL, + SUM(PAGU_SOSIAL) PAGU_SOSIAL, + SUM(PAGU_LAINNYA) PAGU_LAINNYA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(ESTI_PPH21_PAGU) ESTI_PPH21_PAGU, + SUM(ESTI_PPH22_PAGU) ESTI_PPH22_PAGU, + SUM(ESTI_PPH23_PAGU) ESTI_PPH23_PAGU, + SUM(ESTI_PPH42_PAGU) ESTI_PPH42_PAGU, + SUM(ESTI_PPN_PAGU) ESTI_PPN_PAGU, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL, + (NVL(SUM(ESTI_PPH21_PAGU), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_PAGU, + (NVL(SUM(ESTI_PPH22_PAGU), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_PAGU, + (NVL(SUM(ESTI_PPH23_PAGU), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_PAGU, + (NVL(SUM(ESTI_PPH42_PAGU), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_PAGU, + (NVL(SUM(ESTI_PPN_PAGU), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_PAGU, + (NVL(SUM(ESTI_TOTAL_PAGU), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_PAGU, + (NVL(SUM(ESTI_PPH21_REAL), 0) - NVL(SUM(BAYAR_PPH21), 0)) TAXGAP_PPH21_REAL, + (NVL(SUM(ESTI_PPH22_REAL), 0) - NVL(SUM(BAYAR_PPH22), 0)) TAXGAP_PPH22_REAL, + (NVL(SUM(ESTI_PPH23_REAL), 0) - NVL(SUM(BAYAR_PPH23), 0)) TAXGAP_PPH23_REAL, + (NVL(SUM(ESTI_PPH42_REAL), 0) - NVL(SUM(BAYAR_PPH42), 0)) TAXGAP_PPH42_REAL, + (NVL(SUM(ESTI_PPN_REAL), 0) - NVL(SUM(BAYAR_PPN), 0)) TAXGAP_PPN_REAL, + (NVL(SUM(ESTI_TOTAL_REAL), 0) - NVL(SUM(BAYAR_TOTAL), 0)) TAXGAP_TOTAL_REAL, + ROUND(((NVL(SUM(BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(PAGU_TOTAL), 0), 0))*100), 2) TAX_COLLECTION, + COUNT(*) KUANTITAS + FROM + (SELECT + TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU, + + SUM(REAL_PEGAWAI) REAL_PEGAWAI, + SUM(REAL_BARANG) REAL_BARANG, + SUM(REAL_MODAL) REAL_MODAL, + SUM(REAL_SOSIAL) REAL_SOSIAL, + SUM(REAL_LAINNYA) REAL_LAINNYA, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_PPH21_REAL) ESTI_PPH21_REAL, + SUM(ESTI_PPH22_REAL) ESTI_PPH22_REAL, + SUM(ESTI_PPH23_REAL) ESTI_PPH23_REAL, + SUM(ESTI_PPH42_REAL) ESTI_PPH42_REAL, + SUM(ESTI_PPN_REAL) ESTI_PPN_REAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_PPH21) BAYAR_PPH21, + SUM(BAYAR_PPH22) BAYAR_PPH22, + SUM(BAYAR_PPH23) BAYAR_PPH23, + SUM(BAYAR_PPH42) BAYAR_PPH42, + SUM(BAYAR_PPN) BAYAR_PPN, + SUM(BAYAR_LAINNYA) BAYAR_LAINNYA, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY TAHUN, KD_KANWIL, NM_KANWIL, + KD_KPP, NM_KPP, KABKOTA, KD_SEKSI, NM_SEKSI, + NIP_AR, NM_AR, NPWP, NAMA_SATKER, + PAGU_PEGAWAI, PAGU_BARANG, PAGU_MODAL, PAGU_SOSIAL, PAGU_LAINNYA, PAGU_TOTAL, + ESTI_PPH21_PAGU, ESTI_PPH22_PAGU, ESTI_PPH23_PAGU, ESTI_PPH42_PAGU, ESTI_PPN_PAGU, ESTI_TOTAL_PAGU + ORDER BY KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_SATKER) A"; + //echo $query; + //exit; + + return $this->db->query($query)->getRow(); + } + + function get_data_apbn_grafik($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_seksi'] <> "") $cari_seksi = " AND KD_SEKSI = '".$param['cari_seksi']."' "; + else $cari_seksi = ""; + + if($param['cari_ar'] <> "") $cari_ar = " AND NIP_AR = '".$param['cari_ar']."' "; + else $cari_ar = ""; + + if($param['cari_kabkot'] <> "") $cari_kabkot = " AND KABKOTA = '".$param['cari_kabkot']."' "; + else $cari_kabkot = ""; + + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp $cari_seksi $cari_ar $cari_kabkot + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + + return $this->db->query($query)->getResult(); + } + +} diff --git a/app/Models/Bendahara/MBeranda.php b/app/Models/Bendahara/MBeranda.php new file mode 100644 index 00000000..24b958b9 --- /dev/null +++ b/app/Models/Bendahara/MBeranda.php @@ -0,0 +1,926 @@ +<?php + +namespace App\Models\Bendahara; + +use CodeIgniter\Model; + +class MBeranda extends Model { + + function get_data_beranda_index($param) { + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(APBN.BAYAR_TOTAL, 0) / NULLIF(NVL(APBN.PAGU_TOTAL, 0), 0))*100), 2) APBN_TAX_COLLECTION, + + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + (NVL(APBD.ESTI_TOTAL_PAGU, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_PAGU, + (NVL(APBD.ESTI_TOTAL_REAL, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(APBD.BAYAR_TOTAL, 0) / NULLIF(NVL(APBD.PAGU_TOTAL, 0), 0))*100), 2) APBD_TAX_COLLECTION, + + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + (NVL(APBDES.ESTI_TOTAL_PAGU, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_PAGU, + (NVL(APBDES.ESTI_TOTAL_REAL, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(APBDES.BAYAR_TOTAL, 0) / NULLIF(NVL(APBDES.PAGU_TOTAL, 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + (NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)) ALL_PAGU_TOTAL, + (NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0)) ALL_REAL_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) ALL_ESTI_TOTAL_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) ALL_ESTI_TOTAL_REAL, + (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) ALL_BAYAR_TOTAL, + ((NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_PAGU, + ((NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_REAL, + ROUND((((NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) / NULLIF((NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)), 0))*100), 2) ALL_TAX_COLLECTION + FROM + + (SELECT KD_KANWIL, NM_KANWIL FROM REF_MFWP_WILAYAH + GROUP BY KD_KANWIL, NM_KANWIL) D + + LEFT JOIN + + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL + + LEFT JOIN + + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBD + ON D.KD_KANWIL = APBD.KD_KANWIL + LEFT JOIN + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL + + ORDER BY D.KD_KANWIL + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + //echo $query; + //exit; + + return $this->db->query($query)->getResult(); + } + + function get_data_beranda_index_total($param) { + $query = "SELECT + SUM(APBN_PAGU_TOTAL) APBN_PAGU_TOTAL, + SUM(APBN_REAL_TOTAL) APBN_REAL_TOTAL, + SUM(APBN_ESTI_TOTAL_PAGU) APBN_ESTI_TOTAL_PAGU, + SUM(APBN_ESTI_TOTAL_REAL) APBN_ESTI_TOTAL_REAL, + SUM(APBN_BAYAR_TOTAL) APBN_BAYAR_TOTAL, + (NVL(SUM(APBN_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_PAGU, + (NVL(SUM(APBN_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(SUM(APBN_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBN_PAGU_TOTAL), 0), 0))*100), 2) APBN_TAX_COLLECTION, + + SUM(APBD_PAGU_TOTAL) APBD_PAGU_TOTAL, + SUM(APBD_REAL_TOTAL) APBD_REAL_TOTAL, + SUM(APBD_ESTI_TOTAL_PAGU) APBD_ESTI_TOTAL_PAGU, + SUM(APBD_ESTI_TOTAL_REAL) APBD_ESTI_TOTAL_REAL, + SUM(APBD_BAYAR_TOTAL) APBD_BAYAR_TOTAL, + (NVL(SUM(APBD_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_PAGU, + (NVL(SUM(APBD_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(SUM(APBD_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBD_PAGU_TOTAL), 0), 0))*100), 2) APBD_TAX_COLLECTION, + + SUM(APBDES_PAGU_TOTAL) APBDES_PAGU_TOTAL, + SUM(APBDES_REAL_TOTAL) APBDES_REAL_TOTAL, + SUM(APBDES_ESTI_TOTAL_PAGU) APBDES_ESTI_TOTAL_PAGU, + SUM(APBDES_ESTI_TOTAL_REAL) APBDES_ESTI_TOTAL_REAL, + SUM(APBDES_BAYAR_TOTAL) APBDES_BAYAR_TOTAL, + (NVL(SUM(APBDES_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_PAGU, + (NVL(SUM(APBDES_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(SUM(APBDES_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBDES_PAGU_TOTAL), 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + SUM(ALL_PAGU_TOTAL) ALL_PAGU_TOTAL, + SUM(ALL_REAL_TOTAL) ALL_REAL_TOTAL, + SUM(ALL_ESTI_TOTAL_PAGU) ALL_ESTI_TOTAL_PAGU, + SUM(ALL_ESTI_TOTAL_REAL) ALL_ESTI_TOTAL_REAL, + SUM(ALL_BAYAR_TOTAL) ALL_BAYAR_TOTAL, + (NVL(SUM(ALL_ESTI_TOTAL_PAGU), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_PAGU, + (NVL(SUM(ALL_ESTI_TOTAL_REAL), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_REAL, + ROUND(((NVL(SUM(ALL_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(ALL_PAGU_TOTAL), 0), 0))*100), 2) ALL_TAX_COLLECTION, + + COUNT(*) KUANTITAS + FROM + (SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0) ALL_PAGU_TOTAL, + NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0) ALL_REAL_TOTAL, + NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0) ALL_ESTI_TOTAL_PAGU, + NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0) ALL_ESTI_TOTAL_REAL, + NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0) ALL_BAYAR_TOTAL + FROM + + (SELECT KD_KANWIL, NM_KANWIL FROM REF_MFWP_WILAYAH + GROUP BY KD_KANWIL, NM_KANWIL) D + + LEFT JOIN + + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL + + LEFT JOIN + + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBD + + ON D.KD_KANWIL = APBD.KD_KANWIL + + LEFT JOIN + + (SELECT KD_KANWIL, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL)"; + //echo $query; + //exit; + + return $this->db->query($query)->getRow(); + } + + function get_data_beranda_index_grafik($param) { + if($param['cari_sumber_dana'] == "APBN") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBD") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBDes") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."') + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + + return $this->db->query($query)->getResult(); + } + + function get_data_beranda_kanwil($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(APBN.BAYAR_TOTAL, 0) / NULLIF(NVL(APBN.PAGU_TOTAL, 0), 0))*100), 2) APBN_TAX_COLLECTION, + + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + (NVL(APBD.ESTI_TOTAL_PAGU, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_PAGU, + (NVL(APBD.ESTI_TOTAL_REAL, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(APBD.BAYAR_TOTAL, 0) / NULLIF(NVL(APBD.PAGU_TOTAL, 0), 0))*100), 2) APBD_TAX_COLLECTION, + + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + (NVL(APBDES.ESTI_TOTAL_PAGU, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_PAGU, + (NVL(APBDES.ESTI_TOTAL_REAL, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(APBDES.BAYAR_TOTAL, 0) / NULLIF(NVL(APBDES.PAGU_TOTAL, 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + (NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)) ALL_PAGU_TOTAL, + (NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0)) ALL_REAL_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) ALL_ESTI_TOTAL_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) ALL_ESTI_TOTAL_REAL, + (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) ALL_BAYAR_TOTAL, + ((NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_PAGU, + ((NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_REAL, + ROUND((((NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) / NULLIF((NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)), 0))*100), 2) ALL_TAX_COLLECTION + FROM + + (SELECT KD_KANWIL, NM_KANWIL, KD_KPP, NM_KPP FROM REF_MFWP_WILAYAH + WHERE 1 = 1 $cari_kanwil + GROUP BY KD_KANWIL, NM_KANWIL, KD_KPP, NM_KPP) D + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL AND D.KD_KPP = APBN.KD_KPP + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBD + + ON D.KD_KANWIL = APBD.KD_KANWIL AND D.KD_KPP = APBD.KD_KPP + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL AND D.KD_KPP = APBDES.KD_KPP + + ORDER BY D.KD_KANWIL, D.KD_KPP + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + //echo $query; + //exit; + + return $this->db->query($query)->getResult(); + } + + function get_data_beranda_kanwil_total($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + $query = "SELECT + SUM(APBN_PAGU_TOTAL) APBN_PAGU_TOTAL, + SUM(APBN_REAL_TOTAL) APBN_REAL_TOTAL, + SUM(APBN_ESTI_TOTAL_PAGU) APBN_ESTI_TOTAL_PAGU, + SUM(APBN_ESTI_TOTAL_REAL) APBN_ESTI_TOTAL_REAL, + SUM(APBN_BAYAR_TOTAL) APBN_BAYAR_TOTAL, + (NVL(SUM(APBN_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_PAGU, + (NVL(SUM(APBN_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(SUM(APBN_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBN_PAGU_TOTAL), 0), 0))*100), 2) APBN_TAX_COLLECTION, + + SUM(APBD_PAGU_TOTAL) APBD_PAGU_TOTAL, + SUM(APBD_REAL_TOTAL) APBD_REAL_TOTAL, + SUM(APBD_ESTI_TOTAL_PAGU) APBD_ESTI_TOTAL_PAGU, + SUM(APBD_ESTI_TOTAL_REAL) APBD_ESTI_TOTAL_REAL, + SUM(APBD_BAYAR_TOTAL) APBD_BAYAR_TOTAL, + (NVL(SUM(APBD_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_PAGU, + (NVL(SUM(APBD_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(SUM(APBD_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBD_PAGU_TOTAL), 0), 0))*100), 2) APBD_TAX_COLLECTION, + + SUM(APBDES_PAGU_TOTAL) APBDES_PAGU_TOTAL, + SUM(APBDES_REAL_TOTAL) APBDES_REAL_TOTAL, + SUM(APBDES_ESTI_TOTAL_PAGU) APBDES_ESTI_TOTAL_PAGU, + SUM(APBDES_ESTI_TOTAL_REAL) APBDES_ESTI_TOTAL_REAL, + SUM(APBDES_BAYAR_TOTAL) APBDES_BAYAR_TOTAL, + (NVL(SUM(APBDES_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_PAGU, + (NVL(SUM(APBDES_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(SUM(APBDES_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBDES_PAGU_TOTAL), 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + SUM(ALL_PAGU_TOTAL) ALL_PAGU_TOTAL, + SUM(ALL_REAL_TOTAL) ALL_REAL_TOTAL, + SUM(ALL_ESTI_TOTAL_PAGU) ALL_ESTI_TOTAL_PAGU, + SUM(ALL_ESTI_TOTAL_REAL) ALL_ESTI_TOTAL_REAL, + SUM(ALL_BAYAR_TOTAL) ALL_BAYAR_TOTAL, + (NVL(SUM(ALL_ESTI_TOTAL_PAGU), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_PAGU, + (NVL(SUM(ALL_ESTI_TOTAL_REAL), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_REAL, + ROUND(((NVL(SUM(ALL_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(ALL_PAGU_TOTAL), 0), 0))*100), 2) ALL_TAX_COLLECTION, + + COUNT(*) KUANTITAS + FROM + (SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0) ALL_PAGU_TOTAL, + NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0) ALL_REAL_TOTAL, + NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0) ALL_ESTI_TOTAL_PAGU, + NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0) ALL_ESTI_TOTAL_REAL, + NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0) ALL_BAYAR_TOTAL + FROM + + (SELECT KD_KANWIL, NM_KANWIL, KD_KPP, NM_KPP FROM REF_MFWP_WILAYAH + WHERE 1 = 1 $cari_kanwil + GROUP BY KD_KANWIL, NM_KANWIL, KD_KPP, NM_KPP) D + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL AND D.KD_KPP = APBN.KD_KPP + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBD + + ON D.KD_KANWIL = APBD.KD_KANWIL AND D.KD_KPP = APBD.KD_KPP + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL AND D.KD_KPP = APBDES.KD_KPP)"; + //echo $query; + //exit; + + return $this->db->query($query)->getRow(); + } + + function get_data_beranda_kanwil_grafik($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_sumber_dana'] == "APBN") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBD") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBDes") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil) + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + + return $this->db->query($query)->getResult(); + } + + function get_data_beranda_kpp($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + $limit_bottom = ($param['cari_page'] * $param['cari_limit']) - $param['cari_limit']; + + $query = "SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) - NVL(APBN.BAYAR_TOTAL, 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(APBN.BAYAR_TOTAL, 0) / NULLIF(NVL(APBN.PAGU_TOTAL, 0), 0))*100), 2) APBN_TAX_COLLECTION, + + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + (NVL(APBD.ESTI_TOTAL_PAGU, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_PAGU, + (NVL(APBD.ESTI_TOTAL_REAL, 0) - NVL(APBD.BAYAR_TOTAL, 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(APBD.BAYAR_TOTAL, 0) / NULLIF(NVL(APBD.PAGU_TOTAL, 0), 0))*100), 2) APBD_TAX_COLLECTION, + + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + (NVL(APBDES.ESTI_TOTAL_PAGU, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_PAGU, + (NVL(APBDES.ESTI_TOTAL_REAL, 0) - NVL(APBDES.BAYAR_TOTAL, 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(APBDES.BAYAR_TOTAL, 0) / NULLIF(NVL(APBDES.PAGU_TOTAL, 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + (NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)) ALL_PAGU_TOTAL, + (NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0)) ALL_REAL_TOTAL, + (NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) ALL_ESTI_TOTAL_PAGU, + (NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) ALL_ESTI_TOTAL_REAL, + (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) ALL_BAYAR_TOTAL, + ((NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_PAGU, + ((NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0)) - (NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0))) ALL_TAXGAP_REAL, + ROUND((((NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0)) / NULLIF((NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0)), 0))*100), 2) ALL_TAX_COLLECTION + FROM + + (SELECT * FROM REF_MFWP_WILAYAH + WHERE 1 = 1 $cari_kanwil $cari_kpp) D + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL AND D.KD_KPP = APBN.KD_KPP AND D.KABKOTA = APBN.KABKOTA + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBD + + ON D.KD_KANWIL = APBD.KD_KANWIL AND D.KD_KPP = APBD.KD_KPP AND D.KABKOTA = APBD.KABKOTA + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL AND D.KD_KPP = APBDES.KD_KPP AND D.KABKOTA = APBDES.KABKOTA + + ORDER BY D.KD_KANWIL, D.KD_KPP, D.KABKOTA + OFFSET $limit_bottom ROWS FETCH NEXT ".$param['cari_limit']." ROWS ONLY"; + //echo $query; + //exit; + + return $this->db->query($query)->getResult(); + } + + function get_data_beranda_kpp_total($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + $query = "SELECT + SUM(APBN_PAGU_TOTAL) APBN_PAGU_TOTAL, + SUM(APBN_REAL_TOTAL) APBN_REAL_TOTAL, + SUM(APBN_ESTI_TOTAL_PAGU) APBN_ESTI_TOTAL_PAGU, + SUM(APBN_ESTI_TOTAL_REAL) APBN_ESTI_TOTAL_REAL, + SUM(APBN_BAYAR_TOTAL) APBN_BAYAR_TOTAL, + (NVL(SUM(APBN_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_PAGU, + (NVL(SUM(APBN_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBN_BAYAR_TOTAL), 0)) APBN_TAXGAP_REAL, + ROUND(((NVL(SUM(APBN_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBN_PAGU_TOTAL), 0), 0))*100), 2) APBN_TAX_COLLECTION, + + SUM(APBD_PAGU_TOTAL) APBD_PAGU_TOTAL, + SUM(APBD_REAL_TOTAL) APBD_REAL_TOTAL, + SUM(APBD_ESTI_TOTAL_PAGU) APBD_ESTI_TOTAL_PAGU, + SUM(APBD_ESTI_TOTAL_REAL) APBD_ESTI_TOTAL_REAL, + SUM(APBD_BAYAR_TOTAL) APBD_BAYAR_TOTAL, + (NVL(SUM(APBD_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_PAGU, + (NVL(SUM(APBD_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBD_BAYAR_TOTAL), 0)) APBD_TAXGAP_REAL, + ROUND(((NVL(SUM(APBD_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBD_PAGU_TOTAL), 0), 0))*100), 2) APBD_TAX_COLLECTION, + + SUM(APBDES_PAGU_TOTAL) APBDES_PAGU_TOTAL, + SUM(APBDES_REAL_TOTAL) APBDES_REAL_TOTAL, + SUM(APBDES_ESTI_TOTAL_PAGU) APBDES_ESTI_TOTAL_PAGU, + SUM(APBDES_ESTI_TOTAL_REAL) APBDES_ESTI_TOTAL_REAL, + SUM(APBDES_BAYAR_TOTAL) APBDES_BAYAR_TOTAL, + (NVL(SUM(APBDES_ESTI_TOTAL_PAGU), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_PAGU, + (NVL(SUM(APBDES_ESTI_TOTAL_REAL), 0) - NVL(SUM(APBDES_BAYAR_TOTAL), 0)) APBDES_TAXGAP_REAL, + ROUND(((NVL(SUM(APBDES_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(APBDES_PAGU_TOTAL), 0), 0))*100), 2) APBDES_TAX_COLLECTION, + + SUM(ALL_PAGU_TOTAL) ALL_PAGU_TOTAL, + SUM(ALL_REAL_TOTAL) ALL_REAL_TOTAL, + SUM(ALL_ESTI_TOTAL_PAGU) ALL_ESTI_TOTAL_PAGU, + SUM(ALL_ESTI_TOTAL_REAL) ALL_ESTI_TOTAL_REAL, + SUM(ALL_BAYAR_TOTAL) ALL_BAYAR_TOTAL, + (NVL(SUM(ALL_ESTI_TOTAL_PAGU), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_PAGU, + (NVL(SUM(ALL_ESTI_TOTAL_REAL), 0) - NVL(SUM(ALL_BAYAR_TOTAL), 0)) ALL_TAXGAP_REAL, + ROUND(((NVL(SUM(ALL_BAYAR_TOTAL), 0) / NULLIF(NVL(SUM(ALL_PAGU_TOTAL), 0), 0))*100), 2) ALL_TAX_COLLECTION, + + COUNT(*) KUANTITAS + FROM + (SELECT D.*, + APBN.PAGU_TOTAL APBN_PAGU_TOTAL, + APBN.REAL_TOTAL APBN_REAL_TOTAL, + APBN.ESTI_TOTAL_PAGU APBN_ESTI_TOTAL_PAGU, + APBN.ESTI_TOTAL_REAL APBN_ESTI_TOTAL_REAL, + APBN.BAYAR_TOTAL APBN_BAYAR_TOTAL, + APBD.PAGU_TOTAL APBD_PAGU_TOTAL, + APBD.REAL_TOTAL APBD_REAL_TOTAL, + APBD.ESTI_TOTAL_PAGU APBD_ESTI_TOTAL_PAGU, + APBD.ESTI_TOTAL_REAL APBD_ESTI_TOTAL_REAL, + APBD.BAYAR_TOTAL APBD_BAYAR_TOTAL, + APBDES.PAGU_TOTAL APBDES_PAGU_TOTAL, + APBDES.REAL_TOTAL APBDES_REAL_TOTAL, + APBDES.ESTI_TOTAL_PAGU APBDES_ESTI_TOTAL_PAGU, + APBDES.ESTI_TOTAL_REAL APBDES_ESTI_TOTAL_REAL, + APBDES.BAYAR_TOTAL APBDES_BAYAR_TOTAL, + NVL(APBN.PAGU_TOTAL, 0) + NVL(APBD.PAGU_TOTAL, 0) + NVL(APBDES.PAGU_TOTAL, 0) ALL_PAGU_TOTAL, + NVL(APBN.REAL_TOTAL, 0) + NVL(APBD.REAL_TOTAL, 0) + NVL(APBDES.REAL_TOTAL, 0) ALL_REAL_TOTAL, + NVL(APBN.ESTI_TOTAL_PAGU, 0) + NVL(APBD.ESTI_TOTAL_PAGU, 0) + NVL(APBDES.ESTI_TOTAL_PAGU, 0) ALL_ESTI_TOTAL_PAGU, + NVL(APBN.ESTI_TOTAL_REAL, 0) + NVL(APBD.ESTI_TOTAL_REAL, 0) + NVL(APBDES.ESTI_TOTAL_REAL, 0) ALL_ESTI_TOTAL_REAL, + NVL(APBN.BAYAR_TOTAL, 0) + NVL(APBD.BAYAR_TOTAL, 0) + NVL(APBDES.BAYAR_TOTAL, 0) ALL_BAYAR_TOTAL + FROM + + (SELECT * FROM REF_MFWP_WILAYAH + WHERE 1 = 1 $cari_kanwil $cari_kpp) D + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBN + + ON D.KD_KANWIL = APBN.KD_KANWIL AND D.KD_KPP = APBN.KD_KPP AND D.KABKOTA = APBN.KABKOTA + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, KODE_SATKER, NAMA_SATKER, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBD + + ON D.KD_KANWIL = APBD.KD_KANWIL AND D.KD_KPP = APBD.KD_KPP AND D.KABKOTA = APBD.KABKOTA + + LEFT JOIN + + (SELECT KD_KANWIL, KD_KPP, KABKOTA, + SUM(PAGU_TOTAL) PAGU_TOTAL, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_PAGU) ESTI_TOTAL_PAGU, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT + TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU, + SUM(REAL_TOTAL) REAL_TOTAL, + SUM(ESTI_TOTAL_REAL) ESTI_TOTAL_REAL, + SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' + $cari_kanwil $cari_kpp + GROUP BY TAHUN, KD_KANWIL, KD_KPP, KABKOTA, NPWP, NAMA_DESA, PAGU_TOTAL, ESTI_TOTAL_PAGU) + GROUP BY KD_KANWIL, KD_KPP, KABKOTA) APBDES + + ON D.KD_KANWIL = APBDES.KD_KANWIL AND D.KD_KPP = APBDES.KD_KPP AND D.KABKOTA = APBDES.KABKOTA)"; + //echo $query; + //exit; + + return $this->db->query($query)->getRow(); + } + + function get_data_beranda_kpp_grafik($param) { + if($param['cari_kanwil'] <> "") $cari_kanwil = " AND KD_KANWIL = '".$param['cari_kanwil']."' "; + else $cari_kanwil = ""; + + if($param['cari_kpp'] <> "") $cari_kpp = " AND KD_KPP = '".$param['cari_kpp']."' "; + else $cari_kpp = ""; + + if($param['cari_sumber_dana'] == "APBN") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBD") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else if($param['cari_sumber_dana'] == "APBDes") { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + else { + $query = "SELECT KD_BULAN, NM_BULAN, + SUM(REAL_TOTAL) REAL_TOTAL, SUM(BAYAR_TOTAL) BAYAR_TOTAL + FROM + (SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBN_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBD_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp + UNION + SELECT KD_BULAN, NM_BULAN, REAL_TOTAL, BAYAR_TOTAL FROM APBDES_REKAP + WHERE TAHUN = '".$param['cari_tahun']."' AND KD_BULAN >= '".$param['cari_bulan_awal']."' AND KD_BULAN <= '".$param['cari_bulan_akhir']."' $cari_kanwil $cari_kpp) + GROUP BY KD_BULAN, NM_BULAN + ORDER BY KD_BULAN"; + } + + return $this->db->query($query)->getResult(); + } + +} diff --git a/app/Models/Bendahara/MGeneral.php b/app/Models/Bendahara/MGeneral.php new file mode 100644 index 00000000..5cf6b2ee --- /dev/null +++ b/app/Models/Bendahara/MGeneral.php @@ -0,0 +1,69 @@ +<?php + +namespace App\Models\Bendahara; + +use CodeIgniter\Model; + +class MGeneral extends Model { + + function get_ref_tahun() { + $builder = $this->db->table('GENAPP.REF_TAHUN'); + $builder->select('*'); + $builder->orderBy('TAHUN', 'DESC'); + + return $builder->get()->getResult(); + } + + function get_ref_bulan() { + $builder = $this->db->table('GENAPP.BULAN'); + $builder->select('*'); + + return $builder->get()->getResult(); + } + + function get_ref_kanwil() { + $builder = $this->db->table('GENAPP.REF_KANWIL'); + $builder->select('*'); + $builder->orderBy('KODE', 'ASC'); + + return $builder->get()->getResult(); + } + + function get_ref_kpp($param) { + $builder = $this->db->table('GENAPP.REF_KPP'); + $builder->select('*'); + $builder->where('KD_KANWIL', $param["kanwil"]); + $builder->orderBy('KD_KPP', 'ASC'); + + return $builder->get()->getResult(); + } + + function get_ref_seksi() { + $builder = $this->db->table('GENAPP.REF_SEKSI'); + $builder->select('*'); + $builder->orderBy('KODESIE', 'ASC'); + + return $builder->get()->getResult(); + } + + function get_ref_ar($param) { + $param = ['KPPADM' => $param["kpp"], 'KODESIE' => $param["seksi"]]; + $builder = $this->db->table('GENAPP.REF_AR'); + $builder->select('*'); + $builder->where($param); + $builder->orderBy('NAMA', 'ASC'); + + return $builder->get()->getResult(); + } + + function get_ref_kabkot($param) { + $builder = $this->db->table('GENAPP.DIM_WIL'); + $builder->select('NM_DATI2'); + $builder->where('KPPADM', $param["kpp"]); + $builder->orderBy('NM_DATI2', 'ASC'); + $builder->distinct(); + + return $builder->get()->getResult(); + } + +} diff --git a/app/Models/Mpemby.php b/app/Models/Mpemby.php index 1d12416d..bb35c673 100644 --- a/app/Models/Mpemby.php +++ b/app/Models/Mpemby.php @@ -114,6 +114,8 @@ class Mpemby extends Model return $query; } + + function sofNas($param) { $tahun = $param['tahun']; @@ -619,4 +621,67 @@ class Mpemby extends Model return $query; } + + function wpsk_paycompNas($param) + { + $tahun = $param['tahun']; + $bln = $param['bulan']; + $kwl = $param['kwl']; + $kpp = $param['kpp']; + $source = $param['src']; + if ($kwl == 'SEMUA') { + $cekkwl = ""; + }else{ + $cekkwl = "AND KWLADM = '".$kwl."'"; + } + + if ($kpp == 'SEMUA'){ + $cekkpp = ""; + }else{ + $cekkpp = "AND KPPADM = '".$kpp."'"; + } + if($source == '1'){ + $src = "WPS"; + }else{ + $src = "WPK"; + } + $query = $this->db->query("SELECT JMLBLN JMLBULAN, COUNT(1) JMLWP FROM( + SELECT NPWP,COUNT(1) JMLBLN + FROM DASHBOARD_WP_BLN + WHERE TAHUN = '".$tahun."' AND BULAN <= '".$bln."' AND FLAG_WPS_WPK = '".$src."' $cekkwl $cekkpp + GROUP BY NPWP) + WHERE JMLBLN <= TO_NUMBER('".$bln."') + GROUP BY JMLBLN ORDER BY JMLBLN ASC"); + return $query; + } + + function wpsk_sofNas($param) + { + $tahun = $param['tahun']; + $bln = $param['bulan']; + $kwl = $param['kwl']; + $kpp = $param['kpp']; + $source = $param['src']; + if ($kwl == 'SEMUA') { + $cekkwl = ""; + }else{ + $cekkwl = "AND KWLADM = '".$kwl."'"; + } + + if ($kpp == 'SEMUA'){ + $cekkpp = ""; + }else{ + $cekkpp = "AND KPPADM = '".$kpp."'"; + } + if($source == '1'){ + $src = "WPS"; + }else{ + $src = "WPK"; + } + $query = $this->db->query("SELECT NPWP,SUM(TOTAL)TOTAL FROM DASHBOARD_WP_BLN + WHERE TAHUN = '" . $tahun . "' AND BULAN <= '".$bln."' + AND FLAG_WPS_WPK = '".$src."' $cekkwl $cekkpp + GROUP BY NPWP"); + return $query; + } } diff --git a/app/Views/apbd/index.php b/app/Views/apbd/index.php new file mode 100644 index 00000000..851a1f27 --- /dev/null +++ b/app/Views/apbd/index.php @@ -0,0 +1,934 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Rincian Belanja Pemerintah APBD</h3></div> + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('bendahara/apbd') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + </div> + + <?php + $cari_kanwil_disabled = 'false'; + $cari_kpp_disabled = 'false'; + + if (session('tpkantor') == 'KPP') { + $cari_kanwil_disabled = 'true'; + $cari_kpp_disabled = 'true'; + } + else if (session('tpkantor') == 'Kanwil') { + $cari_kanwil_disabled = 'true'; + } + ?> + + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <label for="cari_kanwil">Kanwil</label> + <select class="form-control" id="cari_kanwil" name="cari_kanwil" data-disabled="<?php echo $cari_kanwil_disabled ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_kanwil as $row) { + if ($row->KODE == $cari_kanwil) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE ."' ".$isSelected.">".$row->NAMA."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kpp">KPP</label> + <select class="form-control" id="cari_kpp" name="cari_kpp" data-temp="<?php echo $cari_kpp ?>" data-disabled="<?php echo $cari_kpp_disabled ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_seksi">Seksi</label> + <select class="form-control" id="cari_seksi" name="cari_seksi" data-temp="<?php echo $cari_seksi ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_seksi as $row) { + echo "<option value='".$row->KODESIE ."'>".$row->NAMA_UNIT_ES4."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_ar">Account Representative</label> + <select class="form-control" id="cari_ar" name="cari_ar" data-temp="<?php echo $cari_ar ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kabkot">Kabupaten/Kota</label> + <select class="form-control" id="cari_kabkot" name="cari_kabkot" data-temp="<?php echo $cari_kabkot ?>"> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($data_apbd_total->PAGU_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($data_apbd_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($data_apbd_total->PAGU_TOTAL-$data_apbd_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $data_apbd_total->PAGU_TOTAL > 0 ? number_format(($data_apbd_total->REAL_TOTAL/$data_apbd_total->PAGU_TOTAL)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Estimasi Pajak (Total Pagu)</h6> + <h2><?php echo number_format($data_apbd_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($data_apbd_total->BAYAR_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($data_apbd_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $data_apbd_total->TAX_COLLECTION), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_apbd_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No.</th> + <th rowspan="2" colspan="1">Kanwil</th> + <th rowspan="2" colspan="1">KPP</th> + <th rowspan="2" colspan="1">Kabupaten/Kota</th> + <th rowspan="2" colspan="1">Seksi</th> + <th rowspan="2" colspan="1">AR</th> + <th rowspan="1" colspan="3">Satuan Kerja</th> + <th rowspan="1" colspan="6">Total Pagu</th> + <th rowspan="1" colspan="6">Realisasi Pagu</th> + <th rowspan="1" colspan="6">Estimasi Pajak (Total Pagu)</th> + <th rowspan="1" colspan="6">Estimasi Pajak (Realisasi Pagu)</th> + <th rowspan="1" colspan="7">Realisasi Pajak</th> + <th rowspan="1" colspan="6">Tax Gap (Total Pagu)</th> + <th rowspan="1" colspan="6">Tax Gap (Realisasi Pagu)</th> + <th rowspan="2" colspan="1">Tax Collection</th> + </tr> + <tr role="row"> + <th>NPWP</th> + <th>Nama</th> + <th>Kode</th> + <th>Pegawai</th> + <th>Barang/Jasa</th> + <th>Modal</th> + <th>Sosial</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>Pegawai</th> + <th>Barang/Jasa</th> + <th>Modal</th> + <th>Sosial</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + <th class="thead_sub">3</th> + <th class="thead_sub">4</th> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <th class="thead_sub">11</th> + <th class="thead_sub">12</th> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <th class="thead_sub">19</th> + <th class="thead_sub">20</th> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <th class="thead_sub">27</th> + <th class="thead_sub">28</th> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + <th class="thead_sub">32</th> + <th class="thead_sub">33</th> + <th class="thead_sub">34</th> + <th class="thead_sub">35</th> + <th class="thead_sub">36</th> + <th class="thead_sub">37</th> + <th class="thead_sub">38</th> + <th class="thead_sub">39</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">41</th> + <th class="thead_sub">42</th> + <th class="thead_sub">43</th> + <th class="thead_sub">44</th> + <th class="thead_sub">45</th> + <th class="thead_sub">46</th> + <th class="thead_sub">47</th> + <th class="thead_sub">48</th> + <th class="thead_sub">49</th> + <th class="thead_sub">50</th> + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_apbd as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><?php echo $row->NM_KANWIL; ?></td> + <td><?php echo $row->NM_KPP; ?></td> + <td><?php echo ucwords(strtolower($row->KABKOTA)); ?></td> + <td><?php echo $row->NM_SEKSI; ?></td> + <td><?php echo ucwords(strtolower($row->NM_AR)); ?></td> + <td><?php echo $row->NPWP; ?></td> + <td><?php echo ucwords(strtolower($row->NAMA_SATKER)); ?></td> + <td><?php echo $row->KODE_SATKER; ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_PEGAWAI, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_BARANG, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_MODAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_SOSIAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_PEGAWAI, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_BARANG, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_MODAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_SOSIAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH21_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH22_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH23_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH42_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPN_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH21_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH22_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH23_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH42_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPN_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH21, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH22, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH23, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH42, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPN, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH21_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH22_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH23_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH42_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPN_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH21_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH22_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH23_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH42_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPN_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->TAX_COLLECTION), 2, ",", ".") ?>%</td> + </tr> + <?php + } + ?> + </tbody> + <thead class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_PEGAWAI, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_BARANG, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_MODAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_SOSIAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_PEGAWAI, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_BARANG, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_MODAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_SOSIAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH21_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH22_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH23_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH42_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPN_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH21_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH22_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH23_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPH42_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_PPN_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_PPH21, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_PPH22, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_PPH23, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_PPH42, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_PPN, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH21_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH22_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH23_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH42_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPN_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH21_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH22_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH23_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPH42_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_PPN_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbd_total->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_apbd_total->TAX_COLLECTION), 2, ",", ".") ?>%</th> + </tr> + </thead> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + $('#cari_kanwil').change(function() { + var cari_kanwil = $('#cari_kanwil').val(); + + if(cari_kanwil == '') $('#cari_kpp').attr('disabled', true); + else { + if($("#cari_kpp").data('disabled') == true) $('#cari_kpp').attr('disabled', true); + else $('#cari_kpp').attr('disabled', false); + } + + $('#cari_kpp').empty().append("<option value=''>Semua</option>").val(''); + + if (cari_kanwil != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kpp'); ?>", + method: "GET", + data: { + kanwil: cari_kanwil + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kpp').append('<option value="' + value.KD_KPP + '">' + value.NM_KANTOR + '</option>'); + }); + + if($("#cari_kpp").data('temp') != "") { + $('#cari_kpp').val($("#cari_kpp").data('temp')).change(); + $("#cari_kpp").data('temp', ''); + } + else $("#cari_kpp").change(); + } + }); + } + else $("#cari_kpp").change(); + }); + + $('#cari_kpp').change(function() { + var cari_kpp = $('#cari_kpp').val(); + + if(cari_kpp == '') { + $('#cari_seksi').attr('disabled', true); + $('#cari_kabkot').attr('disabled', true); + } + else { + $('#cari_seksi').attr('disabled', false); + $('#cari_kabkot').attr('disabled', false); + } + + if($("#cari_seksi").data('temp') != "") { + $('#cari_seksi').val($("#cari_seksi").data('temp')).change(); + $("#cari_seksi").data('temp', ''); + } + else $('#cari_seksi').val('').change(); + + $('#cari_kabkot').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kabkot'); ?>", + method: "GET", + data: { + kpp: cari_kpp + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kabkot').append('<option value="' + value.NM_DATI2 + '">' + value.NM_DATI2.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_kabkot").data('temp') != "") { + $('#cari_kabkot').val($("#cari_kabkot").data('temp')).change(); + $("#cari_kabkot").data('temp', ''); + } + } + }); + } + }); + + $('#cari_seksi').change(function() { + var cari_kpp = $('#cari_kpp').val(); + var cari_seksi = $('#cari_seksi').val(); + + if(cari_seksi == '') $('#cari_ar').attr('disabled', true); + else $('#cari_ar').attr('disabled', false); + + $('#cari_ar').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '' && cari_seksi != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_ar'); ?>", + method: "GET", + data: { + kpp: cari_kpp, + seksi: cari_seksi + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_ar').append('<option value="' + value.NIP + '">' + value.NAMA.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_ar").data('temp') != "") { + $('#cari_ar').val($("#cari_ar").data('temp')).change(); + $("#cari_ar").data('temp', ''); + } + } + }); + } + }); + + if($("#cari_kanwil").data('disabled') == true) $('#cari_kanwil').attr('disabled', true); + else $('#cari_kanwil').attr('disabled', false); + + $('#cari_kanwil').change(); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('bendahara/apbd/data_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/apbdes/index.php b/app/Views/apbdes/index.php new file mode 100644 index 00000000..0fa16530 --- /dev/null +++ b/app/Views/apbdes/index.php @@ -0,0 +1,843 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Rincian Belanja Pemerintah APBDes</h3></div> + + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('bendahara/apbdes') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + </div> + + <?php + $cari_kanwil_disabled = 'false'; + $cari_kpp_disabled = 'false'; + + if (session('tpkantor') == 'KPP') { + $cari_kanwil_disabled = 'true'; + $cari_kpp_disabled = 'true'; + } + else if (session('tpkantor') == 'Kanwil') { + $cari_kanwil_disabled = 'true'; + } + ?> + + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <label for="cari_kanwil">Kanwil</label> + <select class="form-control" id="cari_kanwil" name="cari_kanwil" data-disabled="<?php echo $cari_kanwil_disabled ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_kanwil as $row) { + if ($row->KODE == $cari_kanwil) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE ."' ".$isSelected.">".$row->NAMA."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kpp">KPP</label> + <select class="form-control" id="cari_kpp" name="cari_kpp" data-temp="<?php echo $cari_kpp ?>" data-disabled="<?php echo $cari_kpp_disabled ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_seksi">Seksi</label> + <select class="form-control" id="cari_seksi" name="cari_seksi" data-temp="<?php echo $cari_seksi ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_seksi as $row) { + echo "<option value='".$row->KODESIE ."'>".$row->NAMA_UNIT_ES4."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_ar">Account Representative</label> + <select class="form-control" id="cari_ar" name="cari_ar" data-temp="<?php echo $cari_ar ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kabkot">Kabupaten/Kota</label> + <select class="form-control" id="cari_kabkot" name="cari_kabkot" data-temp="<?php echo $cari_kabkot ?>"> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($data_apbdes_total->PAGU_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($data_apbdes_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($data_apbdes_total->PAGU_TOTAL-$data_apbdes_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $data_apbdes_total->PAGU_TOTAL > 0 ? number_format(($data_apbdes_total->REAL_TOTAL/$data_apbdes_total->PAGU_TOTAL)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Estimasi Pajak (Total Pagu)</h6> + <h2><?php echo number_format($data_apbdes_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($data_apbdes_total->BAYAR_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($data_apbdes_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $data_apbdes_total->TAX_COLLECTION), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_apbdes_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No</th> + <th rowspan="2" colspan="1">Kanwil</th> + <th rowspan="2" colspan="1">KPP</th> + <th rowspan="2" colspan="1">Kabupaten/Kota</th> + <th rowspan="2" colspan="1">Kecamatan</th> + <th rowspan="2" colspan="1">Seksi</th> + <th rowspan="2" colspan="1">AR</th> + <th rowspan="1" colspan="2">Desa</th> + <th rowspan="1" colspan="5">Total Pagu</th> + <th rowspan="1" colspan="5">Realisasi Pagu</th> + <th rowspan="2" colspan="1">Estimasi Pajak (Total Pagu)</th> + <th rowspan="2" colspan="1">Estimasi Pajak (Realisasi Pagu)</th> + <th rowspan="1" colspan="7">Realisasi Pajak</th> + <th rowspan="2" colspan="1">Tax Gap (Total Pagu)</th> + <th rowspan="2" colspan="1">Tax Gap (Realisasi Pagu)</th> + <th rowspan="2" colspan="1">Tax Collection</th> + </tr> + <tr role="row"> + <th>NPWP</th> + <th>Nama</th> + <th>Dana ADD</th> + <th>Dana Desa</th> + <th>Bagi Hasil</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>Dana ADD</th> + <th>Dana Desa</th> + <th>Bagi Hasil</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Lainnya</th> + <th>Jumlah</th> + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + <th class="thead_sub">3</th> + <th class="thead_sub">4</th> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <th class="thead_sub">11</th> + <th class="thead_sub">12</th> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <th class="thead_sub">19</th> + <th class="thead_sub">20</th> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <th class="thead_sub">27</th> + <th class="thead_sub">28</th> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_apbdes as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><?php echo $row->NM_KANWIL; ?></td> + <td><?php echo $row->NM_KPP; ?></td> + <td><?php echo ucwords(strtolower($row->KABKOTA)); ?></td> + <td><?php echo ucwords(strtolower($row->KECAMATAN)); ?></td> + <td><?php echo $row->NM_SEKSI; ?></td> + <td><?php echo ucwords(strtolower($row->NM_AR)); ?></td> + <td><?php echo $row->NPWP; ?></td> + <td><?php echo ucwords(strtolower($row->NAMA_DESA)); ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_DANA_ADD, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_DANA_DESA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_BAGI_HASIL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_DANA_ADD, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_DANA_DESA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_BAGI_HASIL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH21, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH22, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH23, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH42, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPN, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->TAX_COLLECTION), 2, ",", ".") ?>%</td> + </tr> + <?php + } + ?> + </tbody> + <tfoot class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->PAGU_DANA_ADD, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->PAGU_DANA_DESA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->PAGU_BAGI_HASIL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->PAGU_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->REAL_DANA_ADD, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->REAL_DANA_DESA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->REAL_BAGI_HASIL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->REAL_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_PPH21, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_PPH22, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_PPH23, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_PPH42, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_PPN, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbdes_total->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_apbdes_total->TAX_COLLECTION), 2, ",", ".") ?>%</th> + </tr> + </tfoot> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + $('#cari_kanwil').change(function() { + var cari_kanwil = $('#cari_kanwil').val(); + + if(cari_kanwil == '') $('#cari_kpp').attr('disabled', true); + else { + if($("#cari_kpp").data('disabled') == true) $('#cari_kpp').attr('disabled', true); + else $('#cari_kpp').attr('disabled', false); + } + + $('#cari_kpp').empty().append("<option value=''>Semua</option>").val(''); + + if (cari_kanwil != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kpp'); ?>", + method: "GET", + data: { + kanwil: cari_kanwil + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kpp').append('<option value="' + value.KD_KPP + '">' + value.NM_KANTOR + '</option>'); + }); + + if($("#cari_kpp").data('temp') != "") { + $('#cari_kpp').val($("#cari_kpp").data('temp')).change(); + $("#cari_kpp").data('temp', ''); + } + else $("#cari_kpp").change(); + } + }); + } + else $("#cari_kpp").change(); + }); + + $('#cari_kpp').change(function() { + var cari_kpp = $('#cari_kpp').val(); + + if(cari_kpp == '') { + $('#cari_seksi').attr('disabled', true); + $('#cari_kabkot').attr('disabled', true); + } + else { + $('#cari_seksi').attr('disabled', false); + $('#cari_kabkot').attr('disabled', false); + } + + if($("#cari_seksi").data('temp') != "") { + $('#cari_seksi').val($("#cari_seksi").data('temp')).change(); + $("#cari_seksi").data('temp', ''); + } + else $('#cari_seksi').val('').change(); + + $('#cari_kabkot').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kabkot'); ?>", + method: "GET", + data: { + kpp: cari_kpp + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kabkot').append('<option value="' + value.NM_DATI2 + '">' + value.NM_DATI2.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_kabkot").data('temp') != "") { + $('#cari_kabkot').val($("#cari_kabkot").data('temp')).change(); + $("#cari_kabkot").data('temp', ''); + } + } + }); + } + }); + + $('#cari_seksi').change(function() { + var cari_kpp = $('#cari_kpp').val(); + var cari_seksi = $('#cari_seksi').val(); + + if(cari_seksi == '') $('#cari_ar').attr('disabled', true); + else $('#cari_ar').attr('disabled', false); + + $('#cari_ar').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '' && cari_seksi != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_ar'); ?>", + method: "GET", + data: { + kpp: cari_kpp, + seksi: cari_seksi + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_ar').append('<option value="' + value.NIP + '">' + value.NAMA.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_ar").data('temp') != "") { + $('#cari_ar').val($("#cari_ar").data('temp')).change(); + $("#cari_ar").data('temp', ''); + } + } + }); + } + }); + + if($("#cari_kanwil").data('disabled') == true) $('#cari_kanwil').attr('disabled', true); + else $('#cari_kanwil').attr('disabled', false); + + $('#cari_kanwil').change(); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('bendahara/apbdes/data_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/apbn/index.php b/app/Views/apbn/index.php new file mode 100644 index 00000000..b06a00e8 --- /dev/null +++ b/app/Views/apbn/index.php @@ -0,0 +1,938 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Rincian Belanja Pemerintah APBN</h3></div> + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('bendahara/apbn') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + </div> + + <?php + $cari_kanwil_disabled = 'false'; + $cari_kpp_disabled = 'false'; + + if (session('tpkantor') == 'KPP') { + $cari_kanwil_disabled = 'true'; + $cari_kpp_disabled = 'true'; + } + else if (session('tpkantor') == 'Kanwil') { + $cari_kanwil_disabled = 'true'; + } + ?> + + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <label for="cari_kanwil">Kanwil</label> + <select class="form-control" id="cari_kanwil" name="cari_kanwil" data-disabled="<?php echo $cari_kanwil_disabled ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_kanwil as $row) { + if ($row->KODE == $cari_kanwil) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE ."' ".$isSelected.">".$row->NAMA."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kpp">KPP</label> + <select class="form-control" id="cari_kpp" name="cari_kpp" data-temp="<?php echo $cari_kpp ?>" data-disabled="<?php echo $cari_kpp_disabled ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_seksi">Seksi</label> + <select class="form-control" id="cari_seksi" name="cari_seksi" data-temp="<?php echo $cari_seksi ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_seksi as $row) { + echo "<option value='".$row->KODESIE ."'>".$row->NAMA_UNIT_ES4."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_ar">Account Representative</label> + <select class="form-control" id="cari_ar" name="cari_ar" data-temp="<?php echo $cari_ar ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kabkot">Kabupaten/Kota</label> + <select class="form-control" id="cari_kabkot" name="cari_kabkot" data-temp="<?php echo $cari_kabkot ?>"> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($data_apbn_total->PAGU_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($data_apbn_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($data_apbn_total->PAGU_TOTAL-$data_apbn_total->REAL_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $data_apbn_total->PAGU_TOTAL > 0 ? number_format(($data_apbn_total->REAL_TOTAL/$data_apbn_total->PAGU_TOTAL)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>ESTI Pajak (Total Pagu)</h6> + <h2><?php echo number_format($data_apbn_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($data_apbn_total->BAYAR_TOTAL, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($data_apbn_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $data_apbn_total->TAX_COLLECTION), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_apbn_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No.</th> + <th rowspan="2" colspan="1">Kanwil</th> + <th rowspan="2" colspan="1">KPP</th> + <th rowspan="2" colspan="1">Kabupaten/Kota</th> + <th rowspan="2" colspan="1">Seksi</th> + <th rowspan="2" colspan="1">AR</th> + <th rowspan="1" colspan="3">Satuan Kerja</th> + <th rowspan="1" colspan="6">Total Pagu</th> + <th rowspan="1" colspan="6">Realisasi Pagu</th> + <th rowspan="1" colspan="6">ESTI Pajak (Total Pagu)</th> + <th rowspan="1" colspan="6">ESTI Pajak (Realisasi Pagu)</th> + <th rowspan="1" colspan="7">Realisasi Pajak</th> + <th rowspan="1" colspan="6">Tax Gap (Total Pagu)</th> + <th rowspan="1" colspan="6">Tax Gap (Realisasi Pagu)</th> + <th rowspan="2" colspan="1">Tax Collection</th> + </tr> + <tr role="row"> + <th>NPWP</th> + <th>Nama</th> + <th>Kode</th> + <th>Pegawai</th> + <th>Barang/Jasa</th> + <th>Modal</th> + <th>Sosial</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>Pegawai</th> + <th>Barang/Jasa</th> + <th>Modal</th> + <th>Sosial</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Lainnya</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + <th>PPh 21</th> + <th>PPh 22</th> + <th>PPh 23</th> + <th>PPh 4(2)</th> + <th>PPN</th> + <th>Jumlah</th> + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + <th class="thead_sub">3</th> + <th class="thead_sub">4</th> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <th class="thead_sub">11</th> + <th class="thead_sub">12</th> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <th class="thead_sub">19</th> + <th class="thead_sub">20</th> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <th class="thead_sub">27</th> + <th class="thead_sub">28</th> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + <th class="thead_sub">32</th> + <th class="thead_sub">33</th> + <th class="thead_sub">34</th> + <th class="thead_sub">35</th> + <th class="thead_sub">36</th> + <th class="thead_sub">37</th> + <th class="thead_sub">38</th> + <th class="thead_sub">39</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">40</th> + <th class="thead_sub">41</th> + <th class="thead_sub">42</th> + <th class="thead_sub">43</th> + <th class="thead_sub">44</th> + <th class="thead_sub">45</th> + <th class="thead_sub">46</th> + <th class="thead_sub">47</th> + <th class="thead_sub">48</th> + <th class="thead_sub">49</th> + <th class="thead_sub">50</th> + + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_apbn as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><?php echo $row->NM_KANWIL; ?></td> + <td><?php echo $row->NM_KPP; ?></td> + <td><?php echo ucwords(strtolower($row->KABKOTA)); ?></td> + <td><?php echo $row->NM_SEKSI; ?></td> + <td><?php echo ucwords(strtolower($row->NM_AR)); ?></td> + <td><?php echo $row->NPWP; ?></td> + <td><?php echo ucwords(strtolower($row->NAMA_SATKER)); ?></td> + <td><?php echo $row->KODE_SATKER; ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_PEGAWAI, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_BARANG, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_MODAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_SOSIAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_PEGAWAI, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_BARANG, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_MODAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_SOSIAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH21_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH22_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH23_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH42_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPN_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH21_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH22_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH23_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPH42_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_PPN_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH21, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH22, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH23, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPH42, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_PPN, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_LAINNYA, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH21_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH22_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH23_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH42_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPN_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH21_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH22_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH23_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPH42_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_PPN_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->TAX_COLLECTION), 2, ",", ".") ?>%</td> + </tr> + <?php + } + ?> + </tbody> + <thead class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_PEGAWAI, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_BARANG, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_MODAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_SOSIAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_PEGAWAI, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_BARANG, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_MODAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_SOSIAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH21_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH22_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH23_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH42_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPN_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH21_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH22_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH23_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPH42_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_PPN_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_PPH21, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_PPH22, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_PPH23, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_PPH42, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_PPN, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_LAINNYA, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH21_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH22_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH23_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH42_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPN_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH21_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH22_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH23_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPH42_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_PPN_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_apbn_total->TAXGAP_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_apbn_total->TAX_COLLECTION), 2, ",", ".") ?>%</th> + </tr> + </thead> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + $('#cari_kanwil').change(function() { + var cari_kanwil = $('#cari_kanwil').val(); + + if(cari_kanwil == '') $('#cari_kpp').attr('disabled', true); + else { + if($("#cari_kpp").data('disabled') == true) $('#cari_kpp').attr('disabled', true); + else $('#cari_kpp').attr('disabled', false); + } + + $('#cari_kpp').empty().append("<option value=''>Semua</option>").val(''); + + if (cari_kanwil != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kpp'); ?>", + method: "GET", + data: { + kanwil: cari_kanwil + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kpp').append('<option value="' + value.KD_KPP + '">' + value.NM_KANTOR + '</option>'); + }); + + if($("#cari_kpp").data('temp') != "") { + $('#cari_kpp').val($("#cari_kpp").data('temp')).change(); + $("#cari_kpp").data('temp', ''); + } + else $("#cari_kpp").change(); + } + }); + } + else $("#cari_kpp").change(); + }); + + $('#cari_kpp').change(function() { + var cari_kpp = $('#cari_kpp').val(); + + if(cari_kpp == '') { + $('#cari_seksi').attr('disabled', true); + $('#cari_kabkot').attr('disabled', true); + } + else { + $('#cari_seksi').attr('disabled', false); + $('#cari_kabkot').attr('disabled', false); + } + + if($("#cari_seksi").data('temp') != "") { + $('#cari_seksi').val($("#cari_seksi").data('temp')).change(); + $("#cari_seksi").data('temp', ''); + } + else $('#cari_seksi').val('').change(); + + $('#cari_kabkot').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kabkot'); ?>", + method: "GET", + data: { + kpp: cari_kpp + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kabkot').append('<option value="' + value.NM_DATI2 + '">' + value.NM_DATI2.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_kabkot").data('temp') != "") { + $('#cari_kabkot').val($("#cari_kabkot").data('temp')).change(); + $("#cari_kabkot").data('temp', ''); + } + } + }); + } + }); + + $('#cari_seksi').change(function() { + var cari_kpp = $('#cari_kpp').val(); + var cari_seksi = $('#cari_seksi').val(); + + if(cari_seksi == '') $('#cari_ar').attr('disabled', true); + else $('#cari_ar').attr('disabled', false); + + $('#cari_ar').empty().append("<option value=''>Semua</option>"); + + if (cari_kpp != '' && cari_seksi != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_ar'); ?>", + method: "GET", + data: { + kpp: cari_kpp, + seksi: cari_seksi + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_ar').append('<option value="' + value.NIP + '">' + value.NAMA.split(" ").map(s => s.charAt(0).toUpperCase() + s.substr(1).toLowerCase()).join(" ") + '</option>'); + }); + + if($("#cari_ar").data('temp') != "") { + $('#cari_ar').val($("#cari_ar").data('temp')).change(); + $("#cari_ar").data('temp', ''); + } + } + }); + } + }); + + if($("#cari_kanwil").data('disabled') == true) $('#cari_kanwil').attr('disabled', true); + else $('#cari_kanwil').attr('disabled', false); + + $('#cari_kanwil').change(); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('bendahara/apbn/data_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/beranda/index.php b/app/Views/beranda/index.php new file mode 100644 index 00000000..7b503acb --- /dev/null +++ b/app/Views/beranda/index.php @@ -0,0 +1,776 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Monitoring Belanja Pemerintah Per Kanwil</h3></div> + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('beranda') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE."' ".$isSelected.">".ucfirst(strtolower($row->NM_PANJANG))."</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE."' ".$isSelected.">".ucfirst(strtolower($row->NM_PANJANG))."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Sumber Dana</label> + <select class="form-control" id="cari_sumber_dana" name="cari_sumber_dana"> + <option value="">Semua</option> + <option value="APBN" <?php echo $cari_sumber_dana == "APBN" ? "selected='selected'" : "" ?>>APBN</option> + <option value="APBD" <?php echo $cari_sumber_dana == "APBD" ? "selected='selected'" : "" ?>>APBD</option> + <option value="APBDes" <?php echo $cari_sumber_dana == "APBDes" ? "selected='selected'" : "" ?>>APBDes</option> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <?php + if($cari_sumber_dana == "APBN") { + $summary_pagu_total = $data_beranda_total->APBN_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBN_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBN_EST_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBN_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBN_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBN_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBN_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBD") { + $summary_pagu_total = $data_beranda_total->APBD_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBD_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBD_EST_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBD_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBD_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBD_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBD_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBDes") { + $summary_pagu_total = $data_beranda_total->APBDES_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBDES_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBDES_EST_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBDES_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBDES_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBDES_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBDES_TAX_COLLECTION; + } + else { + $summary_pagu_total = $data_beranda_total->ALL_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->ALL_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->ALL_EST_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->ALL_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->ALL_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->ALL_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->ALL_TAX_COLLECTION; + } + ?> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($summary_pagu_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($summary_pagu_total-$summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $summary_pagu_total > 0 ? number_format(($summary_realisasi_total/$summary_pagu_total)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Estimasi Pajak (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total-$summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $summary_tax_collection), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_beranda_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No</th> + <th rowspan="2" colspan="1">Kanwil</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th colspan="8" rowspan="1">APBN</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th colspan="8" rowspan="1">APBD</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th colspan="8" rowspan="1">APBDes</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th colspan="8" rowspan="1">Total</th> + <?php } ?> + + </tr> + <tr role="row"> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="thead_sub">3</th> + <th class="thead_sub">4</th> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="thead_sub">11</th> + <th class="thead_sub">12</th> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="thead_sub">19</th> + <th class="thead_sub">20</th> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="thead_sub">27</th> + <th class="thead_sub">28</th> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + <th class="thead_sub">32</th> + <th class="thead_sub">33</th> + <th class="thead_sub">34</th> + <?php } ?> + + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_beranda as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><a href="<?= base_url() ?>bendahara/beranda/kanwil?cari_kanwil=<?php echo $row->KD_KANWIL; ?>" data-toggle="tooltip" data-placement="top" title="Lihat KPP"><?php echo $row->NM_KANWIL; ?></a></td> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbn?cari_kanwil=<?php echo $row->KD_KANWIL; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBN_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBN_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_EST_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_EST_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbd?cari_kanwil=<?php echo $row->KD_KANWIL; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBD_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBD_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_EST_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_EST_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbdes?cari_kanwil=<?php echo $row->KD_KANWIL; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBDES_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBDES_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_EST_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_EST_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <td class="text-right"><?php echo number_format($row->ALL_PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_EST_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_EST_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + </tr> + <?php + } + ?> + </tbody> + <thead class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_EST_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_EST_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_EST_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_EST_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_EST_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_EST_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_EST_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_EST_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + </tr> + </thead> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('beranda/data_index_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/beranda/kanwil.php b/app/Views/beranda/kanwil.php new file mode 100644 index 00000000..8cea283c --- /dev/null +++ b/app/Views/beranda/kanwil.php @@ -0,0 +1,817 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Monitoring Belanja Pemerintah Per KPP</h3></div> + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('bendahara/beranda/kanwil') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE."' ".$isSelected.">".ucfirst(strtolower($row->NM_PANJANG))."</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE."' ".$isSelected.">".ucfirst(strtolower($row->NM_PANJANG))."</option>"; + } + ?> + </select> + </div> + </div> + </div> + + <?php + $cari_kanwil_disabled = 'false'; + + if (session('tpkantor') == 'Kanwil') { + $cari_kanwil_disabled = 'true'; + } + ?> + + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <label for="cari_kanwil">Kanwil</label> + <select class="form-control" id="cari_kanwil" name="cari_kanwil" data-disabled="<?php echo $cari_kanwil_disabled ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_kanwil as $row) { + if ($row->KODE == $cari_kanwil) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE ."' ".$isSelected.">".$row->NAMA."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Sumber Dana</label> + <select class="form-control" id="cari_sumber_dana" name="cari_sumber_dana"> + <option value="">Semua</option> + <option value="APBN" <?php echo $cari_sumber_dana == "APBN" ? "selected='selected'" : "" ?>>APBN</option> + <option value="APBD" <?php echo $cari_sumber_dana == "APBD" ? "selected='selected'" : "" ?>>APBD</option> + <option value="APBDes" <?php echo $cari_sumber_dana == "APBDes" ? "selected='selected'" : "" ?>>APBDes</option> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <?php + if($cari_sumber_dana == "APBN") { + $summary_pagu_total = $data_beranda_total->APBN_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBN_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBN_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBN_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBN_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBN_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBN_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBD") { + $summary_pagu_total = $data_beranda_total->APBD_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBD_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBD_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBD_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBD_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBD_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBD_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBDes") { + $summary_pagu_total = $data_beranda_total->APBDES_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBDES_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBDES_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBDES_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBDES_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBDES_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBDES_TAX_COLLECTION; + } + else { + $summary_pagu_total = $data_beranda_total->ALL_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->ALL_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->ALL_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->ALL_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->ALL_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->ALL_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->ALL_TAX_COLLECTION; + } + ?> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($summary_pagu_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($summary_pagu_total-$summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $summary_pagu_total > 0 ? number_format(($summary_realisasi_total/$summary_pagu_total)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Estimasi Pajak (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total-$summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $summary_tax_collection), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_beranda_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No</th> + <th rowspan="2" colspan="1">Kanwil</th> + <th rowspan="2" colspan="1">KPP</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th colspan="8" rowspan="1">APBN</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th colspan="8" rowspan="1">APBD</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th colspan="8" rowspan="1">APBDes</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th colspan="8" rowspan="1">Total</th> + <?php } ?> + + </tr> + <tr role="row"> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + <th class="thead_sub">3</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="thead_sub">4</th> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <th class="thead_sub">11</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="thead_sub">12</th> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <th class="thead_sub">19</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="thead_sub">20</th> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <th class="thead_sub">27</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="thead_sub">28</th> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + <th class="thead_sub">32</th> + <th class="thead_sub">33</th> + <th class="thead_sub">34</th> + <th class="thead_sub">35</th> + <?php } ?> + + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_beranda as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><?php echo $row->NM_KANWIL; ?></td> + <td><a href="<?= base_url() ?>bendahara/beranda/kpp?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Kabupaten/Kota"><?php echo $row->NM_KPP; ?></a></td> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbn?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBN_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBN_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbd?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBD_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBD_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbdes?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBDES_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBDES_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <td class="text-right"><?php echo number_format($row->ALL_PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + </tr> + <?php + } + ?> + </tbody> + <thead class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + <th></th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + </tr> + </thead> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + if($("#cari_kanwil").data('disabled') == true) $('#cari_kanwil').attr('disabled', true); + else $('#cari_kanwil').attr('disabled', false); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('bendahara/beranda/data_kanwil_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/beranda/kpp.php b/app/Views/beranda/kpp.php new file mode 100644 index 00000000..ad95e651 --- /dev/null +++ b/app/Views/beranda/kpp.php @@ -0,0 +1,870 @@ +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <div class="col-sm-12 mb-2"> + <div class="card"> + <div class="card-header"><h3><i class="ik ik-pie-chart"></i> Monitoring Belanja Pemerintah Per Kabupaten/Kota</h3></div> + <div class="card-body"> + <form class="forms-sample" method="get" action="<?php echo base_url('beranda/kpp') ?>"> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Tahun</label> + <select class="form-control" id="cari_tahun" name="cari_tahun"> + <?php + foreach ($ref_tahun as $row) { + if ($row->TAHUN == $cari_tahun) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->TAHUN."' ".$isSelected.">".$row->TAHUN."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_awal">Bulan</label> + <select class="form-control" id="cari_bulan_awal" name="cari_bulan_awal"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_awal) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + <div class="col-md-1 text-center" style="margin: 35px -25px 0px -25px;"> + s/d + </div> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_bulan_akhir"> </label> + <select class="form-control" id="cari_bulan_akhir" name="cari_bulan_akhir"> + <?php + foreach ($ref_bulan as $row) { + if ($row->KODE == $cari_bulan_akhir) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='" . $row->KODE . "' " . $isSelected . ">" . ucfirst(strtolower($row->NM_PANJANG)) . "</option>"; + } + ?> + </select> + </div> + </div> + </div> + + <?php + $cari_kanwil_disabled = 'false'; + $cari_kpp_disabled = 'false'; + + if (session('tpkantor') == 'KPP') { + $cari_kanwil_disabled = 'true'; + $cari_kpp_disabled = 'true'; + } + else if (session('tpkantor') == 'Kanwil') { + $cari_kanwil_disabled = 'true'; + } + ?> + + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <label for="cari_kanwil">Kanwil</label> + <select class="form-control" id="cari_kanwil" name="cari_kanwil" data-disabled="<?php echo $cari_kanwil_disabled ?>"> + <option value=''>Semua</option> + <?php + foreach ($ref_kanwil as $row) { + if ($row->KODE == $cari_kanwil) { + $isSelected = 'selected="selected"'; + } + else { + $isSelected = ''; + } + echo "<option value='".$row->KODE ."' ".$isSelected.">".$row->NAMA."</option>"; + } + ?> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-4"> + <div class="form-group"> + <label for="cari_kpp">KPP</label> + <select class="form-control" id="cari_kpp" name="cari_kpp" data-temp="<?php echo $cari_kpp ?>" data-disabled="<?php echo $cari_kpp_disabled ?>"> + </select> + </div> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <div class="form-group"> + <label for="cari_tahun">Sumber Dana</label> + <select class="form-control" id="cari_sumber_dana" name="cari_sumber_dana"> + <option value="">Semua</option> + <option value="APBN" <?php echo $cari_sumber_dana == "APBN" ? "selected='selected'" : "" ?>>APBN</option> + <option value="APBD" <?php echo $cari_sumber_dana == "APBD" ? "selected='selected'" : "" ?>>APBD</option> + <option value="APBDes" <?php echo $cari_sumber_dana == "APBDes" ? "selected='selected'" : "" ?>>APBDes</option> + </select> + </div> + </div> + </div> + <button type="submit" class="btn btn-primary mr-2">Proses</button> + </form> + </div> + </div> + + <div class="card"> + <ul class="nav nav-pills custom-pills justify-content-center" id="pills-tab" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="pills-timeline-tab" data-toggle="pill" href="#penyerapan_pagu" role="tab" aria-controls="pills-timeline" aria-selected="true">Penyerapan Pagu</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#realisasi_pajak" role="tab" aria-controls="pills-profile" aria-selected="false">Realisasi Pajak</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="pills-setting-tab" data-toggle="pill" href="#grafik_timeline" role="tab" aria-controls="pills-setting" aria-selected="false">Grafik Timeline</a> + </li> + </ul> + </div> + + <?php + if($cari_sumber_dana == "APBN") { + $summary_pagu_total = $data_beranda_total->APBN_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBN_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBN_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBN_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBN_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBN_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBN_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBD") { + $summary_pagu_total = $data_beranda_total->APBD_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBD_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBD_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBD_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBD_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBD_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBD_TAX_COLLECTION; + } + else if($cari_sumber_dana == "APBDes") { + $summary_pagu_total = $data_beranda_total->APBDES_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->APBDES_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->APBDES_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->APBDES_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->APBDES_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->APBDES_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->APBDES_TAX_COLLECTION; + } + else { + $summary_pagu_total = $data_beranda_total->ALL_PAGU_TOTAL; + $summary_realisasi_total = $data_beranda_total->ALL_REAL_TOTAL; + $summary_estimasi_total = $data_beranda_total->ALL_ESTI_TOTAL_PAGU; + $summary_bayar_total = $data_beranda_total->ALL_BAYAR_TOTAL; + $summary_taxgap_pagu = $data_beranda_total->ALL_TAXGAP_PAGU; + $summary_taxgap_realisasi = $data_beranda_total->ALL_TAXGAP_REAL; + $summary_tax_collection = $data_beranda_total->ALL_TAX_COLLECTION; + } + ?> + + <div class="tab-content" id="pills-tabContent"> + <div class="tab-pane fade show active" id="penyerapan_pagu" role="tabpanel" aria-labelledby="pills-timeline-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Total Pagu</h6> + <h2><?php echo number_format($summary_pagu_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-share-2"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pagu</h6> + <h2><?php echo number_format($summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Sisa Pagu</h6> + <h2><?php echo number_format($summary_pagu_total-$summary_realisasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12" id="scroll_back"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Penyerapan Pagu</h6> + <h2><?php echo $summary_pagu_total > 0 ? number_format(($summary_realisasi_total/$summary_pagu_total)*100, 2, ",", ".") : "0,00" ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="realisasi_pajak" role="tabpanel" aria-labelledby="pills-profile-tab"> + <div class="row clearfix"> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Estimasi Pajak (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-crosshair"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-success" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Realisasi Pajak</h6> + <h2><?php echo number_format($summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-trending-up"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Gap (Total Pagu)</h6> + <h2><?php echo number_format($summary_estimasi_total-$summary_bayar_total, 0, ",", ".") ?></h2> + </div> + <div class="icon"> + <i class="ik ik-alert-triangle"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-danger" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + <div class="col-lg-6 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Tax Collection</h6> + <h2><?php echo number_format((float) str_replace(",", ".", $summary_tax_collection), 2, ",", ".") ?>%</h2> + </div> + <div class="icon"> + <i class="ik ik-percent"></i> + </div> + </div> + </div> + <div class="progress progress-sm"> + <div class="progress-bar bg-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"></div> + </div> + </div> + </div> + </div> + </div> + <div class="tab-pane fade" id="grafik_timeline" role="tabpanel" aria-labelledby="pills-setting-tab"> + <div class="card"> + <div class="card-body"> + <div id="grafik_area"></div> + </div> + </div> + </div> + </div> + + <div class="card" style="display: table;"> + <div class="card-body"> + + <?php + $page_curr = $cari_page; + $page_count = ceil($data_beranda_total->KUANTITAS / $cari_limit); + + if($page_count >= 5) { + $page_bottom = $page_curr - 2; + $page_option = 5; + + if($page_bottom <= 0) $page_bottom = 1; + if($page_bottom + $page_option - 1 > $page_count) $page_bottom = $page_count - $page_option + 1; + } + else { + $page_option = $page_count; + $page_bottom = 1; + } + + $page_arr = []; + for($i = $page_bottom; $i <= $page_bottom + $page_option - 1; $i++) { + $page_arr[] = $i; + } + ?> + + <style> + .page-link { + padding-right: 10px !important; + padding-left: 10px !important; + } + + #cari_limit { + width: 175px; + margin-right: 30px; + } + </style> + + <div class="row mb-3"> + <div class="col-lg-12"> + <table> + <tr> + <td> + <select class="form-control" name="cari_limit" id="cari_limit"> + <option value="25">25 Per Halaman</option> + <option value="50">50 Per Halaman</option> + <option value="100">100 Per Halaman</option> + <option value="200">200 Per Halaman</option> + </select> + </td> + <td> + <ul class="pagination mb-0"> + <li class="page-item"> + <a class="page-link first" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=1#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Awal"> + <i class="ik ik-chevrons-left"></i> + </a> + </li> + + <?php if($page_curr > 1) { ?> + <li class="page-item"> + <a class="page-link prev" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr - 1)."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Sebelumnya"> + <i class="ik ik-chevron-left"></i> + </a> + </li> + <?php } ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[0] > 1) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php + foreach($page_arr as $val) { + if($page_curr == $val) $page_active = " active"; + else $page_active = ""; + ?> + <li class="page-item<?php echo $page_active ?>"> + <a class="page-link" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$val."#scroll_back"; ?>"><?php echo number_format($val, 0, ",", ".") ?></a> + </li> + <?php + } + ?> + + <?php + if(count($page_arr) > 0) { + if($page_arr[count($page_arr) - 1] < $page_count) { + ?> + <li class="page-item"> + <a class="page-link">...</a> + </li> + <?php + } + } + ?> + + <?php if($page_curr < $page_count) { ?> + <li class="page-item"> + <a class="page-link next" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".($page_curr + 1)."#scroll_back"; ?>" aria-label="Next" data-toggle="tooltip" data-placement="top" title="Halaman Selanjutnya"> + <i class="ik ik-chevron-right"></i> + </a> + </li> + <?php } ?> + + <li class="page-item"> + <a class="page-link last" href="<?php echo remove_url_param(current_url()."?".$_SERVER['QUERY_STRING'], "cari_page")."&cari_page=".$page_count."#scroll_back"; ?>" data-toggle="tooltip" data-placement="top" title="Halaman Akhir"> + <i class="ik ik-chevrons-right"></i> + </a> + </li> + </ul> + </td> + </tr> + </table> + </div> + </div> + + <style> + .table { + margin-bottom: 0px; + } + a { + color: #007bff; + } + .table thead th { + text-align: center; + vertical-align: middle; + } + .table thead th.thead_sub { + font-size: 11px; + } + </style> + + <table class="table table-sm table-striped table-bordered" id="table_area"> + <thead class="thead-dark"> + <tr role="row"> + <th rowspan="2" colspan="1">No</th> + <th rowspan="2" colspan="1">Kanwil</th> + <th rowspan="2" colspan="1">KPP</th> + <th rowspan="2" colspan="1">Kabupaten/Kota</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th colspan="8" rowspan="1">APBN</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th colspan="8" rowspan="1">APBD</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th colspan="8" rowspan="1">APBDes</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th colspan="8" rowspan="1">Total</th> + <?php } ?> + + </tr> + <tr role="row"> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th>Total Pagu</th> + <th>Realisasi Pagu</th> + <th>Estimasi Pajak (Total Pagu)</th> + <th>Estimasi Pajak (Realisasi Pagu)</th> + <th>Realisasi Pajak</th> + <th>Tax Gap (Total Pagu)</th> + <th>Tax Gap (Realisasi Pagu)</th> + <th>Tax Collection</th> + <?php } ?> + + </tr> + <tr> + <th class="thead_sub">1</th> + <th class="thead_sub">2</th> + <th class="thead_sub">3</th> + <th class="thead_sub">4</th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="thead_sub">5</th> + <th class="thead_sub">6</th> + <th class="thead_sub">7</th> + <th class="thead_sub">8</th> + <th class="thead_sub">9</th> + <th class="thead_sub">10</th> + <th class="thead_sub">11</th> + <th class="thead_sub">12</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="thead_sub">13</th> + <th class="thead_sub">14</th> + <th class="thead_sub">15</th> + <th class="thead_sub">16</th> + <th class="thead_sub">17</th> + <th class="thead_sub">18</th> + <th class="thead_sub">19</th> + <th class="thead_sub">20</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="thead_sub">21</th> + <th class="thead_sub">22</th> + <th class="thead_sub">23</th> + <th class="thead_sub">24</th> + <th class="thead_sub">25</th> + <th class="thead_sub">26</th> + <th class="thead_sub">27</th> + <th class="thead_sub">28</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="thead_sub">29</th> + <th class="thead_sub">30</th> + <th class="thead_sub">31</th> + <th class="thead_sub">32</th> + <th class="thead_sub">33</th> + <th class="thead_sub">34</th> + <th class="thead_sub">35</th> + <th class="thead_sub">36</th> + <?php } ?> + + </tr> + </thead> + <tbody> + <?php + $nomor = ($cari_page * $cari_limit) - $cari_limit; + + foreach ($data_beranda as $idx => $row) { + $nomor = $nomor + 1; + ?> + <tr> + <td class="text-center"><?php echo number_format($nomor, 0, ",", "."); ?></td> + <td><?php echo $row->NM_KANWIL; ?></td> + <td><?php echo $row->NM_KPP; ?></td> + <td><?php echo ucwords(strtolower($row->KABKOTA)); ?></td> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbn?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>&cari_kabkot=<?php echo $row->KABKOTA; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBN_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBN_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBN_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbd?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>&cari_kabkot=<?php echo $row->KABKOTA; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBD_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBD_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBD_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <td class="text-right"><a href="<?= base_url() ?>bendahara/apbdes?cari_tahun=<?php echo $cari_tahun; ?>&cari_bulan_awal=<?php echo $cari_bulan_awal; ?>&cari_bulan_akhir=<?php echo $cari_bulan_akhir; ?>&cari_kanwil=<?php echo $row->KD_KANWIL; ?>&cari_kpp=<?php echo $row->KD_KPP; ?>&cari_kabkot=<?php echo $row->KABKOTA; ?>" data-toggle="tooltip" data-placement="top" title="Lihat Rincian"><?php echo number_format($row->APBDES_PAGU_TOTAL, 0, ",", ".") ?></a></td> + <td class="text-right"><?php echo number_format($row->APBDES_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->APBDES_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <td class="text-right"><?php echo number_format($row->ALL_PAGU_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_REAL_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_ESTI_TOTAL_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_ESTI_TOTAL_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_BAYAR_TOTAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_PAGU, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format($row->ALL_TAXGAP_REAL, 0, ",", ".") ?></td> + <td class="text-right"><?php echo number_format((float) str_replace(",", ".", $row->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</td> + <?php } ?> + + </tr> + <?php + } + ?> + </tbody> + <thead class="thead-dark"> + <tr> + <th>Jumlah</th> + <th></th> + <th></th> + <th></th> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBN") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBN_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBN_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBD") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBD_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBD_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "" || $cari_sumber_dana == "APBDes") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->APBDES_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->APBDES_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + <?php if($cari_sumber_dana == "") { ?> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_PAGU_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_REAL_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_ESTI_TOTAL_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_ESTI_TOTAL_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_BAYAR_TOTAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_PAGU, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format($data_beranda_total->ALL_TAXGAP_REAL, 0, ",", ".") ?></th> + <th class="text-right"><?php echo number_format((float) str_replace(",", ".", $data_beranda_total->ALL_TAX_COLLECTION), 2, ",", ".") ?>%</th> + <?php } ?> + + </tr> + </thead> + </table> + </div> + </div> + </div> + </div> + </div> +</div> + +<script> + $(document).ready(function() { + $('#cari_limit').change(function() { + <?php + $url_curr = current_url()."?".$_SERVER['QUERY_STRING']; + $url_curr = remove_url_param($url_curr, "cari_limit"); + $url_curr = remove_url_param($url_curr, "cari_page"); + ?> + + window.location.href='<?php echo $url_curr."&cari_page=1&cari_limit="; ?>' + $('#cari_limit').val() + "#scroll_back"; + }); + + $('#cari_limit').val('<?php echo $cari_limit ?>'); + }); +</script> + +<script> + $(document).ready(function() { + $('#cari_kanwil').change(function() { + var cari_kanwil = $('#cari_kanwil').val(); + + if($('#cari_kanwil').val() == '') $('#cari_kpp').attr('disabled', true); + else { + if($("#cari_kpp").data('disabled') == true) $('#cari_kpp').attr('disabled', true); + else $('#cari_kpp').attr('disabled', false); + } + + $('#cari_kpp').empty().append("<option value=''>Semua</option>").val('').change();; + + if (cari_kanwil != '') { + $.ajax({ + url: "<?php echo base_url('bendahara/general/get_ref_kpp'); ?>", + method: "GET", + data: { + kanwil: cari_kanwil + }, + dataType: "JSON", + success: function(data) { + $.each(data, function(key, value) { + $('#cari_kpp').append('<option value="' + value.KD_KPP + '">' + value.NM_KANTOR + '</option>'); + }); + + if($("#cari_kpp").data('temp') != "") { + $('#cari_kpp').val($("#cari_kpp").data('temp')).change(); + $("#cari_kpp").data('temp', ''); + } + } + }); + } + }); + + if($("#cari_kanwil").data('disabled') == true) $('#cari_kanwil').attr('disabled', true); + else $('#cari_kanwil').attr('disabled', false); + + $('#cari_kanwil').change(); + }); +</script> + +<script> + $(document).ready(function() { + Highcharts.setOptions({ + lang: { + numericSymbols: [' Ribu', ' Juta', ' Miliar', ' Triliun', ' Kuadriliun', ' Kuintiliun'] + } + }); + + var options = { + chart: { + renderTo: 'grafik_area', + zoomType: 'xy' + }, + title: { + text: '' + }, + subtitle: { + text: '' + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], + crosshair: true + }], + yAxis: [ + { + title: { + text: 'Realisasi Pagu' + } + }, + { + title: { + text: 'Realisasi Pajak', + }, + opposite: true + } + ], + tooltip: { + shared: true + }, + legend: { + enabled: true, + verticalAlign: 'top', + align: 'center', + y: 0, + margin: 20 + }, + exporting: { + enabled: false + }, + credits: { + enabled: false + }, + plotOptions: { + series: { + pointWidth: 100 + } + }, + series: [ + { + yAxis: 0, + name: "Realisasi Pagu", + type: "spline", + color:"red" + }, + { + yAxis: 1, + name: "Realisasi Pajak", + type: "spline", + color: "green" + } + ] + } + + chart = new Highcharts.Chart(options); + + $.getJSON("<?php echo base_url('bendahara/beranda/data_kpp_grafik_timeline')."?".$_SERVER['QUERY_STRING']; ?>", function(json) { + options.series[0]['data'] = json['realisasi_pagu']; + options.series[1]['data'] = json['realisasi_pajak']; + chart = new Highcharts.Chart(options); + }); + }); +</script> \ No newline at end of file diff --git a/app/Views/inc/sidebar.php b/app/Views/inc/sidebar.php index 7cbe5a1d..2cd2743f 100644 --- a/app/Views/inc/sidebar.php +++ b/app/Views/inc/sidebar.php @@ -85,6 +85,23 @@ <a href="<?=base_url()?>kewilayahan/peta" class="menu-item">Peta</a> </div> </div> + + + <div class="nav-item has-sub"> + <a href="#"><i class="ik ik-layers"></i><span>Instansi Pemerintah</span></a> + <div class="submenu-content"> + <a href="<?=base_url()?>bendahara/beranda" class="menu-item">Dashboard</a> + </div> + <div class="submenu-content"> + <a href="<?=base_url()?>bendahara/apbn" class="menu-item">APBN</a> + </div> + <div class="submenu-content"> + <a href="<?=base_url()?>bendahara/apbd" class="menu-item">APBD</a> + </div> + <div class="submenu-content"> + <a href="<?=base_url()?>bendahara/apbdes" class="menu-item">APBDes</a> + </div> + </div> <!-- <div class="nav-item"> <a href="pages/ui/icons.html"><i class="ik ik-command"></i><span>Icons</span></a> diff --git a/app/Views/kanwil/dashboard.php b/app/Views/kanwil/dashboard.php index d087b72b..f28029ac 100644 --- a/app/Views/kanwil/dashboard.php +++ b/app/Views/kanwil/dashboard.php @@ -696,6 +696,12 @@ $totalwpall = $wpbaru + $wplama; </div> </div> </div> + <div class="row mb-15 justify-content-between"> + <div class="col-12"> + <a href="javascript:wpskPoC('1')" class="btn btn-success my-1">Payment Of Compliance</a> + <a href="javascript:wpskSoF('1')" class="btn btn-success my-1">Strength Of Figure</a> + </div> + </div> </div> <div class=" col-lg-6 col-md-12"> <div class="col text-center"> @@ -784,6 +790,13 @@ $totalwpall = $wpbaru + $wplama; </div> </div> + <div class="row mb-15 justify-content-between"> + <div class="col-12"> + <a href="javascript:wpskPoC('2')" class="btn btn-primary my-1">Payment Of Compliance</a> + <a href="javascript:wpskSoF('2')" class="btn btn-primary my-1">Strength Of Figure</a> + </div> + </div> + </div> </div> </div> @@ -2018,9 +2031,101 @@ $totalwpall = $wpbaru + $wplama; </div> +<!-- Modal --> +<div class="modal fade" id="PoC" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <!-- Preloader --> + <div id="modal-preloader"> + <div class="modal-preloader_status"> + <div class="modal-preloader_spinner"> + <div class="d-flex justify-content-center"> + <div class="spinner-border" role="status"></div> + </div> + </div> + </div> + </div> + <!-- End Preloader --> + <div class="modal-header"> + <h5 class="modal-title" id="exampleModalLabel">Payment Of Compliance</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body"> + <div class="row mx-auto"> + <iframe id="PocFrame" width="100%" height="500" frameborder="0"></iframe> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> + </div> + </div> + </div> +</div> +<!-- Modal --> +<div class="modal fade" id="SoF" tabindex="-1" aria-labelledby="exampleModalLabel1" aria-hidden="true"> + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="exampleModalLabel">Strength Of Figure</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body"> + <div class="spinner-border text-primary" role="status"> + <span class="sr-only">Loading...</span> + </div> + <div class="row mx-auto"> + <iframe id="SoFFrame" width="100%" height="500" frameborder="0"></iframe> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> + </div> + </div> + </div> +</div> + + +<?php +$linkpoc="'".base_url('home/wpskpoc')."'"; +$linksof="'".base_url('home/wpsksof')."'"; +echo view('inc/js.php') ?> + +<script type="text/javascript"> + function wpskPoC(source){ + var frame = document.getElementById("PocFrame"), + frameDoc = frame.contentDocument || frame.contentWindow.document; + frameDoc.removeChild(frameDoc.documentElement); + $('#PoC').modal('show'); + document.getElementById("PocFrame").src = <?php echo $linkpoc?>+'/' +'<?=$tahunx?>'+'/'+'<?=$bulanx?>'+'/'+'<?= $kwlx?>'+'/'+'<?=$kppx?>'+'/' + source; + } + </script> + + <script type="text/javascript"> + function wpskSoF(source){ + var frame = document.getElementById("SoFFrame"), + frameDoc = frame.contentDocument || frame.contentWindow.document; + frameDoc.removeChild(frameDoc.documentElement); + $('#SoF').modal('show'); + document.getElementById("SoFFrame").src = <?php echo $linksof?>+'/' +'<?=$tahunx?>'+'/'+'<?=$bulanx?>'+'/'+'<?= $kwlx?>'+'/'+'<?=$kppx?>'+'/'+ source; + } + </script> +<script> + $(document).ready(function() { + if ($("#PocFrame").length) { + $('.spinner-border').hide(); + } + + if ($("#SoFFrame").length) { + $('.spinner-border').hide(); + } + }); -<?php echo view('inc/js.php') ?> +</script> <script> $(function () { diff --git a/app/Views/ppm/dashboard.php b/app/Views/ppm/dashboard.php index 62dc9cd4..ceaa87d5 100644 --- a/app/Views/ppm/dashboard.php +++ b/app/Views/ppm/dashboard.php @@ -735,6 +735,13 @@ </div> </div> </div> + <div class="row mb-15 justify-content-between"> + <div class="col-12"> + <a href="javascript:wpskPoC('1')" class="btn btn-success my-1">Payment Of Compliance</a> + <a href="javascript:wpskSoF('1')" class="btn btn-success my-1">Strength Of Figure</a> + </div> + </div> + </div> <div class=" col-lg-6 col-md-12"> <div class="col text-center"> @@ -824,7 +831,15 @@ </div> </div> + <div class="row mb-15 justify-content-between"> + <div class="col-12"> + <a href="javascript:wpskPoC('2')" class="btn btn-primary my-1">Payment Of Compliance</a> + <a href="javascript:wpskSoF('2')" class="btn btn-primary my-1">Strength Of Figure</a> + </div> + </div> + </div> + </div> </div> <div class="card-footer"> @@ -2081,10 +2096,103 @@ </div> </div> +<!-- Modal --> +<div class="modal fade" id="PoC" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <!-- Preloader --> + <div id="modal-preloader"> + <div class="modal-preloader_status"> + <div class="modal-preloader_spinner"> + <div class="d-flex justify-content-center"> + <div class="spinner-border" role="status"></div> + </div> + </div> + </div> + </div> + <!-- End Preloader --> + <div class="modal-header"> + <h5 class="modal-title" id="exampleModalLabel">Payment Of Compliance</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body"> + <div class="row mx-auto"> + <iframe id="PocFrame" width="100%" height="500" frameborder="0"></iframe> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> + </div> + </div> + </div> +</div> + +<!-- Modal --> +<div class="modal fade" id="SoF" tabindex="-1" aria-labelledby="exampleModalLabel1" aria-hidden="true"> + <div class="modal-dialog modal-xl"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="exampleModalLabel">Strength Of Figure</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + <div class="modal-body"> + <div class="spinner-border text-primary" role="status"> + <span class="sr-only">Loading...</span> + </div> + <div class="row mx-auto"> + <iframe id="SoFFrame" width="100%" height="500" frameborder="0"></iframe> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> + </div> + </div> + </div> +</div> - - <?php echo view('inc/js.php') ?> + <?php + + $linkpoc="'".base_url('home/wpskpoc')."'"; + $linksof="'".base_url('home/wpsksof')."'"; + echo view('inc/js.php') ?> + +<script> + $(document).ready(function() { + if ($("#PocFrame").length) { + $('.spinner-border').hide(); + } + + if ($("#SoFFrame").length) { + $('.spinner-border').hide(); + } + }); + +</script> + + <script type="text/javascript"> + function wpskPoC(source){ + var frame = document.getElementById("PocFrame"), + frameDoc = frame.contentDocument || frame.contentWindow.document; + frameDoc.removeChild(frameDoc.documentElement); + $('#PoC').modal('show'); + document.getElementById("PocFrame").src = <?php echo $linkpoc?>+'/' +'<?=$tahunx?>'+'/'+'<?=$bulanx?>'+'/'+'SEMUA'+'/'+'SEMUA'+'/'+ source; + } + </script> + + <script type="text/javascript"> + function wpskSoF(source){ + var frame = document.getElementById("SoFFrame"), + frameDoc = frame.contentDocument || frame.contentWindow.document; + frameDoc.removeChild(frameDoc.documentElement); + $('#SoF').modal('show'); + document.getElementById("SoFFrame").src = <?php echo $linksof?>+'/' +'<?=$tahunx?>'+'/'+'<?=$bulanx?>'+'/'+'SEMUA'+'/'+'SEMUA'+'/'+ source; + } + </script> <script> $(function () { diff --git a/app/Views/ppm/wpskpoc.php b/app/Views/ppm/wpskpoc.php new file mode 100644 index 00000000..5bac36be --- /dev/null +++ b/app/Views/ppm/wpskpoc.php @@ -0,0 +1,92 @@ +<?php echo view('inc/head.php') ?> + +<?php +$datapaycomp = "["; +foreach ($paycomp as $rowp) { + $datapaycomp = $datapaycomp . "{name : 'Jmlbln : " . $rowp->JMLBULAN . "',y: " . $rowp->JMLWP . "},"; +} +$datapaycomp = $datapaycomp . "]"; + +?> +<div class="main-content"> + <div class="container-fluid"> + + <div class="row"> + <?php if($sourcex == '1'){ + $judul = "Strategis"; + }else{ + $judul = "Kewilayahan"; + } ?> + <div></div> + <div></div> + <h3> <?= $judul?> </h3> + <div class="row mx-auto"> + <div id="paycomp" style="height: 400px;"></div> + </div> + </div> + </div> +</div> + +<?php echo view('inc/js.php') ?> + + + <script> + Highcharts.setOptions({ + colors3: Highcharts.map(Highcharts.getOptions().colors, function (color) { + return { + radialGradient: { + cx: 0.5, + cy: 0.3, + r: 0.7 + }, + stops: [ + [0, color], + [1, Highcharts.color(color).brighten(-0.3).get('rgb')] // darken + ] + }; + }) + }); + + // Build the chart + Highcharts.chart('paycomp', { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + title: { + text: '', + align: '' + }, + tooltip: { + pointFormat: '{series.name}: <b>{point.percentage:.2f}%</b>' + }, + accessibility: { + point: { + valueSuffix: '%' + } + }, + credits: { + enabled: false + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '<span style="font-size: 1.2em"><b>{point.name}</b></span><br>' + + '<span style="opacity: 0.6">{point.percentage:.2f} %</span>', + connectorColor: 'rgba(128,128,128,0.5)' + } + } + }, + series: [{ + name: 'WP Byr', + data: <?php echo $datapaycomp ?> + }] + }); + </script> + +</body> diff --git a/app/Views/ppm/wpsksof.php b/app/Views/ppm/wpsksof.php new file mode 100644 index 00000000..ddc31030 --- /dev/null +++ b/app/Views/ppm/wpsksof.php @@ -0,0 +1,262 @@ +<?php +/* ini_set('memory_limit', '8096M'); + +echo 'Initial memory usage: ' . memory_get_usage() . ' bytes' . PHP_EOL; + */ +echo view('inc/head.php') ?> + + +<div class="main-content"> + <div class="container-fluid"> + <div class="row"> + <?php if($sourcex == '1'){ + $judul = "Strategis"; + }else{ + $judul = "Kewilayahan"; + } ?> + <div></div> + <div></div> + <h3> <?= $judul?> </h3> + <div class="row mx-auto"> + <table class="table table-sm"> + <thead> + <tr> + <th class="text-center" rowspan="2">No</th> + <th class="text-center" rowspan="2">Strength of Figure</th> + <th class="text-center" colspan="2">Jml Wajib Pajak</th> + <th class="text-center" colspan="2">Jml Bayar <?php echo $tahunx; ?></th> + </tr> + <tr> + <th class="text-center">Jumlah</th> + <th class="text-center">%</th> + <th class="text-center">Jumlah</th> + <th class="text-center">%</th> + </tr> + </thead> + <?php + $jumlah["0"]["1"] = 0; + $jumlah["9"]["1"] = 0; + $jumlah["1"]["1"] = 0; + $jumlah["2"]["1"] = 0; + $jumlah["3"]["1"] = 0; + $jumlah["4"]["1"] = 0; + $jumlah["5"]["1"] = 0; + $jumlah["6"]["1"] = 0; + $jumlah["7"]["1"] = 0; + $jumlah["8"]["1"] = 0; + $jumlah["0"]["2"] = 0; + $jumlah["9"]["2"] = 0; + $jumlah["1"]["2"] = 0; + $jumlah["2"]["2"] = 0; + $jumlah["3"]["2"] = 0; + $jumlah["4"]["2"] = 0; + $jumlah["5"]["2"] = 0; + $jumlah["6"]["2"] = 0; + $jumlah["7"]["2"] = 0; + $jumlah["8"]["2"] = 0; + foreach ($SoF as $_junk => $data) { + if ($data->TOTAL < 0) { + $jumlah["9"]["1"] += 1; + $jumlah["9"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 5000) { + $jumlah["1"]["1"] += 1; + $jumlah["1"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 10000) { + $jumlah["2"]["1"] += 1; + $jumlah["2"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 100000) { + $jumlah["3"]["1"] += 1; + $jumlah["3"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 500000) { + $jumlah["4"]["1"] += 1; + $jumlah["4"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 1000000) { + $jumlah["5"]["1"] += 1; + $jumlah["5"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 5000000) { + $jumlah["6"]["1"] += 1; + $jumlah["6"]["2"] += $data->TOTAL; + } elseif ($data->TOTAL < 10000000) { + $jumlah["7"]["1"] += 1; + $jumlah["7"]["2"] += $data->TOTAL; + } else { + $jumlah["8"]["1"] += 1; + $jumlah["8"]["2"] += $data->TOTAL; + } + $jumlah["0"]["1"] += 1; + $jumlah["0"]["2"] += $data->TOTAL; + } + ?> + <tbody> + <tr> + <td class='text-center'>1</td> + <td class='text-left'>Lapisan 0</td> + <td class='text-right'><?= number_format(($jumlah["9"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= number_format(($jumlah["9"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["9"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= number_format(($jumlah["9"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>2</td> + <td class='text-left'>Lapisan 1 - 5.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["1"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["1"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["1"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["1"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>3</td> + <td class='text-left'>Lapisan 5.000 - 10.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["2"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["2"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["2"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["2"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>4</td> + <td class='text-left'>Lapisan 10.000 - 100.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["3"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["3"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["3"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["3"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>5</td> + <td class='text-left'>Lapisan 100.000 - 500.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["4"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["4"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["4"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["4"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>6</td> + <td class='text-left'>Lapisan 500.000 - 1.000.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["5"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["5"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["5"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["5"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>7</td> + <td class='text-left'>Lapisan 1.000.000 - 5.000.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["6"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["6"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["6"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["6"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>8</td> + <td class='text-left'>Lapisan 5.000.000 - 10.000.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["7"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["7"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["7"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["7"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + <tr> + <td class='text-center'>9</td> + <td class='text-left'>Lapisan >= 10.000.000</td> + <td class='text-right'> + <?= + number_format(($jumlah["8"]["1"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["8"]["1"] / ($jumlah["0"]["1"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + <td class='text-right'><?= number_format(($jumlah["8"]["2"]), 0, ',', '.') ?> + </td> + <td class='text-right'> + <?= + number_format(($jumlah["8"]["2"] / ($jumlah["0"]["2"] ?: 1)) * 100, 2, ',', '.') ?> + </td> + </tr> + + </tbody> + </table> + <small class="text-primary">*) Nilai Persentase dibawah 0% berwarna merah</small> + + </div> + </div> + </div> + </div> +</div> + + + +</body> diff --git a/app/Views/rapor/deltabyr.php b/app/Views/rapor/deltabyr.php index c929dd75..8807c9ef 100644 --- a/app/Views/rapor/deltabyr.php +++ b/app/Views/rapor/deltabyr.php @@ -173,13 +173,13 @@ $rentang_tahun = range($tahun2, 2022); </div> </div> <div class="row clearfix"> - <div class="col-lg-3 col-md-6 col-sm-12"> + <div class="col-lg-2 col-md-6 col-sm-12"> <div class="widget"> <div class="widget-body"> <div class="d-flex justify-content-between align-items-center"> <div class="state"> - <h6>WP Bayar <?= $tahunx?> </h6> - <h6></h6> + <h6>WP Terdaftar <?= $tahunx?> </h6> + <h6><b>76.417.527</b></h6> </div> <div class="icon text-green"> <i class="ik ik-award"></i> @@ -190,13 +190,13 @@ $rentang_tahun = range($tahun2, 2022); </div> </div> - <div class="col-lg-3 col-md-6 col-sm-12"> + <div class="col-lg-2 col-md-6 col-sm-12"> <div class="widget"> <div class="widget-body"> <div class="d-flex justify-content-between align-items-center"> <div class="state"> - <h6>WP Bayar <?= $tahunx -1?></h6> - <h6><b></b></h6> + <h6>WP Bayar <?= $tahunx ?></h6> + <h6><b>2.187.232</b></h6> </div> <div class="icon"> <i class="ik ik-thumbs-up text-blue"></i> @@ -207,13 +207,32 @@ $rentang_tahun = range($tahun2, 2022); </div> </div> - <div class="col-lg-3 col-md-6 col-sm-12"> + <div class="col-lg-2 col-md-6 col-sm-12"> <div class="widget"> <div class="widget-body"> <div class="d-flex justify-content-between align-items-center"> <div class="state"> <h6>Ratio % </h6> - <h6></h6> + <h6><b>2.86%</b></h6> + </div> + <div class="icon"> + <i class="ik ik-calendar text-orange"></i> + </div> + </div> + + </small> + </div> + + </div> + </div> + + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>WP Bayar Teratur 2024</h6> + <h6><b>499.765</b></h6> </div> <div class="icon"> <i class="ik ik-calendar text-orange"></i> @@ -225,27 +244,126 @@ $rentang_tahun = range($tahun2, 2022); </div> </div> - <div class="col-lg-3 col-md-6 col-sm-12"> + + <div class="col-lg-2 col-md-6 col-sm-12"> <div class="widget"> <div class="widget-body"> <div class="d-flex justify-content-between align-items-center"> <div class="state"> - <h6>Delta</h6> - - <h6 class="text-left "> - <b></b></h6> + <h6>Ratio Bayar Teratur % </h6> + <h6><b>22,85%</b></h6> + </div> + <div class="icon"> + <i class="ik ik-calendar text-orange"></i> + </div> + </div> + + </small> + </div> + + </div> + </div> + + + </div> + + <div class="row clearfix"> + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>WP Terdaftar <?= $tahunx -1?> </h6> + <h6><b>73.354.233</b></h6> + </div> + <div class="icon text-green"> + <i class="ik ik-award"></i> + </div> + </div> + + </div> + + </div> + </div> + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>WP Bayar <?= $tahunx -1?></h6> + <h6><b>2.447.784</b></h6> </div> <div class="icon"> - <i class="ik ik-alert-triangle "></i> + <i class="ik ik-thumbs-up text-blue"></i> </div> </div> </div> + + </div> + </div> + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Ratio % </h6> + <h6><b>3.34%</b></h6> + </div> + <div class="icon"> + <i class="ik ik-calendar text-orange"></i> + </div> + </div> + + </small> + </div> </div> </div> + + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>WP Bayar Teratur 2023</h6> + <h6><b>490.428</b></h6> + </div> + <div class="icon"> + <i class="ik ik-calendar text-orange"></i> + </div> + </div> + + </small> + </div> + + </div> + </div> + + <div class="col-lg-2 col-md-6 col-sm-12"> + <div class="widget"> + <div class="widget-body"> + <div class="d-flex justify-content-between align-items-center"> + <div class="state"> + <h6>Ratio Bayar Teratur % </h6> + <h6><b>20,03%</b></h6> + </div> + <div class="icon"> + <i class="ik ik-calendar text-orange"></i> + </div> + </div> + + </small> + </div> + + </div> + </div> + + </div> + + </div> </div>