| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /wamp/www/sipapbd_2017_perubahan/application/controllers/ |
Upload File : |
<?php
class Preview extends Core_Laporan{
public function __construct()
{
parent::__construct();
$this->modul_name = 'preview';
//$this->load->model('auth/login_model', 'auth');
$this->xml_file = 'rka.xml';
$this->xml_custom = 'rka_custom.xml';
$this->xml_temp = 'rka_temp.xml';
$report = $this->load->library('report_builder');
$this->report_builder->get_html_menu($this->xml_file, $this->xml_custom, $this->xml_temp);
}
function param($tipe = '', $area = '', $grup = '', $unit = '', $varname = '')
{
if ( $tipe == '' || $area == '' || $grup == '' || $unit == '' )
{
echo 'Parameter tidak lengkap';
return FALSE;
}
$this->tipe = intval($tipe);
$this->area = intval($area);
$this->group = intval($grup);
$this->unit = strval(urldecode($unit));
$this->varname = intval($varname);
if ($varname !== '')
{
$this->reload_param();
}
else
{
$this->get_parameter();
}
}
protected function read_xml()
{
if (! $this->xml = simplexml_load_file($this->path2fr3.$this->xml_temp) )
{
echo 'Laporan tidak ditemukan';
return FALSE;
}
$report = (object) null;
// cek apakah ada laporan custom daerah
if (isset($this->app_config['custom']) && $this->app_config['custom'] != '')
{
$daerah = $this->app_config['custom'];
$report = $this->xml->xpath('//AREA[@id="'.$daerah.'"]//REPORT[@caption="'.$this->unit.'"]');
}
$cek = (array) $report;
if ( empty( $cek ) )
{
// laporan standar
$daerah = 'SEMUA';
$report = $this->xml->xpath('//AREA[@id="'.$daerah.'"]//REPORT[@caption="'.$this->unit.'"]');
}
$cek = (array) $report;
if ( empty( $cek ) ) return FALSE;
$this->fr3 = (string) $report[0]->attributes()->file;
$this->nama_laporan = (string) $report[0]->attributes()->namafile;
return $report[0]->children();
}
function get_search_param(){
$sidx = $this->input->post('sidx') ? $this->input->post('sidx') : 0; // get index row - i.e. user click to sort
$sord = $this->input->post('sord') ? $this->input->post('sord') : ''; // get the direction if(!$sidx) $sidx =1;
// untuk keperluan pencarian
$mode = $this->input->post('m') ? $this->input->post('m') : '';
$q = $this->input->post('q') ? $this->input->post('q') : '';
return array (
"sort_by" => $sidx,
"sort_direction" => $sord,
"search_mode" => $mode,
"q" => $q,
);
}
function proses($tipe = '', $area = '', $grup = '', $unit = '')
{
if ( $tipe == '' || $area == '' || $grup == '' || $unit == '' )
{
echo 'Parameter tidak lengkap';
return FALSE;
}
$format = $this->input->post('format');
$this->tipe = intval($tipe);
$this->area = intval($area);
$this->group = intval($grup);
$this->unit = strval(urldecode($unit));
if (! $report = $this->read_xml() )
{
return FALSE;
}
$param['fr3'] = $this->fr3;
$param['nama'] = $this->nama_laporan;
$param['format'] = $format ? $format : 'pdf';
// parameter default
$param['opt']['tahun'] = $this->tahun;
$param['opt']['status'] = $this->status;
$param['opt']['ppkd'] = $this->ppkd;
$param['opt']['group'] = $this->group;
$param['opt']['skpd_login'] = $this->id_skpd;
$param['opt']['sd'] = $this->sumberdana_rka;
$post = $this->input->post();
foreach( $post as $key => $value )
{
$param['opt'][ $key ] = $value;
}
$tipe = $this->input->post('tipe');
$modul = $this->input->post('modul');
$model = '';
if ($tipe === 'daftar')
{
switch ($modul) {
case 'urusan' : $model = 'urusan/urusan_model'; break;
case 'fungsi' : $model = 'fungsi/fungsi_model'; break;
case 'bidang' : $model = 'bidang/bidang_model'; break;
case 'skpd' : $model = 'skpd/skpd_model'; break;
case 'program' : $model = 'program/program_model'; break;
case 'kegiatan' : $model = 'kegiatan/kegiatan_model'; break;
case 'pejabat_daerah' : $model = 'pejabat_daerah/pejabatdaerah_model'; break;
case 'tim_anggaran' : $model = 'tim_anggaran/tim_anggaran_model'; break;
case 'kategori_rekening' : $model = 'kategori_rekening/kategorirekening_model'; break;
case 'rekening' : $model = 'rekening/rekening_model'; break;
case 'sumber_dana' : $model = 'sumber_dana/sumberdana_model'; break;
case 'lokasi' : $model = 'lokasi/lokasi_model'; break;
case 'dasar_hukum' : $model = 'dasar_hukum/dasarhukum_model'; break;
case 'kua' : $model = 'kua/kua_model'; break;
case 'ssh' : $model = 'ssh/ssh_model'; break;
case 'rekening' : $model = 'rekening/rekening_model'; break;
case 'auditlog' : $model = 'auditlog/auditlog_model'; break;
case 'rka_skpd' : $model = 'rka_skpd/rka_skpd_model'; break;
case 'rka1' : $model = 'rka1/rka1_model'; break;
case 'rka21' : $model = 'rka21/rka21_model'; break;
case 'rka22' : $model = 'rka22/rka22_model'; break;
case 'rka221' : $model = 'rka221/rka221_model'; break;
case 'rka31' : $model = 'rka31/rka31_model'; break;
case 'rka32' : $model = 'rka32/rka32_model'; break;
case 'rkal' : $model = 'rkal/rkal_model'; break;
case 'dpa_skpd' : $model = 'dpa_skpd/dpa_skpd_model'; break;
case 'dpa1' : $model = 'dpa1/dpa1_model'; break;
case 'dpa21' : $model = 'dpa21/dpa21_model'; break;
case 'dpa22' : $model = 'dpa22/dpa22_model'; break;
case 'dpa221' : $model = 'dpa221/dpa221_model'; break;
case 'dpa31' : $model = 'dpa31/dpa31_model'; break;
case 'dpa32' : $model = 'dpa32/dpa32_model'; break;
case 'dpal' : $model = 'dpal/dpal_model'; break;
}
if ($model != '')
{
$search_param = $this->get_search_param();
$this->load->model($model, 'data_model');
$query_str = $this->data_model->get_data($search_param, FALSE, TRUE);
$query_str = preg_replace("/[\n\r]/"," ", $query_str);
$param['opt']['SQLFilter'] = $query_str;
}
}
$this->start($param);
}
}