34
SOURCE CODE APLIKASI comuserpass.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Comuserpass { function Comuserpass(){ $this->CI = &get_instance(); $this->class_name = strtolower(get_class($this)); $this->class_name = $this->content['class_name'] = str_replace('com','',$this->class_name); $this->com_url = $this->content['com_url'] = $_SESSION['section'].'/com/'.$this->class_name.'/'; $this->params = false; } function index(){ $this->content['user_id'] = $user_id = $_SESSION['user_id_sess']; $this->content['user_name'] = $_SESSION['user_name']; $this->CI->load- >com('comuserpass','model',array('name'=>'model_user','alias'=>'com_model') ); $this->content['data'] = $this->CI->com_model->info($user_id); $this->content['header_caption'] = 'Informasi Pengguna &raquo; Ganti Password'; $this->CI->load- >com('comuserpass','view',array('name'=>'user_changepassform','data'=>$this ->content)); } function saveaccount(){ $this->CI->load->library('encrypt'); $user_id = $this->CI->input->post('user_id'); if($this->CI->input->post('useracc_password') != $this->CI->input- >post('useracc_password_2')){ echo 'gagal-Password pertama dan ke dua tidak sama!'; }else{ $this->CI->load- >com('comuserpass','model',array('name'=>'model_user','alias'=>'com_model') ); $response = $this->CI->com_model->change_password(); $_SESSION['user_id'] = $user_id; $_SESSION['user_id_sess'] = $user_id; $this->CI->output- >set_header('Contents-Type:application/json'); $this->CI->output->set_output(json_encode($response)); } } }

Source Code Aplikasi

Embed Size (px)

DESCRIPTION

Isi aplikasi

Citation preview

Page 1: Source Code Aplikasi

SOURCE CODE APLIKASI

comuserpass.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Comuserpass { function Comuserpass(){ $this->CI = &get_instance(); $this->class_name = strtolower(get_class($this)); $this->class_name = $this->content['class_name'] = str_replace('com','',$this->class_name); $this->com_url = $this->content['com_url'] = $_SESSION['section'].'/com/'.$this->class_name.'/'; $this->params = false; } function index(){ $this->content['user_id'] = $user_id = $_SESSION['user_id_sess']; $this->content['user_name'] = $_SESSION['user_name']; $this->CI->load->com('comuserpass','model',array('name'=>'model_user','alias'=>'com_model') ); $this->content['data'] = $this->CI->com_model->info($user_id); $this->content['header_caption'] = 'Informasi Pengguna &raquo; Ganti Password'; $this->CI->load->com('comuserpass','view',array('name'=>'user_changepassform','data'=>$this->content)); } function saveaccount(){ $this->CI->load->library('encrypt'); $user_id = $this->CI->input->post('user_id'); if($this->CI->input->post('useracc_password') != $this->CI->input->post('useracc_password_2')){ echo 'gagal-Password pertama dan ke dua tidak sama!'; }else{ $this->CI->load->com('comuserpass','model',array('name'=>'model_user','alias'=>'com_model')); $response = $this->CI->com_model->change_password(); $_SESSION['user_id'] = $user_id; $_SESSION['user_id_sess'] = $user_id; $this->CI->output->set_header('Contents-Type:application/json'); $this->CI->output->set_output(json_encode($response)); } }}

?>

comuser_pengguna.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');

Page 2: Source Code Aplikasi

class Comuser_pengguna extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; // setting tambahan untuk sub_com $this->com_name = 'comuser_pengguna'; $params->lib['com_url'] = 'admin/com/user_pengguna/'; $params->lib['class_name'] = 'comuser_pengguna'; $params->lib['header_caption'] = 'Pengaturan Pengguna &raquo; Daftar Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $onclick = '<button onclick="'.$params->lib['class_name'].'grid.extra.pilihwilayah();"> Pilih </button>'; $params->gridlib['arr_colModel']["wilayah"]['formoptions']['elmsuffix'] = $onclick; parent::__construct($params); } function comjs_features($params=false){ parent::comjs_features($params); $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com('comuser_pengguna','view',$conf_view_features); unset($this->content['grid']['toolbar']['search']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['excel']); } function selectgroup(){ $data=$this->CI->db->get('c_group')->result(); $this->CI->load->com('comuser_pengguna','model',array('name'=>'user_pengguna_model','alias'=>'com_model')); $this->content['data'] = $this->CI->com_model->group(); $this->CI->load->com('comuser_pengguna','view',array('name'=>'default','data'=>$this->content)); } function formaction(){ if($this->CI->input->post('oper')=='edit'){ $this->CI->load->com('comuser_pengguna','model',array('name'=>'user_pengguna_model','alias'=>'com_model'));

Page 3: Source Code Aplikasi

$dataUser = $this->CI->com_model->userAccount(); echo json_encode($dataUser); }else{ parent::formaction(); } } function checkgroup(){ $this->responce = array('result'=>'success','id_group'=>$this->CI->input->post('id_group')); echo json_encode($this->responce); }}?>

