예제 #1
0
파일: users2.php 프로젝트: aagusti/padl-tng
 public function changepwd()
 {
     if ($this->uri->segment(4) == sipkd_user_id()) {
         $this->edit();
     } else {
         show_404();
     }
 }
예제 #2
0
 function get_active_only()
 {
     $user_id = sipkd_user_id();
     $sql = "select distinct a.*\r\n                from user_groups ug \r\n                    inner join groups g on g.id=ug.group_id \r\n                    inner join group_modules gm on g.id=gm.group_id\r\n                    inner join modules m on gm.module_id=m.id\r\n                    inner join apps a on m.app_id=a.id\r\n                where ug.user_id={$user_id} and (gm.reads=1 or gm.writes=1 or gm.deletes=1 or gm.inserts=1)\r\n                    order by a.id";
     if (is_super_admin()) {
         $sql = "select * from apps where disabled <> 1 order by id";
     }
     $query = $this->db->query($sql);
     if ($query->num_rows() !== 0) {
         return $query->result();
     } else {
         return FALSE;
     }
 }
예제 #3
0
 function update_stat()
 {
     $userid = $this->uri->segment(4);
     $ppat_id = $this->uri->segment(5);
     $val = $this->uri->segment(6);
     if ($val == 0) {
         if ($uid == sipkd_user_id() && $gid == sipkd_group_id()) {
             // ga bisa
         } else {
             $this->db->where('userid', $userid);
             $this->db->where('ppat_id', $ppat_id);
             $this->db->delete('bphtb_user');
         }
     } else {
         $data = array('userid' => $userid, 'ppat_id' => $ppat_id);
         $this->db->insert('bphtb_user', $data);
     }
 }
예제 #4
0
 function cetak()
 {
     $type = $this->uri->segment(4);
     $qs = urldecode($_SERVER['QUERY_STRING']);
     parse_str($qs, $qs_data);
     $params = array();
     // foreach ($qs_data as $key => $val)
     // $params[$key] = $val;
     $kondisi = '';
     $status = $this->input->get('kondisi');
     if ($status != '') {
         $kondisi = "AND cd.customer_status_id={$status}";
     }
     $rpt = $this->input->get('rpt');
     switch ($rpt) {
         case 'daf_induk_wp':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'kondisi' => $kondisi);
             break;
         case 'daf_induk_wp_perjenis':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'usahaid' => (int) $this->input->get('usahaid'), 'kondisi' => $kondisi);
             break;
         case 'daf_induk_wp_perkec':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'kecid' => (int) $this->input->get('kecid'), 'kondisi' => $kondisi);
             break;
         case 'daf_wp_baru':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'daf_wp_baru_jenis':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'usahaid' => (int) $this->input->get('usahaid'), 'kondisi' => $kondisi);
             break;
         case 'daf_wp_baru_kec':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kecid' => (int) $this->input->get('kecid'), 'kondisi' => $kondisi);
             break;
         case 'daf_wp_jenis_perkec':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'usahaid' => (int) $this->input->get('usahaid'), 'kondisi' => $kondisi);
             break;
         case 'daf_wp_tutup':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'daf_wp_ijin_berakhir':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'daf_rekap_kec':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))));
             break;
     }
     $tambahan = array("daerah" => pad_pemda_daerah(), "dinas" => pad_pemda_nama());
     $params = array_merge($params, $tambahan);
     $rpt = 'pendaftaran/' . $rpt;
     // var_dump($params);
     // die;
     $jasper = $this->load->library('Jasper');
     //IF PDF
     if ($type == 'pdf') {
         echo $jasper->cetak($rpt, $params, $type, false);
     } else {
         if ($type == 'html') {
             $assetpath = 'assets/file';
             $tmp = $assetpath . '/tmp/report' . sipkd_user_id() . '.html';
             if (is_file($tmp)) {
                 unlink($tmp);
             }
             ob_start();
             echo $jasper->cetak($rpt, $params, $type, false);
             echo '1';
             file_put_contents($tmp, ob_get_contents());
             $objPHPExcel = new PHPExcel();
             $inputFileType = 'HTML';
             $inputFileName = $tmp;
             $outputFileType = 'Excel2007';
             $outputFileName = $assetpath . '/Report.xls';
             $filename = $rpt . date("d-m-Y") . ".xls";
             $objPHPExcelReader = IOFactory::createReader($inputFileType);
             $objPHPExcel = $objPHPExcelReader->load($inputFileName);
             ini_set('zlib.output_compression', 'Off');
             header("Pragma: public");
             header("Expires: 0");
             header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
             header("Content-Type: application/force-download");
             header("Content-Type: application/octet-stream");
             //the folowing two lines make sure it is saved as a xls file
             header('Content-type: application/vnd.ms-excel');
             header('Content-Disposition: attachment; filename=' . $filename);
             //simpan dalam file sample.xls
             $objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
             $objWriter->save('php://output');
         }
     }
 }
예제 #5
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek usaha -> cm bisa edit yg self aja
     if ($p_usaha_id == pad_reklame_id() || $p_usaha_id == pad_air_tanah_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek kohir
     if ($this->sptpd_model->is_kohir_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     // cek pmb
     if ($this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => $input_post['tahun'], 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minomset' => $input_post['minomset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'write_date' => date('Y-m-d'), 'write_uid' => sipkd_user_id());
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             //
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         }
         // data tambahan
         $tambahan_data = array();
         if (wp_login()) {
             //
         }
         $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
         $this->sptpd_model->update($p_id, $update_data);
         // data tambahan / detail
         if (wp_login()) {
             //
             // uplod dokeumen
             $this->unggah($p_id);
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->pajaknm;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['rekeningkd'] = $row->rekeningkd;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     }
     if (wp_login()) {
         $this->load->helper('directory');
         $dir = directory_map(dirname(__FILE__) . '//..//dokumen//');
         $files = array();
         foreach ($dir as $file) {
             $f = explode('@', $file);
             if ($f[0] == $p_id) {
                 $files[] = anchor(active_module_url("sptpd/unduh/{$file}"), $f[1], array("title" => "Unduh file {$f['1']}", "target" => "_blank"));
             }
         }
         $data['dt']['files'] = $files;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
예제 #6
0
 public function batal_validasi()
 {
     $this->load_auth();
     if (!$this->module_auth->delete) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_delete);
         redirect(active_module_url($this->controller));
     }
     $spt_id = $this->uri->segment(4);
     if ($spt_id && ($sptpd = $this->sptpd_model->get($spt_id))) {
         //
         $update_data = array('is_validated' => 0, 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id());
         $this->sspd_model->update_by_spt($spt_id, $update_data);
         //UPDATE STATE PEMBAYRAN DI SPT -> 0
         $update_data = array('status_pembayaran' => 0);
         $this->sptpd_model->update($spt_id, $update_data);
         //hapus terima + terimaline
         $terima_id = $this->penerimaan_model->get_terima_id_by_spt($spt_id);
         $this->penerimaan_model->delete2_by_spt($spt_id);
         $this->penerimaan_model->delete_if_no_spt($terima_id);
         echo "ok";
     } else {
         echo "hmm";
     }
 }
