async: false, success: function (data) { $('#pajak_id').html(data); }, error: function (xhr, desc, er) { alert(er); } }); global_cu_id = cu_id; } function set_so(type_id) { if (type_id == <?php echo pad_dok_self_id(); ?> ) $('#so').val('S'); else $('#so').val('O'); } function get_pajak_detail() { var pajak_id = $('#pajak_id').val(); var masadari = $('#masadari').val(); if (masadari == '') { var sekarang = new Date(); /* $('#masadari').val(sekarang.getDate()+"-"+sekarang.getMonth()+"-"+sekarang.getFullYear()); masadari = $('#masadari').val();
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); } } } }