comuser.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comuser extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; // setting tambahan untuk sub_com $this->com_name = 'comuser'; $params->lib['com_url'] = 'admin/com/user/'; $params->lib['class_name'] = 'comuser'; $params->lib['header_caption'] = 'Pengaturan Pengguna &raquo; Daftar Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $this->CI->load->com($params->lib['class_name'],'model',array('name'=>'user_model','alias'=>'com_model')); $params->gridlib['arr_colModel']['id_skpd_sotk']['editoptions']['value'] = $this->CI->com_model->optskpd(); parent::__construct($params); } function comjs_features($params=false){ parent::comjs_features($params); $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com('comuser','view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true

Page 4: Source Code Aplikasi

); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']['search']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['excel']); } function selectgroup(){ $data=$this->CI->db->get('c_group')->result(); $this->content['data'] = $this->CI->com_model->group(); $this->CI->load->com('comuser','view',array('name'=>'default','data'=>$this->content)); } function formaction(){ if($this->CI->input->post('oper')=='edit'){ $dataUser = $this->CI->com_model->userAccount(); echo json_encode($dataUser); }else{ parent::formaction(); } } function checkgroup(){ $this->responce = array('result'=>'success','id_group'=>$this->CI->input->post('id_group')); echo json_encode($this->responce); }}?>

comonline.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comonline extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/online/'; $params->lib['class_name'] = 'comonline'; $params->lib['header_caption'] = 'Pengguna &raquo; Pengguna Online'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); parent::__construct($params); } function comjs_features($params=false){ parent::comjs_features($params); unset($this->content['comjs_features']['toolbar']); }}?>

Page 5: Source Code Aplikasi

commstuser.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Commstuser extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'commstuser'; $params->lib['com_url'] = 'admin/com/mstuser/'; $params->lib['class_name'] = 'commstuser'; $params->lib['header_caption'] = 'Pengaturan Pengguna &raquo; Daftar Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $this->user_id = $_SESSION['user_id']; parent::__construct($params); } function comjs_features(){ parent::comjs_features(); $this->content['id_session_user'] = $this->user_id; $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); } function form(){ $this->content['oper'] = $oper = $this->CI->input->post('oper'); if($oper=='add'){ $this->content['id_session_user'] = $_SESSION['user_id']; }else{ $this->content['id_session_user'] = $_SESSION['user_id'] = $this->CI->input->post('id_session_user'); } $user_id_unik = $this->CI->input->post('user_id_unik'); $user_id_unik = $this->CI->input->post('user_id_unik');

$this->CI->load->

Page 6: Source Code Aplikasi

com('commstuser','model',array('name'=>'model_mstuser','alias'=>'com_model')); $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model_mstuser','alias'=>'com_model')); if($oper=='edit'){ $this->content['data'] = @$data = $this->CI->com_model->getdata($user_id_unik); @$id_group = $data->id_group; @$id_jns_sekolah = $data->id_jns_sekolah; } $this->content['id_group'] = $this->CI->com_model->arrgroup(@$id_group); $this->CI->load->com($this->lib['class_name'],'view',array('name'=>'forminput','data'=>$this->content)); } function formaction(){ $this->CI->load->com('commstuser','model',array('name'=>'model_mstuser','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); }}?>

commstpass.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');panel_loadmodul('grid');class Commstpass extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'commstpass'; $params->lib['com_url'] = 'admin/com/mstpass/'; $params->lib['class_name'] = 'commstpass'; $params->lib['header_caption'] = 'Pengaturan Pengguna &raquo; Daftar Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $this->user_id = $_SESSION['user_id']; parent::__construct($params); }

function comjs_features(){ parent::comjs_features();

Page 7: Source Code Aplikasi

$this->content['id_session_user'] = $this->user_id; $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']['plus']); unset($this->content['grid']['toolbar']['search']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); } function form_reset(){ $this->content['user_id'] = $this->CI->input->post('user_id'); $conf_view_features = array( 'name'=>'form_reset', 'data'=>$this->content, 'return'=>false ); $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); } function reset_pass(){ $user_id = $this->CI->input->post('user_id'); $this->CI->db->set('user_password','7c4a8d09ca3762af61e59520943dc26494f8941b'); $this->CI->db->where('user_id',$user_id); if($this->CI->db->update('c_user')){ echo json_encode(array('result'=>'success','msg'=>'Password berhasil di reset!')); }else{ echo json_encode(array('result'=>'failed','msg'=>'Password tidak berhasil di reset')); } }

}?>

commenu.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');panel_loadmodul('grid');class Commenu extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/menu/'; $params->lib['class_name'] = 'commenu'; $params->lib['header_caption'] = 'Pengaturan Menu &raquo; Daftar Menu';

Page 8: Source Code Aplikasi

// ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); parent::__construct($params); } function comjs_features(){ parent::comjs_features(); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['pdf']); }}?>