예제 #7
0
 public function post()
 {
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url('penerimaan'));
     }
     $spt_id = $this->uri->segment(4);
     $terima_id = $this->uri->segment(5);
     $sptpd = $this->sptpd_model->get($spt_id);
     if ($terima_id && $spt_id && $sptpd) {
         // hitung bunga (telat bayar)
         $tgl_proses = new DateTime(Date('Y-m-d'));
         $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
         $diff = $tgl_proses->diff($tgl_jtempo);
         $nbln = $diff->format('%y') * 12 + $diff->format('%m');
         $nbln = $tgl_proses <= $tgl_jtempo ? 0 : $nbln;
         $nbln = $nbln > 24 ? 24 : $nbln;
         $pajak = $sptpd->pajak_terhutang;
         $bunga = (double) $pajak * (int) $nbln * (double) pad_bunga() + (double) $sptpd->bunga;
         // end hitung bunga
         $terimano = $this->penerimaan_model->max_terimano(pad_tahun_anggaran());
         $jmlterima = (double) $sptpd->pajak_terhutang + (double) $bunga;
         // terima line - rek pajak
         $update_data = array('terima_id' => $terima_id, 'spt_id' => $spt_id, 'rekening_id' => $sptpd->rekening_id, 'pajak_id' => $sptpd->pajak_id, 'amount' => $sptpd->pajak_terhutang, 'enabled' => 1, 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         $this->penerimaan_model->save2($update_data);
         // terima line - rek denda (bunga)
         if ($bunga > 0) {
             $update_data = array('terima_id' => $terima_id, 'spt_id' => $spt_id, 'rekening_id' => $this->load->model('pajak_model')->get_rek_denda($sptpd->pajak_id), 'pajak_id' => $sptpd->pajak_id, 'amount' => $bunga, 'enabled' => 1, 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
             $this->penerimaan_model->save2($update_data);
         }
         // update setoran
         $terima_id = $this->penerimaan_model->get_terima_id_by_spt($spt_id);
         $new_setoran = $this->penerimaan_model->update_setoran($terima_id);
         echo $new_setoran;
     } else {
         echo "hmm";
     }
 }
예제 #8
0
 function cetak()
 {
     $type = $this->uri->segment(4);
     $qs = urldecode($_SERVER['QUERY_STRING']);
     parse_str($qs, $qs_data);
     $params = array();
     // foreach ($qs_data as $key => $val)
     // $params[$key] = $val;
     $kondisi = $this->input->get('kondisi');
     if (!empty($kondisi)) {
         $kondisi = 'and s.type_id=' . $this->input->get('kondisi');
     }
     $rpt = $this->input->get('rpt');
     $tglawal = date('Y-m-d', strtotime($this->input->get('tglawal')));
     $tglakhir = date('Y-m-d', strtotime($this->input->get('tglakhir')));
     $tglawalbayar = date('Y-m-d', strtotime($this->input->get('tglawalbayar')));
     $tglakhirbayar = date('Y-m-d', strtotime($this->input->get('tglakhirbayar')));
     $tglcetak = date('Y-m-d', strtotime($this->input->get('tglcetak')));
     $ignore_html_pg = TRUE;
     switch ($rpt) {
         case 'tap_register':
         case 'tap_register_airtanah':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali':
         case 'tap_kendali_blm_bayar':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_self':
         case 'tap_kendali_self_sdh_bayar':
             // $kondisi  = ' and s.type_id='.pad_dok_self_id();
             $kondisi = ' and cd.usaha_id not in(' . pad_reklame_id() . ',' . pad_air_tanah_id() . ') ';
             $kondisi .= " and date(s.terimatgl) between '{$tglawal}' and '{$tglakhir}' ";
             $kondisi_bayar = " and date(ss.sspdtgl) between '{$tglawalbayar}' and '{$tglakhirbayar}' ";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi, 'kondisi_bayar' => $kondisi_bayar);
             break;
         case 'tap_kendali_blm_bayar_self':
             // $kondisi = 'and s.type_id='.pad_dok_self_id();
             $kondisi = ' and cd.usaha_id not in(' . pad_reklame_id() . ',' . pad_air_tanah_id() . ') ';
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_airtanah':
         case 'tap_kendali_airtanah_sdh_bayar':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $kondisi .= " and date(k.kohirtgl) between '{$tglawal}' and '{$tglakhir}' ";
             $kondisi_bayar = " and date(ss.sspdtgl) between '{$tglawalbayar}' and '{$tglakhirbayar}' ";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi, 'kondisi_bayar' => $kondisi_bayar);
             break;
         case 'tap_kendali_airtanah_blm_bayar':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_register_reklame':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $naskah = trim($this->input->get('naskah'));
             $kondisi .= $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_register_reklame_jthtempo':
             $type_id = intval($this->input->get('type_id'));
             if ($type_id > 0) {
                 $kondisi = 'and s.type_id=' . $type_id;
             } else {
                 $kondisi = '';
             }
             $naskah = trim($this->input->get('naskah'));
             $kondisi .= $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_reklame':
         case 'tap_kendali_reklame_sdh_bayar':
             $insidentil = intval($this->input->get('insidentil'));
             $type_id = intval($this->input->get('type_id'));
             $kondisi = '';
             if ($insidentil > -1) {
                 $kondisi .= ' and r.insidentil=' . $insidentil;
             }
             if ($type_id > 0) {
                 $kondisi .= ' and s.type_id=' . $type_id;
             }
             $naskah = trim($this->input->get('naskah'));
             $kondisi .= $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $kondisi .= " and date(k.kohirtgl) between '{$tglawal}' and '{$tglakhir}' ";
             $kondisi_bayar = " and date(ss.sspdtgl) between '{$tglawalbayar}' and '{$tglakhirbayar}' ";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi, 'kondisi_bayar' => $kondisi_bayar);
             // print_r($kondisi_bayar);exit;
             break;
         case 'tap_kendali_reklame_blm_bayar':
             $insidentil = intval($this->input->get('insidentil'));
             $type_id = intval($this->input->get('type_id'));
             $kondisi = '';
             if ($insidentil > -1) {
                 $kondisi .= ' and r.insidentil=' . $insidentil;
             }
             if ($type_id > 0) {
                 $kondisi .= ' and s.type_id=' . $type_id;
             }
             $naskah = trim($this->input->get('naskah'));
             $kondisi .= $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_reklame_jthtempo_tgl':
             $naskah = trim($this->input->get('naskah'));
             $kondisi = $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_reklame_jthtempo':
             $naskah = trim($this->input->get('naskah'));
             $kondisi = $naskah != "" ? " and s.r_judul ilike '%{$naskah}%' " : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'tap_kendali_reklame_jthtempo_rek':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'rekeningid' => (int) $this->input->get('rekeningid'));
             break;
         case 'tap_kendali_airtanah':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'bulan' => (int) $this->input->get('bulan'), 'tahun' => (int) $this->input->get('tahun'));
             break;
         case 'tap_kendali_airtanah_skpd':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'tap_kendali_airtanah_tgl':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'tap_kendali_airtanah_masa':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'tap_catat_vol_airtanah':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tahun' => (int) $this->input->get('tahun'));
             break;
     }
     $tambahan = array("daerah" => pad_pemda_daerah());
     $params = array_merge($params, $tambahan);
     $ignore_html_pg = false;
     //paging aja semua
     $rpt = 'penetapan/' . $rpt;
     // var_dump($params);
     // die;
     $jasper = $this->load->library('Jasper');
     if ($type == 'pdf') {
         echo $jasper->cetak($rpt, $params, $type, $ignore_html_pg);
     } else {
         if ($type == 'html') {
             $assetpath = 'assets/file';
             $tmp = $assetpath . '/tmp/report' . sipkd_user_id() . '.html';
             if (is_file($tmp)) {
                 unlink($tmp);
             }
             ob_start();
             echo $jasper->cetak($rpt, $params, $type, $ignore_html_pg);
             echo '1';
             file_put_contents($tmp, ob_get_contents());
             $objPHPExcel = new PHPExcel();
             $inputFileType = 'HTML';
             $inputFileName = $tmp;
             $outputFileType = 'Excel2007';
             $outputFileName = $assetpath . '/Report.xls';
             $filename = $rpt . date("d-m-Y") . ".xls";
             $objPHPExcelReader = IOFactory::createReader($inputFileType);
             $objPHPExcel = $objPHPExcelReader->load($inputFileName);
             ini_set('zlib.output_compression', 'Off');
             header("Pragma: public");
             header("Expires: 0");
             header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
             header("Content-Type: application/force-download");
             header("Content-Type: application/octet-stream");
             //the folowing two lines make sure it is saved as a xls file
             header('Content-type: application/vnd.ms-excel');
             header('Content-Disposition: attachment; filename=' . $filename);
             //simpan dalam file sample.xls
             $objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
             $objWriter->save('php://output');
         }
     }
     // echo $jasper->query_debug($rpt, $params);
 }
