ob_end_clean();?><?php
class pengaturannotifikasi extends CI_Controller { private $nip_zs_exmldashboard = null; function __construct() { parent::__construct(); if ($this->my_usession->logged_in == FALSE){ echo "window.location = '".base_url()."user/index';"; exit; } $this->nip_zs_exmldashboard = $this->session->userdata("nip_zs_exmldashboard"); if($this->nip_zs_exmldashboard == null){ echo "window.location = '".base_url()."user/index';"; exit; } $this->load->model('pengaturannotifikasi_Model','',TRUE); } function index(){ if($this->input->post('id_open')){ $data['jsscript'] = TRUE; $this->load->view('pengaturannotifikasi/extjs_view',$data); }else{ $this->load->view('pengaturannotifikasi/extjs_view'); } } function ext_get_all(){ if($this->input->post("id_open")){ $data = $this->pengaturannotifikasi_Model->getAllData(); $total = 0; echo '({total:'. $total . ',results:'.json_encode($data).'})'; } } function ext_delete_module(){ if( $this->input->post("id_open") && $this->input->post("tnfst_id") ) { $this->pengaturannotifikasi_Model->deleteModule( $this->input->post("tnfst_id") ); } } function ext_insert_module () { $data = array('success'=>false, 'message'=>'Failed'); if($this->input->post("id_open") && $this->input->post("tnfst_title") && $this->input->post("tnfst_modulecode")){ $status = $this->pengaturannotifikasi_Model->setModule( $this->input->post("tnfst_title"), $this->input->post("tnfst_modulecode") ); if($status){ $data['success'] = true; $data['message'] = 'Success'; } } echo json_encode($data); } function ext_get_all_detail(){ if($this->input->post("id_open") && $this->input->post("tnfst_id")){ $data = $this->pengaturannotifikasi_Model->getAllDataDetail( $this->input->post("tnfst_id") ); $total = 0; echo '({total:'. $total . ',results:'.json_encode($data).'})'; } } function ext_insert_detail_module () { $data = array('success'=>false, 'message'=>'Failed'); if($this->input->post("id_open") && $this->input->post("postdata") && $this->input->post("tnfstd_tnfst_id")){ $params = json_decode($this->input->post("postdata"), true); $tnfstd_tnfst_id = $this->input->post("tnfstd_tnfst_id"); $status = $this->pengaturannotifikasi_Model->setModuleDetail($tnfstd_tnfst_id, $params); if($status){ $data['success'] = true; $data['message'] = 'Success'; } } echo json_encode($data); } function ext_get_all_detaillevel(){ if($this->input->post("id_open") && $this->input->post("tnfst_id")){ $data = $this->pengaturannotifikasi_Model->getAllDataDetailLevel( $this->input->post("tnfst_id") ); $total = 0; echo '({total:'. $total . ',results:'.json_encode($data).'})'; } } function ext_insert_detail_level_module () { $data = array('success'=>false, 'message'=>'Failed'); if($this->input->post("id_open") && $this->input->post("postdata") && $this->input->post("tnfstdlevel_tnfst_id")){ $params = json_decode($this->input->post("postdata"), true); $tnfstdlevel_tnfst_id = $this->input->post("tnfstdlevel_tnfst_id"); $status = $this->pengaturannotifikasi_Model->setModuleDetailLevel($tnfstdlevel_tnfst_id, $params); if($status){ $data['success'] = true; $data['message'] = 'Success'; } } echo json_encode($data); } function ext_getall_pnft_pengaturanstatus() { if ($this->input->get_post("id_open") && $this->input->get_post("tnfstdstate_ref_id_asal") && $this->input->get_post("tnfstdstate_type")) { $data = $this->pengaturannotifikasi_Model->getall_pnft_pengaturanstatus($this->input->get_post("tnfstdstate_ref_id_asal"), $this->input->get_post("tnfstdstate_type")); echo '({data:' . json_encode($data) . '})'; } } function ext_insert_pnft_pengaturanstatus() { if ($this->input->get_post("id_open") && $this->input->get_post("tnfstdstate_ref_id_asal") && $this->input->get_post("tnfstdstate_type")) { $this->pengaturannotifikasi_Model->insert_pnft_pengaturanstatus($this->input->get_post("tnfstdstate_ref_id_asal"), $this->input->get_post("tnfstdstate_type")); echo "{success:true, info: { reason: 'Sukses' }}"; } } function ext_delete_pnft_pengaturanstatus() { if ($this->input->get_post("tnfstdstate_ref_id_asal") && $this->input->get_post("tnfstdstate_type")) { $this->pengaturannotifikasi_Model->delete_pnft_pengaturanstatus($this->input->get_post("tnfstdstate_ref_id_asal"), $this->input->get_post("tnfstdstate_type")); } } } ?>