cominfopengguna.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class Cominfopengguna { function cominfopengguna(){ $this->CI = &get_instance(); $this->CI->auth->restrict(); $this->class_name = strtolower(get_class($this)); $this->class_name = $this->content['class_name'] = str_replace('com','',$this->class_name); $this->com_url = $this->content['com_url'] = $_SESSION['section'].'/com/'.$this->class_name.'/'; $this->params = false; } function index(){ $this->content['user_id'] = $_SESSION['user_id']; $this->content['user_name'] = $_SESSION['user_name']; $this->content['header_caption'] = "Informasi Pengguna &raquo; Info Pengguna";

$this->CI->load->com('cominfopengguna','model',array('name'=>'model_user','alias'=>'com_model') ); $user_id = $_SESSION['user_id']; $this->content['data'] = $this->CI->com_model->info($user_id); $this->CI->load->com('cominfopengguna','view',array('name'=>'user_changepassform','data'=>$this->content)); }

function saveaccount(){ $this->CI->load->library('encrypt'); $user_id = $_SESSION['user_id']; $this->CI->load->com('cominfopengguna','model',array('name'=>'model_user','alias'=>'com_model')); $change_pass = $this->CI->com_model->change_password(); }}

Page 9: Source Code Aplikasi

?>

comhome.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Comhome { function __construct(){ $this->CI = & get_instance(); $this->com_url = 'admin/com/home/'; $this->class_name = 'comhome'; } function index($arr_par=array()){ $data = $arr_par; $this->CI->load->view($this->CI->template->viewPath."home/index",$data); }}?>

comgroupuser.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comgroupuser extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/groupuser/'; $params->lib['class_name'] = 'comgroupuser'; $params->lib['header_caption'] = 'Pengaturan Pengguna &raquo; Grup Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); parent::__construct($params); }}?>

comgroupmenu.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comgroupmenu extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/groupmenu/'; $params->lib['class_name'] = 'comgroupmenu';

Page 10: Source Code Aplikasi

$params->lib['header_caption'] = 'Pengaturan Menu &raquo; Setup Group Pengguna'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } if(! $this->CI->input->post('id_group')){ unset($params->model['query']['query_table'][0]['arr_params'][2]); } parent::__construct($params); } function comjs_features(){ parent::comjs_features(); $gridcomplete_config = array('name'=>'comjs_gridcomplete','return'=>true); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$gridcomplete_config); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); } function formaction(){ $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model_groupmenu','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); } function griddata(){ parent::griddata(); }}?>

comadminmstskpd.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstskpd extends Grid{ function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstskpd/'; $params->lib['class_name'] = 'comadminmstskpd'; $params->lib['header_caption'] = 'Data Master &raquo; SKPD &raquo; Daftar SKPD'; // =========================================================

Page 11: Source Code Aplikasi

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } parent::__construct($params); } function comjs_features(){ parent::comjs_features(); $gridcomplete_config = array('name'=>'comjs_gridcomplete','return'=>true); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$gridcomplete_config); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['search']); }} ?>

comadminmstskpdpersotk.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstskpdpersotk extends Grid{ function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'comadminmstskpdpersotk'; $params->lib['com_url'] = 'admin/com/adminmstskpdpersotk/'; $params->lib['class_name'] = 'comadminmstskpdpersotk'; $params->lib['header_caption'] = 'Data Master &raquo; SKPD &raquo; SKPD Per SOTK'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } $params->gridlib['grid']['opt']['postData']['id_skpd_sotk'] = 0; parent::__construct($params); }

Page 12: Source Code Aplikasi

function comjs_features($params=false){ parent::comjs_features($params); $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com('comadminmstskpdpersotk','view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com('comadminmstskpdpersotk','view',$conf_view_features); // unset($this->content['grid']['toolbar']['plus']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['search']); } function cekstatus(){ $aturan = $this->CI->input->post('id_aturan_skpd'); $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model_aturan')); $status = $this->CI->model_aturan->aturan_on($aturan); echo json_encode($status); } function urut(){ $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model_aturan','alias'=>'com_model')); $oper = $this->CI->input->post('oper'); $no_urut = $this->CI->input->post('no_urut'); $no_urut_dest = $this->CI->input->post('no_urut_dest'); $data = $this->CI->com_model->urutan($oper,$no_urut,$no_urut_dest); $new_data = array(); foreach($data as $row){ $new_data[] = $row; } echo json_encode($new_data); }

} ?>

comadminbtlpos.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminbtlpos extends Grid { function __construct($config=array()){ $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'comadminbtlpos'; $params->lib['com_url'] = 'admin/com/adminbtlpos/'; $params->lib['class_name'] = 'comadminbtlpos';

Page 13: Source Code Aplikasi

$params->lib['header_caption'] = 'History &raquo; Berdasarkan POS Belanja'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $this->CI->load->com($params->lib['class_name'],'model',array('name'=>'model_extra')); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } $params->model['r_rinci_hir']['query']['query_filter']=array( 'id_akun_jenis'=>array( 'type'=>'where' ,'field'=>'a.id_akun_jenis' ,'name'=>'id_akun_jenis' ,'value'=>$this->CI->input->post('n_level')+1 ), 'kode_path'=>array( 'type'=>'like' ,'field'=>'a.kode_path' ,'name'=>'kode_path' ,'value'=>$this->CI->input->post('kode_path') ,'extra'=>'after' ),

'id_tahapan'=>array(

'type'=>'where' ,'field'=>'c.id_tahapan' ,'name'=>'id_tahapan' ,'value'=>$this->CI->input->post('id_tahapan') ) ); parent::__construct($params); } function griddata(){ parent::griddata(); $id_tahapan = @$this->CI->input->post('id_tahapan'); $total = @$this->CI->model_extra->gettotal($id_tahapan); $data = array(); $data = $this->CI->output->get_output(); $hasil = json_decode($data); $new_data = new stdClass(); foreach($hasil->rows as $key=>$row){ if($row->n_level==5){ $hasil->rows[$key]->isLeaf = true; } } $userdata = array('uraian'=>'Total','jumlah_murni'=>@$total); $new_data->rows = $hasil->rows; $new_data->userdata = $userdata; $this->CI->output->set_output(json_encode($new_data)); }