예제 #9
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek tipe dokumen -> cm bisa edit yg self aja
     if ($p_type_id != pad_dok_self_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek usaha
     if ($p_usaha_id == pad_reklame_id() || $p_usaha_id == pad_air_tanah_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek kohir
     //if ($this->sptpd_model->is_kohir_ok($p_id)) {
     //   $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
     //    redirect(active_module_url($this->controller));
     //}
     if ($this->sptpd_model->is_bayar($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //Validasi Multiple
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => date('Y', strtotime($input_post['terimatgl'])), 'bulan' => date('m', strtotime($input_post['terimatgl'])), 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minimal_omset' => $input_post['minimal_omset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'cara_bayar' => $input_post['cara_bayar'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id(), 'omset1' => $input_post['omset1'], 'omset6' => $input_post['omset6'], 'omset2' => $input_post['omset2'], 'omset7' => $input_post['omset7'], 'omset3' => $input_post['omset3'], 'omset8' => $input_post['omset8'], 'omset4' => $input_post['omset4'], 'omset9' => $input_post['omset9'], 'omset5' => $input_post['omset5'], 'omset10' => $input_post['omset10'], 'omset11' => $input_post['omset11'], 'omset16' => $input_post['omset16'], 'omset12' => $input_post['omset12'], 'omset17' => $input_post['omset17'], 'omset13' => $input_post['omset13'], 'omset18' => $input_post['omset18'], 'omset14' => $input_post['omset14'], 'omset19' => $input_post['omset19'], 'omset15' => $input_post['omset15'], 'omset20' => $input_post['omset20'], 'omset21' => $input_post['omset21'], 'omset26' => $input_post['omset26'], 'omset22' => $input_post['omset22'], 'omset27' => $input_post['omset27'], 'omset23' => $input_post['omset23'], 'omset28' => $input_post['omset28'], 'omset24' => $input_post['omset24'], 'omset29' => $input_post['omset29'], 'omset25' => $input_post['omset25'], 'omset30' => $input_post['omset30'], 'omset31' => $input_post['omset31'], 'omset_lain' => $input_post['omset32'], 'keterangan1' => $input_post['keterangan1'], 'keterangan6' => $input_post['keterangan6'], 'keterangan2' => $input_post['keterangan2'], 'keterangan7' => $input_post['keterangan7'], 'keterangan3' => $input_post['keterangan3'], 'keterangan8' => $input_post['keterangan8'], 'keterangan4' => $input_post['keterangan4'], 'keterangan9' => $input_post['keterangan9'], 'keterangan5' => $input_post['keterangan5'], 'keterangan10' => $input_post['keterangan10'], 'keterangan11' => $input_post['keterangan11'], 'keterangan16' => $input_post['keterangan16'], 'keterangan12' => $input_post['keterangan12'], 'keterangan17' => $input_post['keterangan17'], 'keterangan13' => $input_post['keterangan13'], 'keterangan18' => $input_post['keterangan18'], 'keterangan14' => $input_post['keterangan14'], 'keterangan19' => $input_post['keterangan19'], 'keterangan15' => $input_post['keterangan15'], 'keterangan20' => $input_post['keterangan20'], 'keterangan21' => $input_post['keterangan21'], 'keterangan26' => $input_post['keterangan26'], 'keterangan22' => $input_post['keterangan22'], 'keterangan27' => $input_post['keterangan27'], 'keterangan23' => $input_post['keterangan23'], 'keterangan28' => $input_post['keterangan28'], 'keterangan24' => $input_post['keterangan24'], 'keterangan29' => $input_post['keterangan29'], 'keterangan25' => $input_post['keterangan25'], 'keterangan30' => $input_post['keterangan30'], 'keterangan31' => $input_post['keterangan31'], 'keterangan_lain' => $input_post['keterangan32']);
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             //
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         }
         // data tambahan
         $tambahan_data = array();
         if (wp_login()) {
             //
         }
         // Validasi Duplikasi Masa Pajak
         if ($this->session->userdata("mode") == "edit") {
             if ($input_post['multiple'] == 0) {
                 $lastinput = date('Y-m-d', strtotime($input_post['masadari']));
                 $customer_usaha_id = $input_post['customer_usaha_id'];
                 $pajak_id = $input_post['pajak_id'];
                 $rekening_id = $input_post['rekening_id'];
                 $type_id = $input_post['type_id'];
                 $cekduplikat = $this->sptpd_model->is_multiple($customer_usaha_id, $pajak_id, $type_id, $rekening_id, $lastinput);
                 if ($cekduplikat == true) {
                     $this->session->set_flashdata('msg_warning', 'Pajak dengan Masa Pajak Tersebut Sudah Ada, Harap Cek Data-data Sebelumnya');
                     redirect(active_module_url($this->controller));
                 } else {
                     $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
                     $this->sptpd_model->update($p_id, $update_data);
                 }
             } else {
                 $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
                 $this->sptpd_model->update($p_id, $update_data);
             }
         }
         // data tambahan / detail
         if (wp_login()) {
             //
             // uplod dokeumen
             $this->unggah($p_id);
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->nama;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['kode'] = $row->kode;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
         $data['dt']['multiple'] = $row->multiple;
     }
     if (wp_login()) {
         $this->load->helper('directory');
         $dir = directory_map(dirname(__FILE__) . '//..//dokumen//');
         $files = array();
         foreach ($dir as $file) {
             $f = explode('@', $file);
             if ($f[0] == $p_id) {
                 $files[] = anchor(active_module_url("sptpd/unduh/{$file}"), $f[1], array("title" => "Unduh file {$f['1']}", "target" => "_blank"));
             }
         }
         $data['dt']['files'] = $files;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
예제 #10
0
파일: daftar.php 프로젝트: aagusti/padl-tng
 public function do_update_status()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('daftar'));
     }
     $data['current'] = 'pendaftaran';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url('daftar/do_update_status');
     $this->form_validation->set_rules('status_id', 'Status', 'required');
     $this->form_validation->set_rules('keterangan', 'Keterangan', 'max_length[255]');
     if ($this->form_validation->run() == TRUE) {
         $update_data = array('daftar_id' => $this->input->post('id'), 'status_id' => $this->input->post('status_id'), 'keterangan' => $this->input->post('keterangan'), 'create_date' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         $this->daftar_hist_model->save($update_data);
         $this->session->set_flashdata('msg_success', 'Data telah diupdate');
         redirect(active_module_url('daftar'));
     }
     $data['dt']['id'] = $this->input->post('id');
     $data['dt']['formno'] = $this->input->post('formno');
     $data['dt']['reg_date'] = $this->input->post('reg_date');
     $data['dt']['customernm'] = $this->input->post('customernm');
     $data['dt']['alamat'] = $this->input->post('alamat');
     $select_data = $this->daftar_status_model->get_select();
     $options = array();
     if ($select_data) {
         foreach ($select_data as $row) {
             $options[$row->id] = $row->uraian;
         }
     }
     $js = 'id="status_id" class="input-large" required ';
     $data['select_status'] = form_dropdown('status_id', $options, $this->input->post('status_id'), $js);
     $data['dt']['keterangan'] = $this->input->post('keterangan');
     $this->load->view('vdaftar_form_status', $data);
 }
예제 #11
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('sptpd'));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     $data['current'] = 'pendataan';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("sptpd/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => $input_post['tahun'], 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minimal_omset' => $input_post['minimal_omset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id());
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             $input_post = $post_data;
             $reklame_data = array('r_nsrno' => $input_post['r_nsrno'], 'r_nsrtgl' => empty($input_post['r_nsrtgl']) ? NULL : date('Y-m-d', strtotime($input_post['r_nsrtgl'])), 'r_tarifid' => $input_post['r_tarifid'], 'r_kontrak' => $input_post['r_kontrak'], 'r_lama' => $input_post['r_lama'], 'r_jalanklas_id' => $input_post['r_jalanklas_id'], 'r_jalan_id' => $input_post['r_jalan_id'], 'r_lokasi' => $input_post['r_lokasi'], 'r_judul' => $input_post['r_judul'], 'r_panjang' => $input_post['r_panjang'], 'r_lebar' => $input_post['r_lebar'], 'r_muka' => $input_post['r_muka'], 'r_banyak' => $input_post['r_banyak'], 'r_luas' => $input_post['r_luas'], 'r_lokasi_id' => $input_post['r_lokasi_id'], 'r_calculated' => $input_post['r_calculated']);
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             $input_post = $post_data;
             $air_tanah_data = array('air_manfaat_id' => $input_post['air_manfaat_id'], 'air_zona_id' => $input_post['air_zona_id'], 'meteran_awal' => $input_post['meteran_awal'], 'meteran_akhir' => $input_post['meteran_akhir'], 'volume' => $input_post['volume'], 'satuan' => 'M3');
         }
         $update_data = array_merge($update_data, $reklame_data, $air_tanah_data);
         $this->sptpd_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('sptpd'));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->nama;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['rekeningkd'] = $row->rekeningkd;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         $select_data = $this->load->model('jalan_kelas_model')->get_select();
         $options = array();
         foreach ($select_data as $row) {
             $options[$row->id] = $row->kelasnm;
         }
         $js = 'id="r_jalanklas_id" class="input-xlarge" required ';
         $data['select_jalan_kelas'] = form_dropdown('r_jalanklas_id', $options, $get->r_jalanklas_id, $js);
         $select_data = $this->load->model('jalan_model')->get_select();
         $options = array();
         foreach ($select_data as $row) {
             $options[$row->id] = $row->nama;
         }
         $js = 'id="r_jalan_id" class="input-xlarge" required ';
         $data['select_jalan'] = form_dropdown('r_jalan_id', $options, $get->r_jalan_id, $js);
         $select_data = $this->load->model('kecamatan_model')->get_select();
         $options = array();
         foreach ($select_data as $row) {
             $options[$row->id] = $row->kecamatannm;
         }
         $js = 'id="r_lokasi_id" class="input-medium" required ';
         $data['select_lokasi'] = form_dropdown('r_lokasi_id', $options, $get->r_lokasi_id, $js);
         $options = array(1 => 'Tidak ada', 2 => 'Kenaikan 25%', 3 => 'Pengurangan 25%', 4 => 'Kenaikan 25% & Pengurangan 25%');
         $js = 'id="r_tarifid" class="input-large" required ';
         $data['select_tarif'] = form_dropdown('r_tarifid', $options, $get->r_tarifid, $js);
         $this->load->view('vsptpd_form_reklame', $data);
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             $select_data = $this->load->model('air_zona_model')->get_select();
             $options = array();
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
             $js = 'id="air_zona_id" class="input-medium" required ';
             $data['select_zona'] = form_dropdown('air_zona_id', $options, $get->air_zona_id, $js);
             $select_data = $this->load->model('air_manfaat_model')->get_select();
             $options = array();
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
             $js = 'id="air_manfaat_id" class="input-medium" required ';
             $data['select_manfaat'] = form_dropdown('air_manfaat_id', $options, $get->air_manfaat_id, $js);
             $this->load->view('vsptpd_form_at', $data);
         } else {
             $this->load->view('vsptpd_form', $data);
         }
     }
 }
예제 #12
0
 function cetak()
 {
     $type = $this->uri->segment(4);
     $qs = urldecode($_SERVER['QUERY_STRING']);
     parse_str($qs, $qs_data);
     $params = array();
     // foreach ($qs_data as $key => $val)
     // $params[$key] = $val;
     $rpt = $this->input->get('rpt');
     $ignore_html_pg = TRUE;
     switch ($rpt) {
         case 'dat_sptpd_masuk':
             $usahaid = trim($this->input->get('usahaid'));
             $kondisi = intval($usahaid) > 0 ? " and cd.usaha_id={$usahaid}" : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))), 'kondisi' => $kondisi);
             break;
         case 'dat_sptpd_masuk_masa':
             $usahaid = trim($this->input->get('usahaid'));
             $kondisi = intval($usahaid) > 0 ? " and cd.usaha_id={$usahaid}" : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'masabulan' => (int) $this->input->get('bulan'), 'masatahun' => (int) $this->input->get('tahun'), 'tahun' => (int) pad_tahun_anggaran(), 'kondisi' => $kondisi);
             break;
         case 'dat_sptpd_masuk_tgl_all':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'tglawal' => date('Y-m-d', strtotime($this->input->get('tglawal'))), 'tglakhir' => date('Y-m-d', strtotime($this->input->get('tglakhir'))));
             break;
         case 'dat_sptpd_masuk_masa_all':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'bulan' => (int) $this->input->get('bulan'), 'tahun' => (int) $this->input->get('tahun'));
             break;
         case 'dat_sptpd_blm_masuk_masa':
             $usahaid = trim($this->input->get('usahaid'));
             $kondisi = intval($usahaid) > 0 ? " and cu.usaha_id={$usahaid}" : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'masabulan' => (int) $this->input->get('bulan'), 'masatahun' => (int) $this->input->get('tahun'), 'tahun' => (int) pad_tahun_anggaran(), 'kondisi' => $kondisi);
             break;
         case 'dat_sptpd_blm_masuk_masa_all':
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'bulan' => (int) $this->input->get('bulan'), 'tahun' => (int) $this->input->get('tahun'));
             break;
         case 'dat_srt_pemberitahuan':
             $usahaid = trim($this->input->get('usahaid'));
             $kondisi = intval($usahaid) > 0 ? " and cu.usaha_id={$usahaid}" : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'masabulan' => (int) $this->input->get('bulan'), 'masatahun' => (int) $this->input->get('tahun'), 'tahun' => (int) pad_tahun_anggaran(), 'kondisi' => $kondisi);
             break;
         case 'dat_srt_teguran':
             $usahaid = trim($this->input->get('usahaid'));
             $kondisi = intval($usahaid) > 0 ? " and cu.usaha_id={$usahaid}" : "";
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'masabulan' => (int) $this->input->get('bulan'), 'masatahun' => (int) $this->input->get('tahun'), 'tahun' => (int) pad_tahun_anggaran(), 'kondisi' => $kondisi);
             break;
         case 'dat_srt_teguran_global':
             $ignore_html_pg = FALSE;
             $params = array('tglcetak' => date('Y-m-d', strtotime($this->input->get('tglcetak'))), 'usahaid' => (int) $this->input->get('usahaid'));
             break;
     }
     $tambahan = array("daerah" => pad_pemda_daerah(), "dinas" => pad_pemda_nama(), "ttd" => base_url('assets/img/ttd.gif'));
     $params = array_merge($params, $tambahan);
     $ignore_html_pg = FALSE;
     //paging aja semua
     $rpt = 'pendataan/' . $rpt;
     $jasper = $this->load->library('Jasper');
     if ($type == 'pdf') {
         echo $jasper->cetak($rpt, $params, $type, $ignore_html_pg);
     } else {
         if ($type == 'html') {
             $assetpath = 'assets/file';
             $tmp = $assetpath . '/tmp/report' . sipkd_user_id() . '.html';
             if (is_file($tmp)) {
                 unlink($tmp);
             }
             ob_start();
             echo $jasper->cetak($rpt, $params, $type, $ignore_html_pg);
             echo '1';
             file_put_contents($tmp, ob_get_contents());
             $objPHPExcel = new PHPExcel();
             $inputFileType = 'HTML';
             $inputFileName = $tmp;
             $outputFileType = 'Excel2007';
             $outputFileName = $assetpath . '/Report.xls';
             $filename = $rpt . date("d-m-Y") . ".xls";
             $objPHPExcelReader = IOFactory::createReader($inputFileType);
             $objPHPExcel = $objPHPExcelReader->load($inputFileName);
             ini_set('zlib.output_compression', 'Off');
             header("Pragma: public");
             header("Expires: 0");
             header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
             header("Content-Type: application/force-download");
             header("Content-Type: application/octet-stream");
             //the folowing two lines make sure it is saved as a xls file
             header('Content-type: application/vnd.ms-excel');
             header('Content-Disposition: attachment; filename=' . $filename);
             //simpan dalam file sample.xls
             $objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
             $objWriter->save('php://output');
         }
     }
 }
예제 #13
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('objek_pajak'));
     }
     $data['current'] = 'pendaftaran';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url('objek_pajak/update');
     $post_data = $this->fpost();
     $data['dt'] = $post_data;
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $usaha_model = $this->load->model('usaha_model');
         $so = $usaha_model->get_so($this->input->get_post('op_usaha_id'));
         $post_data = array('customer_id' => empty($input_post['customer_id']) ? NULL : $input_post['customer_id'], 'usaha_id' => empty($input_post['usaha_id']) ? NULL : $input_post['usaha_id'], 'so' => $so, 'kecamatan_id' => empty($input_post['kecamatan_id']) ? NULL : $input_post['kecamatan_id'], 'kelurahan_id' => empty($input_post['kelurahan_id']) ? NULL : $input_post['kelurahan_id'], 'notes' => empty($input_post['notes']) ? NULL : $input_post['notes'], 'aktifnotes' => empty($input_post['aktifnotes']) ? NULL : $input_post['aktifnotes'], 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'customer_status_id' => empty($input_post['customer_status_id']) ? NULL : $input_post['customer_status_id'], 'latitude' => $input_post['latitude'], 'longitude' => $input_post['longitude'], 'opnm' => $input_post['opnm'], 'opalamat' => $input_post['opalamat'], 'def_pajak_id' => $input_post['def_pajak_id'], 'kd_restojmlmeja' => pad_to_decimal($input_post['kd_restojmlmeja']), 'kd_restojmlkursi' => pad_to_decimal($input_post['kd_restojmlkursi']), 'kd_restojmltamu' => pad_to_decimal($input_post['kd_restojmltamu']), 'kd_filmkursi' => pad_to_decimal($input_post['kd_filmkursi']), 'kd_filmpertunjukan' => pad_to_decimal($input_post['kd_filmpertunjukan']), 'kd_filmtarif' => pad_to_decimal($input_post['kd_filmtarif']), 'kd_bilyarmeja' => pad_to_decimal($input_post['kd_bilyarmeja']), 'kd_bilyartarif' => pad_to_decimal($input_post['kd_bilyartarif']), 'kd_bilyarkegiatan' => pad_to_decimal($input_post['kd_bilyarkegiatan']), 'kd_diskopengunjung' => pad_to_decimal($input_post['kd_diskopengunjung']), 'kd_diskotarif' => pad_to_decimal($input_post['kd_diskotarif']), 'mall_id' => pad_to_decimal($input_post['op_mall_id']), 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id());
         $this->objek_pajak_model->update($this->input->post('id'), $post_data);
         if (isset($dtKD)) {
             $i = 1;
             $dtKD = json_decode($dtKD, true);
             if (count($dtKD['dtKD']) > 0) {
                 $cid = $input_post['customer_id'];
                 $op_u_id = $input_post['usaha_id'];
                 $rd_row = array();
                 foreach ($dtKD['dtKD'] as $rows) {
                     $rd_row = array('customer_id' => $cid, 'konterid' => $konter, 'usaha_id' => $op_u_id, 'nourut' => $i, 'notes' => $rows[0], 'tarif' => pad_to_decimal($rows[1]), 'kamar' => pad_to_decimal($rows[2]), 'volume' => pad_to_decimal($rows[3]));
                     $i++;
                     $tambahan_data2 = array_merge($tambahan_data2, array($rd_row));
                 }
                 //langsung ajah dah - sementara
                 $query = "delete from pad_customer_detail where (customer_id={$cid} and konterid={$konter})";
                 $this->db->query($query);
                 $this->db->insert_batch('pad_customer_detail', $tambahan_data2);
             }
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('objek_pajak'));
     }
     $get = (object) $post_data;
     $data['dt']['nopd'] = $this->objek_pajak_model->get_nopd($get->id);
     $select_data = $this->load->model('usaha_model')->get_select();
     $options = array();
     $usaha_id = '';
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="usaha_id" class="input-medium" onChange="get_pajak(this.value);" required ';
     $data['select_usaha'] = form_dropdown('usaha_id', $options, $get->usaha_id, $js);
     $select_data = $this->load->model('pajak_model')->get_select2($get->usaha_id);
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="def_pajak_id" class="input-medium" required ';
     $data['select_pajak'] = form_dropdown('def_pajak_id', $options, '', $js);
     $select_data = $this->load->model('kecamatan_model')->get_select();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="kecamatan_id" class="input-medium" onChange="get_kelurahan(this.value);" required ';
     $data['select_kecamatan'] = form_dropdown('kecamatan_id', $options, $get->kecamatan_id, $js);
     $select_data = $this->load->model('kelurahan_model')->get_select($get->kecamatan_id);
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="kelurahan_id" class="input-large" required ';
     $data['select_kelurahan'] = form_dropdown('kelurahan_id', $options, $get->kelurahan_id, $js);
     //read again ? tujuan nanti sih kayanya masuk ke op_status_usaha
     $options = array('1' => 'AKTIF', '2' => 'TUTUP', '3' => 'TUTUP SEMENTARA', '4' => 'NORMAL', '5' => 'LIBUR');
     $js = 'id="customer_status_id" class="input-medium" required ';
     $data['select_status'] = form_dropdown('customer_status_id', $options, $get->customer_status_id, $js);
     $this->load->view('vobjek_pajak_form', $data);
 }