Page 14: Source Code Aplikasi

function comjs_features($params=false){ parent::comjs_features($params);

$conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete_tree', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['comjs_features']['toolbar']); } function getdataheader(){ $id_tahapan = $this->CI->input->post('id_tahapan'); $hasil = $this->CI->model_extra->getdataheader($id_tahapan); echo json_encode($hasil); } function cekdata(){ $id_tahapan = $this->CI->input->post('id_tahapan'); $cekdata = $this->CI->model_extra->cekdata($id_tahapan); echo json_encode($cekdata); }}?>

comadminbtlskpd.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminbtlskpd extends Grid { function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'comadminbtlskpd'; $params->lib['com_url'] = 'admin/com/adminbtlskpd/'; $params->lib['class_name'] = 'comadminbtlskpd'; $params->lib['header_caption'] = 'History &raquo; Berdasarkan SKPD'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $this->CI->load->com($params->lib['class_name'],'model',array('name'=>'model_extra')); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); }

Page 15: Source Code Aplikasi

parent::__construct($params); }

function comjs_features($params=false){ parent::comjs_features($params);

$conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['comjs_features']['toolbar']); } function griddata(){ parent::griddata(); $data = $this->CI->output->get_output(); $hasil = json_decode($data); $idtahapan = @$this->CI->input->post('id_tahapan'); foreach($hasil->rows as $key=>$row){ $id_anggaran = $this->CI->model_extra->getAnggaranId(@$row->id_skpd,@$idtahapan); $this->CI->db->select('jumlah_murni'); $this->CI->db->where(array('id_parent'=>0,'id_skpd'=>@$row->id_skpd,'id_anggaran'=>$id_anggaran,'id_anggaran_bl'=>null)); $total_kegiatan = @$this->CI->db->get('r_rinci_hir')->row()->jumlah_murni; $hasil->rows[$key]->usulan = $total_kegiatan; } $total_all_kegiatan = $this->CI->model_extra->total_all_kegiatan(@$idtahapan); $userdata = array('nama_lengkap'=>'Total','usulan'=>@$total_all_kegiatan); $new_data = new stdClass(); $new_data->rows = $hasil->rows; $new_data->userdata = $userdata; $this->CI->output->set_output(json_encode($new_data)); } function getdataheader(){ $id_tahapan = @$this->CI->input->post('id_tahapan'); $hasil = $this->CI->model_extra->getdataheader($id_tahapan); echo json_encode($hasil); }

}?>

comadminhistory.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminhistory extends Grid { function __construct(){ $this->CI = & get_instance(); $params = new stdClass;

Page 16: Source Code Aplikasi

$this->com_name = 'comadminhistory'; $params->lib['com_url'] = 'admin/com/adminhistory/'; $params->lib['class_name'] = 'comadminhistory'; $params->lib['base_com_url'] = 'admin/com/adminhistory/'; $params->lib['header_caption'] = '&raquo; History';

$this->CI->load->com('comadminhistory','model',array('name'=>'model','alias'=>'com_model')); // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } if(@$this->CI->input->post('id_key')){ if(substr_count('akun',$this->CI->input->post('id_key')==0)){ $params->model['query']['r_rinci_hir']['query_table']['value']= $_SESSION['id_skpd']; } } $id_skpd = $_SESSION['id_skpd']; $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); $this->id_tahapan = $this->CI->input->post('id_tahapan'); if(!$id_anggaran){ $this->CI->db->set('id_tahapan',$this->id_tahapan); $this->CI->db->set('id_skpd',$id_skpd); $this->CI->db->set('id_anggaran_jenis',2); $this->CI->db->insert('r_anggaran'); $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); } $params->gridlib['grid']['opt']['postData']['id_anggaran'] = $id_anggaran; $params->gridlib['grid']['opt']['postData']['id_skpd'] = $id_skpd; $params->gridlib['grid']['opt']['postData']['id_akun_root'] = 4; $params->model['r_rinci_hir']['query']['query_filter']=array( 'id_parent'=>array( 'type'=>'where' ,'field'=>'a.id_parent' ,'name'=>'id_key' ), 'id_anggaran_bl'=>array( 'type'=>'where' ,'field'=>'a.id_anggaran_bl' ,'name'=>'id_anggaran_bl' ,'value'=>null ), 'id_anggaran'=>array( 'type'=>'where' ,'field'=>'a.id_anggaran'

Page 17: Source Code Aplikasi

,'name'=>'id_anggaran' ,'value'=>$id_anggaran ), 'id_skpd'=>array( 'type'=>'where' ,'field'=>'a.id_skpd' ,'name'=>'id_skpd' ,'value'=>$id_skpd ), 'id_akun_root'=>array( 'type'=>'where' ,'field'=>'a.id_akun_root' ,'name'=>'id_akun_root' ,'value'=>4 ), 'id_tahapan'=>array( 'type'=>'where' ,'field'=>'a.id_tahapan' ,'name'=>'id_tahapan' ,'value'=>$this->CI->input->post('id_tahapan') ), ); parent::__construct($params); } function griddata(){ parent::griddata(); $id_skpd = $this->CI->input->post('id_skpd'); $id_anggaran = $this->CI->input->post('id_anggaran'); $id_prokeg = $this->CI->input->post('id_prokeg'); $id_anggaran_bl = $this->CI->input->post('id_anggaran_bl'); $id_tahapan = @$this->id_tahapan; $this->CI->db->select('jumlah_murni'); $this->CI->db->where(array('id_parent'=>0,'id_skpd'=>$id_skpd,'id_anggaran'=>$id_anggaran,'id_anggaran_bl'=>null,'id_tahapan'=>@$id_tahapan)); $total_kegiatan = @$this->CI->db->get('r_rinci_hir')->row()->jumlah_murni; $data = array(); $data = $this->CI->output->get_output(); $hasil = json_decode($data); $userdata = array('uraian'=>'Total','jumlah'=>@$total_kegiatan); $xx = new stdClass(); $xx->rows = $hasil->rows; $xx->userdata = $userdata; $this->CI->output->set_output(json_encode($xx)); }