예제 #14
0
파일: jalan.php 프로젝트: aagusti/padl-tng
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('jalan'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("jalan/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('kode' => empty($input_post['kode']) ? NULL : $input_post['kode'], 'nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'jalan_kelas_id' => empty($input_post['jalan_kelas_id']) ? NULL : $input_post['jalan_kelas_id'], 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'enabled' => empty($input_post['enabled']) ? 0 : 1, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->jalan_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('jalan'));
     }
     $get = $post_data;
     $select_data = $this->load->model('jalan_kelas_model')->get_select2();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="jalan_kelas_id" class="input-xlarge" required ';
     $data['select_jalan_kelas'] = form_dropdown('jalan_kelas_id', $options, $get->jalan_kelas_id, $js);
     $data['dt'] = $post_data;
     $this->load->view('vjalan_form', $data);
 }
예제 #15
0
파일: usaha.php 프로젝트: aagusti/padl-tng
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('usaha'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("usaha/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'so' => empty($input_post['so']) ? NULL : $input_post['so'], 'enabled' => empty($input_post['enabled']) ? 0 : 1, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->usaha_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('usaha'));
     }
     $data['dt'] = $post_data;
     $get = $post_data;
     $options = array('S' => 'Self', 'O' => 'Office');
     $js = 'id="so" class="input-small" required ';
     $data['select_so'] = form_dropdown('so', $options, $get->so, $js);
     $this->load->view('vusaha_form', $data);
 }
예제 #16
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('reklame'));
     }
     $data['current'] = 'referensi';
     $data['controller'] = $this->uri->segment(2);
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url('reklame/update');
     $post_data = $this->fpost();
     $data['dt'] = $post_data;
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $post_data = array('kode' => $input_post['kode'], 'kecamatan_id' => $input_post['kecamatan_id'], 'kelurahan_id' => $input_post['kelurahan_id'], 'latitude' => $input_post['latitude'], 'longitude' => $input_post['longitude'], 'pemilik_nama' => empty($input_post['pemilik_nama']) ? NULL : $input_post['pemilik_nama'], 'pemilik_alamat' => empty($input_post['pemilik_alamat']) ? NULL : $input_post['pemilik_alamat'], 'pemilik_kecamatan' => empty($input_post['pemilik_kecamatan']) ? NULL : $input_post['pemilik_kecamatan'], 'pemilik_kelurahan' => empty($input_post['pemilik_kelurahan']) ? NULL : $input_post['pemilik_kelurahan'], 'pemilik_kota' => empty($input_post['pemilik_kota']) ? NULL : $input_post['pemilik_kota'], 'created' => date('Y-m-d h:i:s'), 'create_uid' => sipkd_user_id());
         $this->reklame_model->update($this->input->post('id'), $post_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('reklame'));
     }
     $get = (object) $post_data;
     $select_data = $this->load->model('kecamatan_model')->get_select();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="kecamatan_id" class="input-medium" onChange="get_kelurahan(this.value);" required ';
     $data['select_kecamatan'] = form_dropdown('kecamatan_id', $options, $get->kecamatan_id, $js);
     $select_data = $this->load->model('kelurahan_model')->get_select($get->kecamatan_id);
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="kelurahan_id" class="input-large" required ';
     $data['select_kelurahan'] = form_dropdown('kelurahan_id', $options, $get->kelurahan_id, $js);
     $this->load->view('vreklame_form', $data);
 }
예제 #17
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('reklame_nsr'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("reklame_nsr/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('kelas_jalan_id' => empty($input_post['kelas_jalan_id']) ? NULL : $input_post['kelas_jalan_id'], 'media_id' => empty($input_post['media_id']) ? NULL : $input_post['media_id'], 'satuan' => empty($input_post['satuan']) ? NULL : $input_post['satuan'], 'njopr' => pad_to_decimal($input_post['njopr']), 'nspr' => pad_to_decimal($input_post['nspr']), 'nsr' => pad_to_decimal($input_post['nsr']), 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'enabled' => empty($input_post['enabled']) ? 0 : 1, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->reklame_nsr_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('reklame_nsr'));
     }
     $data['dt'] = $post_data;
     $this->load->view('vreklame_nsr_form', $data);
 }
예제 #18
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('objek_pajak'));
     }
     $data['current'] = 'pendaftaran';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url('objek_pajak/update');
     $post_data = $this->fpost();
     $data['dt'] = $post_data;
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $usaha_model = $this->load->model('usaha_model');
         $so = $usaha_model->get_so($this->input->get_post('op_usaha_id'));
         $post_data = array('customer_id' => empty($input_post['customer_id']) ? NULL : $input_post['customer_id'], 'usaha_id' => empty($input_post['usaha_id']) ? NULL : $input_post['usaha_id'], 'so' => $so, 'kecamatan_id' => empty($input_post['kecamatan_id']) ? NULL : $input_post['kecamatan_id'], 'kelurahan_id' => empty($input_post['kelurahan_id']) ? NULL : $input_post['kelurahan_id'], 'notes' => empty($input_post['notes']) ? NULL : $input_post['notes'], 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'enabled' => empty($input_post['enabled']) ? NULL : $input_post['enabled'], 'write_date' => date('Y-m-d'), 'write_uid' => sipkd_user_id());
         $this->objek_pajak_model->update($this->input->post('id'), $post_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('objek_pajak'));
     }
     $get = (object) $post_data;
     $data['dt']['nopd'] = $this->objek_pajak_model->get_nopd($get->id);
     $select_data = $this->load->model('usaha_model')->get_select();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="usaha_id" class="input-medium" required ';
     $data['select_usaha'] = form_dropdown('usaha_id', $options, $get->usaha_id, $js);
     $select_data = $this->load->model('kecamatan_model')->get_select();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->kecamatannm;
     }
     $js = 'id="kecamatan_id" class="input-medium" onChange="get_kelurahan(this.value);" required ';
     $data['select_kecamatan'] = form_dropdown('kecamatan_id', $options, $get->kecamatan_id, $js);
     $select_data = $this->load->model('kelurahan_model')->get_select($get->kecamatan_id);
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->kelurahannm;
     }
     $js = 'id="kelurahan_id" class="input-large" required ';
     $data['select_kelurahan'] = form_dropdown('kelurahan_id', $options, $get->kelurahan_id, $js);
     //read again ? tujuan nanti sih kayanya masuk ke op_status_usaha
     $options = array('1' => 'AKTIF', '2' => 'INAKTIF');
     $js = 'id="enabled" class="input-medium" required ';
     $data['select_status'] = form_dropdown('enabled', $options, $get->enabled, $js);
     $this->load->view('vobjek_pajak_form', $data);
 }
예제 #19
0
 public function proses_skpd()
 {
     $this->load_auth();
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url($this->controller));
     }
     $usaha_id = $this->uri->segment(4);
     $spt_id = $this->uri->segment(5);
     $tgl_proses = $this->uri->segment(6);
     if ($usaha_id && $spt_id && ($sptpd = $this->sptpd_model->get($spt_id))) {
         $kohirno = $this->skpd_model->generate_kohirno(pad_tahun_anggaran(), $usaha_id);
         $update_data = array('spt_id' => $spt_id, 'kohirno' => $kohirno, 'usaha_id' => $usaha_id, 'tahun' => pad_tahun_anggaran(), 'kohirtgl' => date('Y-m-d', strtotime($tgl_proses)), 'enabled' => 1, 'create_date' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         $this->skpd_model->save($update_data);
         //update jth tempo
         // $tgl_proses = new DateTime(Date('Y-m-d'));
         $tgl_proses = new DateTime(Date('Y-m-d', strtotime($tgl_proses)));
         $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
         $masadari = new DateTime(Date('Y-m-d', strtotime($sptpd->masadari)));
         $new_tgl_jtempo = $tgl_jtempo;
         $jth_tempo = $this->load->model('pajak_model')->get_jatuhtempo($usaha_id);
         if ($jth_tempo > 0) {
             $new_tgl_jtempo = $tgl_proses->modify("+30 day");
         } else {
             $xbln = 2;
             $new_tgl_jtempo = $tgl_proses->modify("+{$xbln} month");
             $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
         }
         //update jattuh tempo lagi u/ reklame
         $rek = $this->load->model('rekening_model')->get($sptpd->rekening_id);
         $insiden = $rek->insidentil;
         if (substr($rek->rekeningkd, 0, 5) == '41104') {
             if ($insiden == 1) {
                 // $new_tgl_jtempo = $masadari;
                 // berdasarkan tgl penetapan cc. om sisco
                 $tgl_proses = new DateTime(Date('Y-m-d'));
                 $new_tgl_jtempo = $tgl_proses;
             } else {
                 $new_tgl_jtempo = $masadari->modify("+30 day");
             }
             //lagi
             //28-08-2014 BERUBAH LAGI !! ANJRIT
             /*
             if($sptpd->r_status=='Pasang Baru') {
                 $tgl_proses = new DateTime(Date('Y-m-d'));
                 $new_tgl_jtempo = $tgl_proses->modify("+30 day");
             }
             */
         }
         if (substr($rek->rekeningkd, 0, 5) == '41108') {
             // dimanualkan saja, karena hitung hari kerja
             /*
             $tgl_proses = new DateTime(Date('Y-m-d'));
             $new_tgl_jtempo = $tgl_proses->modify("+20 day");
             */
             $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
             $new_tgl_jtempo = $tgl_jtempo;
         }
         $this->sptpd_model->update($spt_id, array('jatuhtempotgl' => date_format($new_tgl_jtempo, 'Y-m-d')));
         echo "ok";
     } else {
         echo "hmm";
     }
 }