function pilih(){ $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'comgrid3a_model')); $this->CI->comgrid3a_model->simpan(); } function index_segments($params=false){ parent::index_segments($params); $id_skpd = $_SESSION['id_skpd']; $id_anggaran = @$this->CI->com_model->getAnggaranId($id_skpd);

Page 18: Source Code Aplikasi

$this->content['id_anggaran'] = (!@$id_anggaran)?9999999999:@$id_anggaran; $this->content['id_skpd'] = $id_skpd; $this->content_default['segments']['head'] = $this->CI->load->com($this->lib['class_name'],'view',array('name'=>'default','data'=>$this->content ,'return'=>true)); } function comjs_features($params=false){ parent::comjs_features($params); $id_skpd = $_SESSION['id_skpd']; $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); $this->content['id_anggaran'] = (!$id_anggaran)?9999999999:$id_anggaran; $this->content['id_skpd'] = $id_skpd;

$conf_view_features = array( 'name'=>'comjs_gridcomplete_tree', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']); } }?>

comadminmstakunaturan.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstakunaturan extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstakunaturan/'; $params->lib['class_name'] = 'comadminmstakunaturan'; $params->lib['header_caption'] = 'Data Master &raquo; Rekening Anggaran &raquo; Aturan Rekening'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); parent::__construct($params); } function formaction(){ $this->CI->load->com('comadminmstakunaturan','model',array('name'=>'comadminmstakunaturan_model','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); } function comjs_features(){ parent::comjs_features(); $conf_gridcomplete = array(

Page 19: Source Code Aplikasi

'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_gridcomplete);

$conf_extra = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_extra);

unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['search']); }}?>