예제 #20
0
 function proces_op()
 {
     $mode = $this->uri->segment(4);
     $op_id = $this->input->get_post('op_id');
     $usaha_model = $this->load->model('usaha_model');
     $so = $usaha_model->get_so($this->input->get_post('op_usaha_id'));
     $update_data = array('customer_id' => $this->input->get_post('customer_id'), 'usaha_id' => $this->input->get_post('op_usaha_id'), 'so' => $so, 'kecamatan_id' => $this->input->get_post('op_kecamatan_id'), 'kelurahan_id' => $this->input->get_post('op_kelurahan_id'), 'notes' => $this->input->get_post('op_keterangan'), 'customer_status_id' => $this->input->get_post('op_status'), 'enabled' => 1, 'tmt' => $this->input->get_post('op_tmt') == '' ? NULL : date('Y-m-d', strtotime($this->input->get_post('op_tmt'))), 'opnm' => $this->input->get_post('op_nama'), 'opalamat' => $this->input->get_post('op_alamat'), 'latitude' => pad_to_decimal($this->input->get_post('op_latitude')), 'longitude' => pad_to_decimal($this->input->get_post('op_longitude')), 'def_pajak_id' => $this->input->get_post('op_pajak_id'));
     $op_model = $this->load->model('objek_pajak_model');
     if ($mode == 'add') {
         $konter = $op_model->max_konter($this->input->get_post('customer_id'));
         $new_data = array('konterid' => $konter, 'reg_date' => date('Y-m-d'), 'created' => date('Y-m-d'), 'create_uid' => sipkd_user_id());
         $update_data = array_merge($update_data, $new_data);
         $op_model->save($update_data);
     }
     if ($mode == 'edit') {
         $new_data = array('updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id());
         $update_data = array_merge($update_data, $new_data);
         $op_model->update($op_id, $update_data);
     }
 }
예제 #21
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('rekening'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("rekening/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('kode' => empty($input_post['kode']) ? NULL : $input_post['kode'], 'nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'levelid' => empty($input_post['levelid']) ? NULL : $input_post['levelid'], 'issummary' => empty($input_post['issummary']) ? 0 : 1, 'defsign' => empty($input_post['defsign']) ? NULL : $input_post['defsign'], 'isppkd' => empty($input_post['isppkd']) ? 0 : 1, 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id(), 'enabled' => empty($input_post['enabled']) ? 0 : 1);
         $this->rekening_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('rekening'));
     }
     $data['dt'] = $post_data;
     $this->load->view('vrekening_form', $data);
 }
예제 #22
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('jalan_kelas'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("jalan_kelas/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'singkatan' => empty($input_post['singkatan']) ? NULL : $input_post['singkatan'], 'kriteria' => $input_post['kriteria'], 'nilai' => empty($input_post['nilai']) ? NULL : $input_post['nilai'], 'enabled' => empty($input_post['enabled']) ? 0 : 1, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->jalan_kelas_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('jalan_kelas'));
     }
     $data['dt'] = $post_data;
     $this->load->view('vjalan_kelas_form', $data);
 }
예제 #23
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('air_hda'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("air_hda/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $hda = pad_to_decimal($input_post['hda']);
         $volume = pad_to_decimal($input_post['volume']);
         $update_data = array('id' => empty($input_post['id']) ? NULL : $input_post['id'], 'golongan' => empty($input_post['golongan']) ? NULL : $input_post['golongan'], 'manfaat_id' => empty($input_post['manfaat_id']) ? NULL : $input_post['manfaat_id'], 'zona_id' => empty($input_post['zona_id']) ? NULL : $input_post['zona_id'], 'kelompok_usaha_id' => empty($input_post['kelompok_usaha_id']) ? NULL : $input_post['kelompok_usaha_id'], 'volume' => empty($volume) ? NULL : $volume, 'hda' => empty($hda) ? NULL : $hda, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->air_hda_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('air_hda'));
     }
     $get = $post_data;
     $select_data = $this->load->model('air_zona_model')->get_select2();
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->nama;
     }
     $js = 'id="id" class="input-xlarge" required ';
     $data['select_air_zona'] = form_dropdown('id', $options, $get->id, $js);
     $data['dt'] = $post_data;
     $this->load->view('vair_hda_form', $data);
 }
예제 #24
0
 function proces_op()
 {
     $mode = $this->uri->segment(4);
     $op_id = $this->input->get_post('op_id');
     $usaha_model = $this->load->model('usaha_model');
     $so = $usaha_model->get_so($this->input->get_post('op_usaha_id'));
     $update_data = array('customer_id' => $this->input->get_post('customer_id'), 'usaha_id' => $this->input->get_post('op_usaha_id'), 'so' => $so, 'kecamatan_id' => $this->input->get_post('op_kecamatan_id'), 'kelurahan_id' => $this->input->get_post('op_kelurahan_id'), 'notes' => $this->input->get_post('op_keterangan'), 'aktifnotes' => $this->input->get_post('aktifnotes'), 'customer_status_id' => $this->input->get_post('op_status'), 'enabled' => 1, 'tmt' => $this->input->get_post('op_tmt') == '' ? NULL : date('Y-m-d', strtotime($this->input->get_post('op_tmt'))), 'opnm' => $this->input->get_post('op_nama'), 'opalamat' => $this->input->get_post('op_alamat'), 'latitude' => pad_to_decimal($this->input->get_post('op_latitude')), 'longitude' => pad_to_decimal($this->input->get_post('op_longitude')), 'def_pajak_id' => $this->input->get_post('op_pajak_id'), 'kd_restojmlmeja' => pad_to_decimal($this->input->get_post('kd_restojmlmeja')), 'kd_restojmlkursi' => pad_to_decimal($this->input->get_post('kd_restojmlkursi')), 'kd_restojmltamu' => pad_to_decimal($this->input->get_post('kd_restojmltamu')), 'kd_filmkursi' => pad_to_decimal($this->input->get_post('kd_filmkursi')), 'kd_filmpertunjukan' => pad_to_decimal($this->input->get_post('kd_filmpertunjukan')), 'kd_filmtarif' => pad_to_decimal($this->input->get_post('kd_filmtarif')), 'kd_bilyarmeja' => pad_to_decimal($this->input->get_post('kd_bilyarmeja')), 'kd_bilyartarif' => pad_to_decimal($this->input->get_post('kd_bilyartarif')), 'kd_bilyarkegiatan' => pad_to_decimal($this->input->get_post('kd_bilyarkegiatan')), 'kd_diskopengunjung' => pad_to_decimal($this->input->get_post('kd_diskopengunjung')), 'kd_diskotarif' => pad_to_decimal($this->input->get_post('kd_diskotarif')), 'mall_id' => pad_to_decimal($this->input->get_post('op_mall_id')), 'cash_register' => pad_to_decimal($this->input->get_post('op_cash_register')), 'pelaporan' => pad_to_decimal($this->input->get_post('op_pelaporan')), 'pembukuan' => pad_to_decimal($this->input->get_post('op_pembukuan')), 'bandara' => pad_to_decimal($this->input->get_post('op_bandara')), 'wajib_pajak' => pad_to_decimal($this->input->get_post('op_wajib_pajak')), 'jumlah_karyawan' => pad_to_decimal($this->input->get_post('jumlah_karyawan')), 'tanggal_tutup' => $this->input->get_post('tanggal_tutup') == '' ? NULL : date('Y-m-d', strtotime($this->input->get_post('tanggal_tutup'))), 'parkir_luas' => pad_to_decimal($this->input->get_post('parkir_luas')), 'parkir_masuk' => pad_to_decimal($this->input->get_post('parkir_masuk')), 'parkir_keluar' => pad_to_decimal($this->input->get_post('parkir_keluar')), 'parkir_tarif_mobil' => pad_to_decimal($this->input->get_post('parkir_tarif_mobil')), 'parkir_tambahan' => pad_to_decimal($this->input->get_post('parkir_tambahan')), 'parkir_kapasitas_mobil' => pad_to_decimal($this->input->get_post('parkir_kapasitas_mobil')), 'parkir_mobil_hari' => pad_to_decimal($this->input->get_post('parkir_mobil_hari')), 'parkir_motor_luas' => pad_to_decimal($this->input->get_post('parkir_motor_luas')), 'parkir_motor_masuk' => pad_to_decimal($this->input->get_post('parkir_motor_masuk')), 'parkir_motor_keluar' => pad_to_decimal($this->input->get_post('parkir_motor_keluar')), 'parkir_tarif_motor' => pad_to_decimal($this->input->get_post('parkir_tarif_motor')), 'parkir_motor_tambahan' => pad_to_decimal($this->input->get_post('parkir_motor_tambahan')), 'parkir_kapasitas_motor' => pad_to_decimal($this->input->get_post('parkir_kapasitas_motor')), 'parkir_motor_hari' => pad_to_decimal($this->input->get_post('parkir_motor_hari')), 'kelompok_usaha_id' => pad_to_decimal($this->input->get_post('op_kelompok_usaha_id')), 'zona_id' => pad_to_decimal($this->input->get_post('op_zona')), 'manfaat_id' => pad_to_decimal($this->input->get_post('op_golongan')), 'golongan_id' => pad_to_decimal($this->input->get_post('op_manfaat')));
     $op_model = $this->load->model('objek_pajak_model');
     if ($mode == 'add') {
         $konter = $op_model->max_konter($this->input->get_post('customer_id'));
         $this->session->set_userdata('konter', $konter);
         $new_data = array('konterid' => $konter, 'reg_date' => date('Y-m-d'), 'created' => date('Y-m-d h:i:s'), 'create_uid' => sipkd_user_id());
         $update_data = array_merge($update_data, $new_data);
         $op_model->save($update_data);
     }
     if ($mode == 'edit') {
         $new_data = array('updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $update_data = array_merge($update_data, $new_data);
         $op_model->update($op_id, $update_data);
     }
     // data tambahan / detail
     $dtKD = $this->input->post('dtKD');
     $tambahan_data2 = array();
     if (isset($dtKD)) {
         $i = 1;
         $dtKD = json_decode($dtKD, true);
         if (count($dtKD['dtKD']) > 0) {
             if ($mode == 'add') {
                 $konter = $this->session->userdata('konter');
                 $this->session->unset_userdata('konter');
                 $query = $this->db->query("SELECT id FROM pad_customer_usaha ORDER BY id DESC LIMIT 1");
                 foreach ($query->result() as $row) {
                     $cu_id = $row->id;
                 }
             }
             if ($mode == 'edit') {
                 $konter = $this->input->get_post('op_konterid');
                 $cu_id = $this->input->get_post('op_id');
             }
             $cid = $this->input->get_post('customer_id');
             $op_u_id = $this->input->get_post('op_usaha_id');
             $rd_row = array();
             foreach ($dtKD['dtKD'] as $rows) {
                 $rd_row = array('customer_id' => $cid, 'customer_usaha_id' => $cu_id, 'konterid' => $konter, 'usaha_id' => $op_u_id, 'nourut' => $i, 'notes' => $rows[0], 'tarif' => pad_to_decimal($rows[1]), 'kamar' => pad_to_decimal($rows[2]), 'volume' => pad_to_decimal($rows[3]));
                 $i++;
                 $tambahan_data2 = array_merge($tambahan_data2, array($rd_row));
             }
             //langsung ajah dah - sementara
             $query = "delete from pad_customer_detail where (customer_id={$cid} and konterid={$konter})";
             $this->db->query($query);
             $this->db->insert_batch('pad_customer_detail', $tambahan_data2);
         }
     }
     $dtAT = $this->input->post('dtAT');
     $tambahan_data2 = array();
     if (isset($dtAT)) {
         $i = 1;
         $dtAT = json_decode($dtAT, true);
         if (count($dtAT['dtAT']) > 0) {
             if ($mode == 'add') {
                 $konter = $this->session->userdata('konter');
                 $this->session->unset_userdata('konter');
                 $query = $this->db->query("SELECT id FROM pad_customer_usaha ORDER BY id DESC LIMIT 1");
                 foreach ($query->result() as $row) {
                     $cu_id = $row->id;
                 }
             }
             if ($mode == 'edit') {
                 $konter = $this->input->get_post('op_konterid');
                 $cu_id = $this->input->get_post('op_id');
             }
             $cid = $this->input->get_post('customer_id');
             $op_u_id = $this->input->get_post('op_usaha_id');
             $rd_row = array();
             foreach ($dtAT['dtAT'] as $rows) {
                 $rd_row = array('customer_id' => $cid, 'konterid' => $konter, 'customer_usaha_id' => $cu_id, 'sumur_ke' => $i, 'sipa_no' => $rows[1], 'max_volume' => pad_to_decimal($rows[2]), 'disabled' => $rows[3]);
                 $i++;
                 $tambahan_data2 = array_merge($tambahan_data2, array($rd_row));
             }
             //langsung ajah dah - sementara
             $query = "delete from pad_customer_usaha_air_tanah where (customer_id={$cid} and konterid={$konter})";
             $this->db->query($query);
             $this->db->insert_batch('pad_customer_usaha_air_tanah', $tambahan_data2);
         }
     }
 }
예제 #25
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('pegawai'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("pegawai/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'jabatan' => empty($input_post['jabatan']) ? NULL : $input_post['jabatan'], 'golongan' => empty($input_post['golongan']) ? NULL : $input_post['golongan'], 'nip' => empty($input_post['nip']) ? NULL : $input_post['nip'], 'nomor_telp' => empty($input_post['nomor_telp']) ? NULL : $input_post['nomor_telp'], 'bagian' => empty($input_post['bagian']) ? NULL : $input_post['bagian'], 'pangkat' => empty($input_post['pangkat']) ? NULL : $input_post['pangkat'], 'tmt' => empty($input_post['tmt']) ? NULL : date('Y-m-d', strtotime($input_post['tmt'])), 'enabled' => empty($input_post['enabled']) ? 0 : 1, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->pegawai_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('pegawai'));
     }
     $data['dt'] = $post_data;
     $this->load->view('vpegawai_form', $data);
 }
예제 #26
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('air_detail_kelompok_usaha'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("air_detail_kelompok_usaha/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('kode' => empty($input_post['kode']) ? NULL : $input_post['kode'], 'nama' => empty($input_post['nama']) ? NULL : $input_post['nama'], 'induk_id' => empty($input_post['induk_id']) ? NULL : $input_post['induk_id'], 'level' => 2, 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $induk_id = $input_post['induk_id'];
         $this->air_detail_kelompok_usaha_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('air_detail_kelompok_usaha/index/' . $induk_id));
     }
     $data['dt'] = $post_data;
     $this->load->view('vair_detail_kelompok_usaha_form', $data);
 }