comadminmstakunitem.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstakunitem extends Grid{ function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstakunitem/'; $params->lib['class_name'] = 'comadminmstakunitem'; $params->lib['header_caption'] = 'Data Master &raquo; Rekening Anggaran &raquo; Master Rekening'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } // ============================================================ parent::__construct($params); } function comjs_features($params=false){ parent::comjs_features($params); $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com('comadminmstakunitem','view',$conf_view_features);

Page 20: Source Code Aplikasi

$conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com('comadminmstakunitem','view',$conf_view_features); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); } function formaction(){ $this->CI->load->com('comadminmstakunitem','model',array('name'=>'comadminmstakunitem_model','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); } function getjenis(){ $idjenis = $this->CI->input->post('id_akun_jenis'); $idjenis_row = $this->CI->input->post('idjenis_row'); $this->CI->load->com('comadminmstakunitem','model',array('name'=>'comadminmstakunitem_model','alias'=>'com_model')); $akunjenis = $this->CI->com_model->jenis(@$idjenis,@$idjenis_row); echo json_encode($akunjenis); }} ?>

comadminmstakunjenis.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstakunjenis extends Grid{ function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstakunjenis/'; $params->lib['class_name'] = 'comadminmstakunjenis'; $params->lib['header_caption'] = 'Data Master &raquo; Rekening Anggaran &raquo; Hirarki Rekening'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main');

$this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); $params->lib['gf_form'] = $this->CI->config->item('lib'); if($params->lib['gf_form']){ $params->lib = array_merge($params->lib,$params->lib['gf_form']); } // ============================================================ parent::__construct($params); } function comjs_features(){

Page 21: Source Code Aplikasi

parent::comjs_features(); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); } function formaction(){ if($this->CI->input->post('oper') == 'del'){ $id_akun_jenis = $this->CI->input->post('id_akun_jenis'); $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model_akunjenis','data'=>$this->content,'return'=>true)); $data->rows = $this->CI->model_akunjenis->del($id_akun_jenis); $this->CI->output->set_output(json_encode($data)); }else{ parent::formaction(); } }} ?>

comadminmstdaftartahapan.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class comadminmstdaftartahapan extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstdaftartahapan/'; $params->lib['class_name'] = 'comadminmstdaftartahapan'; $params->lib['header_caption'] = 'Periode / Tahapan &raquo; Tahapan Anggaran'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib');

$this->CI->load->com($params->lib['class_name'],'model',array('name'=>'model_daftarkelompok'));

$params->gridlib['arr_colModel']['status']['editoptions']['value'] = array('pending'=>'PENDING','off'=>'OFF','on'=>'ON');

Page 22: Source Code Aplikasi

// $params->gridlib['arr_colModel']['id_prokeg_setting']['editoptions']['value'] = $this->CI->model_daftarkelompok->get_prokeg_setting(); $params->gridlib['arr_colModel']['id_akun_aturan']['editoptions']['value'] = $this->CI->model_daftarkelompok->get_akun_setting(); $params->gridlib['arr_colModel']['id_periode']['editoptions']['value'] = $this->CI->model_daftarkelompok->tahun_anggaran(); $params->gridlib['arr_colModel']['id_aturan_skpd']['editoptions']['value'] = $this->CI->model_daftarkelompok->get_skpd_setting(); // dump($this->CI->model_daftarkelompok->get_skpd_setting()); parent::__construct($params); } function comjs_features(){ parent::comjs_features(); $conf_view_features = array( 'name'=>'comjs_gridcomplete', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',$conf_view_features); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['search']); } function formaction(){ if($this->CI->input->post('status') == 'on'){ $this->CI->model_daftarkelompok->reset(); parent::formaction(); }else{ parent::formaction(); } }}?>

comadminmstsotk.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comadminmstsotk extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminmstsotk/'; $params->lib['class_name'] = 'comadminmstsotk'; $params->lib['header_caption'] = 'Data Master &raquo; SKPD &raquo; Daftar SOTK'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); parent::__construct($params); } function comjs_features(){ parent::comjs_features();

Page 23: Source Code Aplikasi

$this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',array('name'=>'comjs_gridcomplete','data'=>$this->content,'return'=>true)); unset($this->content['grid']['toolbar']['search']); unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['pdf']); } function formaction(){ $this->CI->load->com('comadminmstsotk','model',array('name'=>'comadminmstsotk_model','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); }}?>

comadminthnanggaran.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class comadminthnanggaran extends Grid { function __construct(){ // =============================== $this->CI = & get_instance(); $params = new stdClass; $params->lib['com_url'] = 'admin/com/adminthnanggaran/'; $params->lib['class_name'] = 'comadminthnanggaran'; $params->lib['header_caption'] = 'Periode / Tahapan &raquo; Periode Anggaran'; // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model')); $params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib');

// $status = array('ON'=>'ON','OFF'=>'OFF'); // $params->gridlib['arr_colModel']['status']['editoptions']['value'] = $status;

$params->gridlib['arr_colModel']['status']['editoptions']['value'] = array('off'=>'OFF','on'=>'ON'); parent::__construct($params); } function formaction(){ // $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); } function comjs_features(){ parent::comjs_features(); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com($this->lib['class_name'],'view',array('name'=>'comjs_gridcomplete','data'=>$this->content,'return'=>true)); unset($this->content['grid']['toolbar']['excel']);

Page 24: Source Code Aplikasi

unset($this->content['grid']['toolbar']['word']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['search']); } }?>

commasainput.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once(DOC_PATH_APP.'libraries/modul/grid/grid.php');class Commasainput extends Grid{

function Commasainput(){ $this->CI =& get_instance(); $this->view_path = 'com/commasainput/'; $this->lib['com_url'] = 'admin/com/masainput/'; $this->lib['class_name'] = 'commasainput'; $this->com_name = 'commasainput'; $this->lib['header_caption'] = 'Set PPTK';

$this->content['com_url'] = $this->com_url = 'admin/com/masainput/'; $this->content['class_name'] = $this->class_name = 'commasainput'; $this->CI->load->com('commasainput','model',array('name'=>'model','alias'=>'com_model')); } function index(){ $this->content['thn'] = @$this->CI->com_model->getthn(); $this->content['tgl'] = @$this->CI->com_model->gettgl(); $this->CI->load->com('commasainput','view',array('name'=>'default','data'=>@$this->content)); } function formaction(){ $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); }}?>

comrencanabelanjatidaklangsung.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); panel_loadmodul('grid');class Comrencanabelanjatidaklangsung extends Grid { function __construct(){ $this->CI = & get_instance(); $params = new stdClass; $this->com_name = 'comrencanabelanjatidaklangsung'; $params->lib['com_url'] = 'admin/com/rencanabelanjatidaklangsung/'; $params->lib['class_name'] = 'comrencanabelanjatidaklangsung'; $params->lib['base_com_url'] = 'admin/com/rencanabelanjalangsung/'; $params->lib['header_caption'] = '&raquo; Belanja Tidak Langsung';

$this->CI->load->com('comrencanabelanjatidaklangsung','model',array('name'=>'comrencanabelanjatidaklangsung_model','alias'=>'com_model')); // ========================================================= $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'main_model'));

Page 25: Source Code Aplikasi

$params->model = $this->CI->config->item('model_main'); $this->CI->load->com($params->lib['class_name'],'config',array('name'=>'grid')); $params->gridlib = $this->gridlib = $this->CI->config->item('gridlib'); if(@$this->CI->input->post('id_key')){ if(substr_count('akun',$this->CI->input->post('id_key')==0)){ $params->model['query']['r_rinci_hir']['query_table']['value']= $_SESSION['id_skpd']; } } $id_skpd = $_SESSION['id_skpd']; $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); if(!$id_anggaran){ $tahapan = $this->CI->db->where('status','on')->get('m_tahapan')->row()->id_tahapan; $this->CI->db->set('id_tahapan',$tahapan); $this->CI->db->set('id_skpd',$id_skpd); $this->CI->db->set('id_anggaran_jenis',2); $this->CI->db->insert('r_anggaran'); $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); } $params->gridlib['grid']['opt']['postData']['id_anggaran'] = $id_anggaran; $params->gridlib['grid']['opt']['postData']['id_skpd'] = $id_skpd; $params->gridlib['grid']['opt']['postData']['id_akun_root'] = 4; parent::__construct($params); } function griddata(){ parent::griddata(); $id_skpd = $this->CI->input->post('id_skpd'); $id_anggaran = $this->CI->input->post('id_anggaran'); $id_prokeg = $this->CI->input->post('id_prokeg'); $id_anggaran_bl = $this->CI->input->post('id_anggaran_bl'); $this->CI->db->select('jumlah_murni'); $this->CI->db->where(array('id_parent'=>0,'id_skpd'=>$id_skpd,'id_anggaran'=>$id_anggaran,'id_anggaran_bl'=>null)); $total_kegiatan = @$this->CI->db->get('r_rinci_hir')->row()->jumlah_murni; $data = array(); $data = $this->CI->output->get_output(); $hasil = json_decode($data); $userdata = array('uraian'=>'Total','jumlah'=>@$total_kegiatan); $xx = new stdClass(); $xx->rows = $hasil->rows; $xx->userdata = $userdata; $this->CI->output->set_output(json_encode($xx)); }

function pilih(){ $this->CI->load->com('comrencanabelanjatidaklangsung','model',array('name'=>'comgrid3a_model')); $this->CI->comgrid3a_model->simpan();

Page 26: Source Code Aplikasi

} function index_segments($params=false){ parent::index_segments($params); $id_skpd = $_SESSION['id_skpd']; $id_tahapan = @$this->CI->db->where('status','on')->get('m_tahapan')->row()->id_tahapan; $id_anggaran = @$this->CI->com_model->getAnggaranId($id_skpd); $this->content['id_anggaran'] = (!@$id_anggaran)?9999999999:@$id_anggaran; $this->content['id_skpd'] = $id_skpd; $this->content_default['segments']['head'] = $this->CI->load->com('comrencanabelanjatidaklangsung','view',array('name'=>'default','data'=>$this->content ,'return'=>true)); } function comjs_features($params=false){ parent::comjs_features($params); $id_skpd = $_SESSION['id_skpd']; $id_anggaran = $this->CI->com_model->getAnggaranId($id_skpd); $this->content['id_anggaran'] = (!$id_anggaran)?9999999999:$id_anggaran; $this->content['id_skpd'] = $id_skpd;

$conf_view_features = array( 'name'=>'comjs_extra', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['comjs_extra'] = $this->CI->load->com('comrencanabelanjatidaklangsung','view',$conf_view_features); $conf_view_features = array( 'name'=>'comjs_gridcomplete_tree', 'data'=>$this->content, 'return'=>true ); $this->content['comjs_features']['gridcomplete'] = $this->CI->load->com('comrencanabelanjatidaklangsung','view',$conf_view_features); unset($this->content['grid']['toolbar']['search']); unset($this->content['grid']['toolbar']['excel']); unset($this->content['grid']['toolbar']['pdf']); unset($this->content['grid']['toolbar']['word']); } function tambahRinci(){ $this->CI->load->com('comrencanabelanjatidaklangsung','view',array('name'=>'formRinci')); } function formaction(){ $this->CI->load->com('comrencanabelanjatidaklangsung','model',array('name'=>'comrencanabelanjatidaklangsung_model','alias'=>'com_model')); $hasil = $this->CI->com_model->simpan_rinci(); echo json_encode($hasil); }

}?>

comreportbl.php