예제 #27
0
 function proses_skpdj($spt_id, $omset)
 {
     $this->load->model('sptpd_model');
     $this->load->model('pajak_model');
     $sptpd = $this->sptpd_model->get($spt_id);
     $tahun = date('Y');
     $sptno = $this->sptpd_model->generate_sptno($tahun);
     $omset_skpdj = $omset * 125 / 100;
     $terimatgl = date('Y-m-d');
     $lastmonth = mktime(0, 0, 0, date("m") - 1, date("d"), date("Y"));
     $lastmonth = date('Y-m-d', $lastmonth);
     $masadari = date("Y-m-01", strtotime($lastmonth));
     $masasd = date("Y-m-t", strtotime($lastmonth));
     $jatuhtempo = date_create($terimatgl);
     date_modify($jatuhtempo, "+30 days");
     $jatuhtempotgl = date_format($jatuhtempo, "Y-m-d");
     $skpdj_type_id = '3';
     // <------------ id default
     $skpdj_type = $this->db->query("select id from pad_spt_type where typenm ilike '%skpdj%' limit 1");
     if ($skpdj_type->num_rows() !== 0) {
         $skpdj_type_id = $skpdj_type->row()->id;
     }
     $so = 'O';
     $pajak_id = $sptpd->pajak_id;
     $tarif = $this->db->query("select tarif from pad_tarif_pajak where pajak_id={$pajak_id}\r\n            order by tmt desc limit 1")->row()->tarif;
     $pajak_terhutang = $omset_skpdj * $tarif;
     $notes = 'entry by system';
     $user_id = sipkd_user_id();
     //SPT
     $sql = "insert into pad_spt(\r\n            tahun, sptno, type_id, so, masadari, masasd, jatuhtempotgl, \r\n            dasar, tarif, denda, bunga, setoran, kenaikan, kompensasi, lain2, \r\n            pajak_terhutang, \r\n            enabled, created, create_uid, terimanip, terimatgl, isprint_dc, \r\n            status_pembayaran, notes,\r\n\r\n            customer_id, customer_usaha_id, rekening_id, \r\n            pajak_id, r_bayarid, \r\n            minimal_omset, air_manfaat_id, air_zona_id, meteran_awal, \r\n            meteran_akhir, volume, satuan, r_panjang, r_lebar, r_muka, r_banyak, \r\n            r_luas, r_tarifid, r_kontrak, r_lama, r_jalan_id, r_jalanklas_id, \r\n            r_lokasi, r_judul, r_kelurahan_id, r_lokasi_id, r_calculated, \r\n            r_nsr, r_nsrno, r_nsrtgl, r_nsl_kecamatan_id, r_nsl_type_id, \r\n            r_nsl_nilai, unit_id, \r\n            r_nsr_id, r_lokasi_pasang_id, r_lokasi_pasang_val, r_jalanklas_val, \r\n            r_sudut_pandang_id, r_sudut_pandang_val, r_tinggi, r_njop, r_status, \r\n            r_njop_ketinggian, rek_no_paneng, sptno_lengkap, \r\n            sptno_lama, r_nama, r_alamat)\r\n\r\n            (select \r\n            {$tahun}, {$sptno}, {$skpdj_type_id}, '{$so}', '{$masadari}', '{$masasd}', '{$jatuhtempotgl}', \r\n            {$omset_skpdj}, {$tarif}, 0 denda, 0 bunga, 0 setoran, 0 kenaikan, 0 kompensasi, 0lain2, \r\n            {$pajak_terhutang}, \r\n            1 enabled, '{$terimatgl}', {$user_id}, {$user_id}, '{$terimatgl}', false isprint_dc, \r\n            0 status_pembayaran, '{$notes}', \r\n\r\n            customer_id, customer_usaha_id, rekening_id, \r\n            pajak_id, r_bayarid, \r\n            minimal_omset, air_manfaat_id, air_zona_id, meteran_awal, \r\n            meteran_akhir, volume, satuan, r_panjang, r_lebar, r_muka, r_banyak, \r\n            r_luas, r_tarifid, r_kontrak, r_lama, r_jalan_id, r_jalanklas_id, \r\n            r_lokasi, r_judul, r_kelurahan_id, r_lokasi_id, r_calculated, \r\n            r_nsr, r_nsrno, r_nsrtgl, r_nsl_kecamatan_id, r_nsl_type_id, \r\n            r_nsl_nilai, unit_id, \r\n            r_nsr_id, r_lokasi_pasang_id, r_lokasi_pasang_val, r_jalanklas_val, \r\n            r_sudut_pandang_id, r_sudut_pandang_val, r_tinggi, r_njop, r_status, \r\n            r_njop_ketinggian, rek_no_paneng, sptno_lengkap, \r\n            sptno_lama, r_nama, r_alamat\r\n            from pad_spt where id={$spt_id})";
     $this->db->query($sql);
     $new_spt_id = $this->db->insert_id();
     //SKPD J
     $usaha_id = $this->pajak_model->get($sptpd->pajak_id)->usaha_id;
     $kohirno = $this->generate_kohirno($tahun, $usaha_id);
     $update_data = array('spt_id' => $new_spt_id, 'kohirno' => $kohirno, 'usaha_id' => $usaha_id, 'tahun' => $tahun, 'kohirtgl' => $terimatgl, 'enabled' => 1, 'created' => $terimatgl, 'create_uid' => $user_id);
     $this->save($update_data);
     /*        
     $ret = new stdClass();
     $ret->cid  = $new_cid;
     $ret->cuid = $new_cuid;
     return $ret; 
     */
 }
예제 #28
0
 public function update()
 {
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url('anggaran'));
     }
     $p_id = $this->uri->segment(4);
     $post_data = $this->fpost();
     $data['current'] = 'referensi';
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("anggaran/update/{$p_id}");
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('rekening_id' => empty($input_post['rekening_id']) ? NULL : $input_post['rekening_id'], 'tahun' => empty($input_post['tahun']) ? NULL : $input_post['tahun'], 'status_anggaran' => empty($input_post['status_anggaran']) ? NULL : $input_post['status_anggaran'], 'target' => empty($input_post['target']) ? NULL : $input_post['target'], 'bulan1' => empty($input_post['bulan1']) ? NULL : $input_post['bulan1'], 'bulan2' => empty($input_post['bulan2']) ? NULL : $input_post['bulan2'], 'bulan3' => empty($input_post['bulan3']) ? NULL : $input_post['bulan3'], 'bulan4' => empty($input_post['bulan4']) ? NULL : $input_post['bulan4'], 'bulan5' => empty($input_post['bulan5']) ? NULL : $input_post['bulan5'], 'bulan6' => empty($input_post['bulan6']) ? NULL : $input_post['bulan6'], 'bulan7' => empty($input_post['bulan7']) ? NULL : $input_post['bulan7'], 'bulan8' => empty($input_post['bulan8']) ? NULL : $input_post['bulan8'], 'bulan9' => empty($input_post['bulan9']) ? NULL : $input_post['bulan9'], 'bulan10' => empty($input_post['bulan10']) ? NULL : $input_post['bulan10'], 'bulan11' => empty($input_post['bulan11']) ? NULL : $input_post['bulan11'], 'bulan12' => empty($input_post['bulan12']) ? NULL : $input_post['bulan12'], 'jumlah' => empty($input_post['jumlah']) ? NULL : $input_post['jumlah'], 'updated' => date('Y-m-d h:i:s'), 'update_uid' => sipkd_user_id());
         $this->anggaran_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url('anggaran'));
     }
     $get = $post_data;
     $select_data = $this->load->model('rekening_model')->get_select(4);
     $options = array();
     foreach ($select_data as $row) {
         $options[$row->id] = $row->kode . ' | ' . $row->nama;
     }
     $js = 'id="rekening_id" class="input-xxlarge" required ';
     $data['select_rekening'] = form_dropdown('rekening_id', $options, $get->rekening_id, $js);
     $data['dt'] = $post_data;
     $this->load->view('vanggaran_form', $data);
 }
예제 #29
0
            ?>
                  <option value="">Not configured!</option>
                <?php 
        }
        ?>
              </select>
              <?php 
    }
    ?>
    
             
                </li>
                <li class="user-footer">
                  <div class="pull-left">
                    <a class="btn btn-default btn-flat" href="<?php 
    echo base_url() . 'admin/users2/changepwd/' . sipkd_user_id();
    ?>
">Ubah Password</a>
                  </div>
                  <div class="pull-right">
                    <a class="btn btn-default btn-flat" href="<?php 
    echo base_url() . 'logout';
    ?>
">Logout</a>
                  </div>
                </li>
              </ul>
            </li>
            <?php 
}
?>
예제 #30
0
파일: stpd.php 프로젝트: aagusti/padl-tng
 public function proses_stpd()
 {
     $this->load_auth();
     if (!$this->module_auth->create) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_create);
         redirect(active_module_url($this->controller));
     }
     $spt_id = $this->uri->segment(4);
     $petugas_id = $this->uri->segment(5);
     $pejabat_id = $this->uri->segment(6);
     if ($spt_id && ($sptpd = $this->sptpd_model->get($spt_id))) {
         // hitung bunga (telat bayar)
         $tgl_proses = new DateTime(Date('Y-m-d'));
         $tgl_jtempo = new DateTime(Date('Y-m-d', strtotime($sptpd->jatuhtempotgl)));
         $new_tgl_jtempo = $tgl_jtempo;
         $diff = $tgl_proses->diff($tgl_jtempo);
         $nbln = $diff->format('%y') * 12 + $diff->format('%m');
         $nbln = $tgl_proses <= $tgl_jtempo ? 0 : $nbln;
         $nbln = $nbln > 24 ? 24 : $nbln;
         $pajak = $sptpd->pajak_terhutang;
         $bunga = (double) $pajak * (int) $nbln * (double) pad_bunga() + (double) $sptpd->bunga;
         // end hitung bunga
         $usaha_id = $this->load->model('pad_model')->sptpd_get_usaha_id($sptpd->customer_usaha_id);
         $jth_tempo = $this->load->model('pajak_model')->get_jatuhtempo($usaha_id);
         if ($nbln > 0) {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$nbln} month");
             } else {
                 $xbln = 2 + (int) $nbln;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         } else {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+30 day");
             } else {
                 $xbln = 2;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         }
         while ($new_tgl_jtempo <= $tgl_proses) {
             if ($jth_tempo > 0) {
                 $new_tgl_jtempo = $tgl_jtempo->modify("+30 day");
             } else {
                 $xbln = 2;
                 $new_tgl_jtempo = $tgl_jtempo->modify("+{$xbln} month");
                 $new_tgl_jtempo = $new_tgl_jtempo->modify("-1 day");
             }
         }
         $stpdno = $this->stpd_model->generate_stpdno(pad_tahun_anggaran());
         $update_data = array('stpdno' => $stpdno, 'tahun' => pad_tahun_anggaran(), 'stpdtgl' => date_format($tgl_proses, 'Y-m-d'), 'jatuhtempotgl' => date_format($new_tgl_jtempo, 'Y-m-d'), 'stpdcount' => $nbln + 1, 'bunga' => $this->session->userdata('denda'), 'spt_id' => $spt_id, 'petugas_id' => $petugas_id, 'pejabat_id' => $pejabat_id, 'enabled' => 1, 'created' => date('Y-m-d h:i:s'), 'create_uid' => sipkd_user_id());
         $this->stpd_model->save($update_data);
         //$this->db->query("update pad_invoice set status_bayar = 3 where id=$spt_id");
         //$this->db->query("update pad_invoice set status_bayar = 2 where id=$spt_id");
         echo "ok";
         $this->session->set_userdata('denda', 0);
     } else {
         echo "hmm";
         $this->session->set_userdata('denda', 0);
     }
 }