Page 27: Source Code Aplikasi

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once(DOC_PATH_APP.'libraries/modul/grid/grid.php');class Comreportbl extends Grid{

function Comreportbl(){ $this->CI =& get_instance(); $this->view_path = 'com/comreportbl/'; $this->lib['com_url'] = 'admin/com/reportbl/'; $this->lib['class_name'] = 'comreportbl'; $this->com_name = 'comreportbl'; $this->lib['header_caption'] = 'Report &raquo; Belanja Langsung';

$this->content['com_url'] = $this->com_url = 'admin/com/reportbl/'; $this->content['class_name'] = $this->class_name; $this->CI->load->com($this->lib['class_name'],'model',array('name'=>'model','alias'=>'com_model')); } function index(){ $this->content['thn'] = @$this->CI->com_model->getthn(); $this->content['tgl'] = @$this->CI->com_model->gettgl(); $this->CI->load->com('comreportbl','view',array('name'=>'default','data'=>@$this->content)); } function formaction(){ $hasil = $this->CI->com_model->simpan(); echo json_encode($hasil); } function download(){ $data = @$this->CI->com_model->getdata(); $this->CI->load->library('myexcel'); $style1 = array('alignment' => array('horizontal'=>'center')); $style2 = array( 'alignment' => array('horizontal' => 'center'), 'font' => array('bold' => true,'size' => 11) ); $style3 = array('font' => array('size' => 11, 'name' => 'Arial'), 'alignment' => array('horizontal' => 'left', 'vertical' => 'center', 'wrap' => true)); $this->CI->myexcel->getActiveSheet()->getStyle('A1:M2')->applyFromArray($style2); $this->CI->myexcel->writeRow('A1:M1','DAFTAR PERUSAHAAN INDUSTRI'); $xcell = array( array('urut','No.',5), array('nama_perusahaan','Nama Perusahaan',25), array('nama_kelurahan','Kel.',15), array('nama_kecamatan','Kec.',15), array('telp_perusahaan','Telp.',15), array('nama_jenis_komoditi','JENIS KOMODITI',15), array('kbli','KBLI',10), array('jumlah_pertahun','NILAI',10), array('nama_satuan','SATUAN',10), array('nilai_investasi','Nilai. Inv. Rp. 000',20), array('tk','TK',8), array('nama_jenis_izin','JENIS',10), array('nama_kategori_perusahaan','KATEGORI',15), ); $col = 0; $xc = "A"; foreach($xcell as $k=>$c): $this->CI->myexcel->getActiveSheet()->getColumnDimension($xc)->setWidth($c[2]);

Page 28: Source Code Aplikasi

$this->CI->myexcel->writeRow(array($col,5),$c[1]); $this->CI->myexcel->writeRow(array($col++,6),$col); $xc++; endforeach; $styleArray = array( 'borders' => array( 'allborders' => array( 'style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => PHPExcel_Style_Color::COLOR_BLACK), ), ), 'alignment' => array( 'horizontal' => 'left', 'wrap' => true, ), ); $this->CI->myexcel->writeRow('A4:A5','NO'); $this->CI->myexcel->writeRow('B4:B5','NAMA PERUSAHAAN'); $this->CI->myexcel->writeRow('C4:C5','KEL'); $this->CI->myexcel->writeRow('D4:D5','KEC.'); $this->CI->myexcel->writeRow('E4:E5','TELP'); $this->CI->myexcel->writeRow('G4:I4','KAP. PROD.'); $this->CI->myexcel->writeRow('J4:J5','NILAI INV Rp. 000'); $this->CI->myexcel->writeRow('K4:K5','TK'); $this->CI->myexcel->writeRow('L4:L5','JENIS IZIN'); $this->CI->myexcel->writeRow('M4:M5','KATEGORI'); $start = 6; $row = $start ; $now = date('Y'); $this->CI->myexcel->getActiveSheet()->getStyle('A4:M'.($row-1))->applyFromArray($styleArray); $this->CI->myexcel->getActiveSheet()->getStyle('A4:M5')->applyFromArray(array( 'font' => array( 'bold' => true, 'size' => 10, ), 'alignment'=>array('horizontal'=>'center') )); $this->CI->myexcel->getActiveSheet()->getStyle('A6:A'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'center') )); $this->CI->myexcel->getActiveSheet()->getStyle('A6:M'.($row-1))->applyFromArray(array( 'alignment'=>array('vertical'=>'top'), 'font' => array( 'size' => 9, ), )); $this->CI->myexcel->getActiveSheet()->getStyle('F6:F'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'left') )); $this->CI->myexcel->getActiveSheet()->getStyle('B6:B'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'left') )); $this->CI->myexcel->getActiveSheet()->getStyle('G6:G'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'center')

Page 29: Source Code Aplikasi

)); $this->CI->myexcel->getActiveSheet()->getStyle('H6:H'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'right') )); $this->CI->myexcel->getActiveSheet()->getStyle('J6:J'.($row-1))->applyFromArray(array( 'alignment'=>array('horizontal'=>'right') )); $this->CI->myexcel->getActiveSheet()->getStyle('I6:I'.($row-1))->applyFromArray(array( alignment'=>array('horizontal'=>'left') )); $styleHead = $styleArray; $styleHead['borders']['allborders']['style'] = 'double'; $styleHead['alignment']['horizontal'] = 'center'; $styleHead['alignment']['vertical'] = 'center'; $this->CI->myexcel->getActiveSheet()->getStyle('A4:M5')->applyFromArray($styleHead);

$this->CI->myexcel->downloadbl(); }}?>