public function get_validasi() { $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); $this->session->set_userdata('usaha_id', $p_usaha_id); $sptpd = $this->sptpd_model->get($p_id); $tglinput = date('Y-m-d', strtotime($sptpd->created)); /* if ($tglinput < date('Y-m-d')) { $this->session->set_flashdata('msg_warning', 'Aktivitas Edit diperbolehkan hanya dalam waktu 1 hari'); redirect(active_module_url($this->controller)); } */ //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 pmb /* if ($this->sptpd_model->is_sspd_ok($spt_id) || $this->sptpd_model->is_bayar_ok($spt_id)) { $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update); redirect(active_module_url("{$this->controller}/index/{$p_usaha_id}")); } */ /* 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)); } */ $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}"); if ($p_id && ($get = $this->sptpd_model->get($p_id))) { $data['dt']['id'] = $get->id; $data['dt']['customer_usaha_id'] = $get->customer_usaha_id; $data['dt']['pajak_id'] = $get->pajak_id; $data['dt']['tahun'] = $get->tahun; $data['dt']['sptno'] = $get->sptno; $data['dt']['terimanip'] = $get->terimanip; $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl)); $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl)); $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime($get->jatuhtempotgl)); $data['dt']['type_id'] = $get->type_id; $data['dt']['so'] = $get->so; $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari)); $data['dt']['masapajak_bulan'] = date('M-Y', strtotime($get->masadari)); $masapajak_bulan = date('M-Y', strtotime($get->masadari)); $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd)); $data['dt']['minimal_omset'] = $get->minimal_omset; $data['dt']['dasar'] = $get->dasar; $data['dt']['tarif'] = $get->tarif; $data['dt']['denda'] = $get->denda; $data['dt']['bunga'] = $get->bunga; $data['dt']['setoran'] = $get->setoran; $data['dt']['kenaikan'] = $get->kenaikan; $data['dt']['kompensasi'] = $get->kompensasi; $data['dt']['lain2'] = $get->lain2; $data['dt']['air_manfaat_id'] = $get->air_manfaat_id; $data['dt']['air_zona_id'] = $get->air_zona_id; $data['dt']['meteran_awal'] = $get->meteran_awal; $data['dt']['meteran_akhir'] = $get->meteran_akhir; $data['dt']['r_bayarid'] = $get->r_bayarid; $data['dt']['r_tarifid'] = $get->r_tarifid; $data['dt']['enabled'] = $get->enabled; $data['dt']['unit_id'] = $get->unit_id; $data['dt']['customer_id'] = $get->customer_id; $data['dt']['isprint_dc'] = $get->isprint_dc; $data['dt']['notes'] = $get->notes; $data['dt']['rekening_id'] = $get->rekening_id; $data['dt']['cara_bayar'] = $get->cara_bayar; if (wp_login()) { // data tambahan // } $data['dt']['nopd'] = $this->load->model('objek_pajak_model')->get_nopd($get->customer_usaha_id); $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; if ($rows->id == $get->pajak_id) { $nama_pajak = $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); $select_data = array((object) array('id' => 2, 'cara_bayar' => 'ATM / TELLER'), (object) array('id' => 1, 'cara_bayar' => 'TRANSFER')); $cara_bayar = ''; if ($select_data) { foreach ($select_data as $row) { if ($row->id == $data['dt']['cara_bayar']) { $cara_bayar .= "<option value={$row->id} selected >{$row->cara_bayar}</option>"; } else { $cara_bayar .= "<option value={$row->id}>{$row->cara_bayar}</option>"; } } } $val_data = $this->sptpd_model->get($p_id); $val_data->id = $data['dt']['id']; $val_data->masapajak_bulan = $masapajak_bulan; $val_data->nama_pajak = $nama_pajak; $val_data->cara_bayar = $cara_bayar; $val_data->pajak = $data['dt']['dasar'] * $data['dt']['tarif']; $val_data->jatuhtempotgl = $data['dt']['jatuhtempotgl']; echo json_encode($val_data); if ($p_usaha_id == pad_reklame_id() && $p_type_id == pad_dok_office_id()) { // } else { if ($p_usaha_id == pad_air_tanah_id() && $p_type_id == pad_dok_office_id()) { // } else { } } } else { show_404(); } }
public function edit() { 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}"); if ($p_id && ($get = $this->sptpd_model->get($p_id))) { $data['dt']['id'] = $get->id; $data['dt']['customer_usaha_id'] = $get->customer_usaha_id; $data['dt']['pajak_id'] = $get->pajak_id; $data['dt']['tahun'] = $get->tahun; $data['dt']['sptno'] = $get->sptno; $data['dt']['terimanip'] = $get->terimanip; $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl)); $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl)); $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime($get->jatuhtempotgl)); $data['dt']['type_id'] = $get->type_id; $data['dt']['so'] = $get->so; $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari)); $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd)); $data['dt']['minimal_omset'] = $get->minimal_omset; $data['dt']['dasar'] = $get->dasar; $data['dt']['tarif'] = $get->tarif; $data['dt']['denda'] = $get->denda; $data['dt']['bunga'] = $get->bunga; $data['dt']['setoran'] = $get->setoran; $data['dt']['kenaikan'] = $get->kenaikan; $data['dt']['kompensasi'] = $get->kompensasi; $data['dt']['lain2'] = $get->lain2; $data['dt']['air_manfaat_id'] = $get->air_manfaat_id; $data['dt']['air_zona_id'] = $get->air_zona_id; $data['dt']['meteran_awal'] = $get->meteran_awal; $data['dt']['meteran_akhir'] = $get->meteran_akhir; $data['dt']['volume'] = $get->volume; $data['dt']['satuan'] = $get->satuan; $data['dt']['r_nsr'] = $get->r_nsr; $data['dt']['r_nsrno'] = $get->r_nsrno; $data['dt']['r_nsrtgl'] = empty($get->r_nsrtgl) ? NULL : date('d-m-Y', strtotime($get->r_nsrtgl)); $data['dt']['r_bayarid'] = $get->r_bayarid; $data['dt']['r_tarifid'] = $get->r_tarifid; $data['dt']['r_kontrak'] = $get->r_kontrak; $data['dt']['r_lama'] = $get->r_lama; $data['dt']['r_jalanklas_id'] = $get->r_jalanklas_id; $data['dt']['r_jalan_id'] = $get->r_jalan_id; $data['dt']['r_lokasi'] = $get->r_lokasi; $data['dt']['r_judul'] = $get->r_judul; $data['dt']['r_panjang'] = $get->r_panjang; $data['dt']['r_lebar'] = $get->r_lebar; $data['dt']['r_muka'] = $get->r_muka; $data['dt']['r_banyak'] = $get->r_banyak; $data['dt']['r_luas'] = $get->r_luas; $data['dt']['enabled'] = $get->enabled; $data['dt']['unit_id'] = $get->unit_id; $data['dt']['created'] = date('d-m-Y', strtotime($get->created)); $data['dt']['create_uid'] = $get->create_uid; $data['dt']['updated'] = date('d-m-Y', strtotime($get->updated)); $data['dt']['update_uid'] = $get->update_uid; $data['dt']['customer_id'] = $get->customer_id; $data['dt']['r_nsl_kecamatan_id'] = $get->r_nsl_kecamatan_id; $data['dt']['r_nsl_type_id'] = $get->r_nsl_type_id; $data['dt']['r_nsl_nilai'] = $get->r_nsl_nilai; $data['dt']['r_kelurahan_id'] = $get->r_kelurahan_id; $data['dt']['isprint_dc'] = $get->isprint_dc; $data['dt']['notes'] = $get->notes; $data['dt']['r_lokasi_id'] = $get->r_lokasi_id; $data['dt']['rekening_id'] = $get->rekening_id; $data['dt']['no_skpd_lama'] = $get->no_skpd_lama; $data['dt']['r_calculated'] = $get->r_calculated; $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() && $p_type_id == pad_dok_office_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() && $p_type_id == pad_dok_office_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); } } } else { show_404(); } }
public function edit() { $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); $sptpd = $this->sptpd_model->get($p_id); $tglinput = date('Y-m-d', strtotime($sptpd->create_date)); if ($tglinput < date('Y-m-d')) { $this->session->set_flashdata('msg_warning', 'Data sudah tidak dapat di edit'); redirect(active_module_url($this->controller)); } //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}"); if ($p_id && ($get = $this->sptpd_model->get($p_id))) { $data['dt']['id'] = $get->id; $data['dt']['customer_usaha_id'] = $get->customer_usaha_id; $data['dt']['pajak_id'] = $get->pajak_id; $data['dt']['tahun'] = $get->tahun; $data['dt']['sptno'] = $get->sptno; $data['dt']['terimanip'] = $get->terimanip; $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl)); $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl)); $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime($get->jatuhtempotgl)); $data['dt']['type_id'] = $get->type_id; $data['dt']['so'] = $get->so; $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari)); $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd)); $data['dt']['minomset'] = $get->minomset; $data['dt']['dasar'] = $get->dasar; $data['dt']['tarif'] = $get->tarif; $data['dt']['denda'] = $get->denda; $data['dt']['bunga'] = $get->bunga; $data['dt']['setoran'] = $get->setoran; $data['dt']['kenaikan'] = $get->kenaikan; $data['dt']['kompensasi'] = $get->kompensasi; $data['dt']['lain2'] = $get->lain2; $data['dt']['air_manfaat_id'] = $get->air_manfaat_id; $data['dt']['air_zona_id'] = $get->air_zona_id; $data['dt']['meteran_awal'] = $get->meteran_awal; $data['dt']['meteran_akhir'] = $get->meteran_akhir; $data['dt']['r_bayarid'] = $get->r_bayarid; $data['dt']['r_tarifid'] = $get->r_tarifid; $data['dt']['enabled'] = $get->enabled; $data['dt']['unit_id'] = $get->unit_id; $data['dt']['create_date'] = date('d-m-Y', strtotime($get->create_date)); $data['dt']['create_uid'] = $get->create_uid; $data['dt']['write_date'] = date('d-m-Y', strtotime($get->write_date)); $data['dt']['write_uid'] = $get->write_uid; $data['dt']['customer_id'] = $get->customer_id; $data['dt']['isprint_dc'] = $get->isprint_dc; $data['dt']['notes'] = $get->notes; $data['dt']['rekening_id'] = $get->rekening_id; if (wp_login()) { // data tambahan // } $data['dt']['nopd'] = $this->load->model('objek_pajak_model')->get_nopd($get->customer_usaha_id); $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() && $p_type_id == pad_dok_office_id()) { // } else { if ($p_usaha_id == pad_air_tanah_id() && $p_type_id == pad_dok_office_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); } } } } else { show_404(); } }
public function edit() { $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 kohir if ($this->sptpd_model->is_kohir_ok($p_id) && !is_super_admin()) { $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update); redirect(active_module_url($this->controller)); } // cek pmb // kalau user sa boleh edit. 17-10-2014 (AA) if (($this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) && !is_super_admin()) { $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update); redirect(active_module_url($this->controller)); } /* $data['editable'] = 1; if ($this->sptpd_model->is_kohir_ok($p_id) || $this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) { $data['editable'] = 0; } */ $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}"); if ($p_id && ($get = $this->sptpd_model->get($p_id))) { $data['dt']['id'] = $get->id; $data['dt']['customer_usaha_id'] = $get->customer_usaha_id; $data['dt']['pajak_id'] = $get->pajak_id; $data['dt']['tahun'] = $get->tahun; $data['dt']['sptno'] = $get->sptno; $data['dt']['terimanip'] = $get->terimanip; $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl)); $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl)); $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime($get->jatuhtempotgl)); $data['dt']['type_id'] = $get->type_id; $data['dt']['so'] = $get->so; $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari)); $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd)); $data['dt']['minomset'] = $get->minomset; $data['dt']['dasar'] = $get->dasar; $data['dt']['tarif'] = $get->tarif; $data['dt']['denda'] = $get->denda; $data['dt']['bunga'] = $get->bunga; $data['dt']['setoran'] = $get->setoran; $data['dt']['kenaikan'] = $get->kenaikan; $data['dt']['kompensasi'] = $get->kompensasi; $data['dt']['lain2'] = $get->lain2; $data['dt']['air_manfaat_id'] = $get->air_manfaat_id; $data['dt']['air_zona_id'] = $get->air_zona_id; $data['dt']['meteran_awal'] = $get->meteran_awal; $data['dt']['meteran_akhir'] = $get->meteran_akhir; $data['dt']['volume'] = $get->volume; $data['dt']['satuan'] = $get->satuan; $data['dt']['r_nsr'] = $get->r_nsr; $data['dt']['r_nsrno'] = $get->r_nsrno; $data['dt']['r_nsrtgl'] = empty($get->r_nsrtgl) ? NULL : date('d-m-Y', strtotime($get->r_nsrtgl)); $data['dt']['r_bayarid'] = $get->r_bayarid; $data['dt']['r_tarifid'] = $get->r_tarifid; $data['dt']['r_kontrak'] = $get->r_kontrak; $data['dt']['r_lama'] = $get->r_lama; $data['dt']['r_jalanklas_id'] = $get->r_jalanklas_id; $data['dt']['r_jalan_id'] = $get->r_jalan_id; $data['dt']['r_lokasi'] = $get->r_lokasi; $data['dt']['r_judul'] = $get->r_judul; $data['dt']['r_panjang'] = $get->r_panjang; $data['dt']['r_lebar'] = $get->r_lebar; $data['dt']['r_muka'] = $get->r_muka; $data['dt']['r_banyak'] = $get->r_banyak; $data['dt']['r_luas'] = $get->r_luas; $data['dt']['enabled'] = $get->enabled; $data['dt']['unit_id'] = $get->unit_id; $data['dt']['create_date'] = date('d-m-Y', strtotime($get->create_date)); $data['dt']['create_uid'] = $get->create_uid; $data['dt']['write_date'] = date('d-m-Y', strtotime($get->write_date)); $data['dt']['write_uid'] = $get->write_uid; $data['dt']['customer_id'] = $get->customer_id; $data['dt']['r_nsl_kecamatan_id'] = $get->r_nsl_kecamatan_id; $data['dt']['r_nsl_type_id'] = $get->r_nsl_type_id; $data['dt']['r_nsl_nilai'] = $get->r_nsl_nilai; $data['dt']['r_kelurahan_id'] = $get->r_kelurahan_id; $data['dt']['isprint_dc'] = $get->isprint_dc; $data['dt']['notes'] = $get->notes; $data['dt']['r_lokasi_id'] = $get->r_lokasi_id; $data['dt']['rekening_id'] = $get->rekening_id; $data['dt']['r_calculated'] = $get->r_calculated; $data['dt']['r_njop'] = $get->r_njop; $data['dt']['r_jalanklas_val'] = $get->r_jalanklas_val; $data['dt']['r_lokasi_pasang_val'] = $get->r_lokasi_pasang_val; $data['dt']['r_sudut_pandang_val'] = $get->r_sudut_pandang_val; $data['dt']['r_tinggi'] = $get->r_tinggi; $data['dt']['r_status'] = $get->r_status; $data['dt']['nama'] = $get->r_nama; $data['dt']['nopd'] = $this->load->model('objek_pajak_model')->get_nopd($get->customer_usaha_id, false); $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('pad_model')->sptpd_get_pajak($p_usaha_id); $options = array(); if ($select_data) { foreach ($select_data as $rows) { if ($p_usaha_id == pad_reklame_id()) { $options[$rows->id] = $rows->nama . " = " . number_format($rows->reklame, 0, ',', '.'); } else { $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(); if ($select_data) { 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; } else { $data['dt']['rekeningkd'] = ''; $data['dt']['jatuhtempo'] = ''; } if ($p_usaha_id == pad_reklame_id() && $p_type_id == pad_dok_office_id()) { //-new $select_data = $this->load->model('reklame_nilai_strategis_model')->get_select(); $options = array(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->nsrnm; } } $js = 'id="r_nsr_id" class="input-xlarge" required '; $data['select_nsr'] = form_dropdown('r_nsr_id', $options, $get->r_nsr_id, $js); $select_data = $this->load->model('rek_lokasi_pasang_model')->get_select(); $options = array(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->lokasinm; } } $js = 'id="r_lokasi_pasang_id" class="input-xlarge" required '; $data['select_lokasi_pasang'] = form_dropdown('r_lokasi_pasang_id', $options, $get->r_lokasi_pasang_id, $js); $select_data = $this->load->model('rek_sudut_pandang_model')->get_select(); $options = array(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->sudutnm; } } $js = 'id="r_sudut_pandang_id" class="input-xlarge" required '; $data['select_sudut_pandang'] = form_dropdown('r_sudut_pandang_id', $options, $get->r_sudut_pandang_id, $js); $options = array('Pasang Baru' => 'Pasang Baru', 'Perpanjangan' => 'Perpanjangan'); $js = 'id="r_status" class="input-large" required '; $data['select_status'] = form_dropdown('r_status', $options, $get->r_status, $js); //-end-new $select_data = $this->load->model('jalan_klas_model')->get_select(); $options = array(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->kelasnm; } } $js = 'id="r_jalanklas_id" class="input-xlarge" required '; $data['select_jalan_klas'] = form_dropdown('r_jalanklas_id', $options, $get->r_jalanklas_id, $js); $select_data = $this->load->model('jalan_model')->get_select(); $options = array(); if ($select_data) { $options[] = "# KOSONG #"; foreach ($select_data as $row) { $options[$row->id] = $row->jalannm; } } $js = 'id="r_jalan_id" class="input-large combobox" '; $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(); if ($select_data) { 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 => 'Produk Rokok +25%', 3 => 'Reklame Pendidikan -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); if (!wp_login()) { $this->load->view('vsptpd_form_reklame', $data); } else { $data['dt']['customer_id'] = wp_id(); $this->load->view('wp/vsptpd_form_reklame', $data); } } else { if ($p_usaha_id == pad_air_tanah_id() && $p_type_id == pad_dok_office_id()) { $select_data = $this->load->model('air_zona_model')->get_select(); $options = array(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->zonanm; } } $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(); if ($select_data) { foreach ($select_data as $row) { $options[$row->id] = $row->manfaatnm; } } $js = 'id="air_manfaat_id" class="input-medium" required '; $data['select_manfaat'] = form_dropdown('air_manfaat_id', $options, $get->air_manfaat_id, $js); if (!wp_login()) { $this->load->view('vsptpd_form_at', $data); } else { $data['dt']['customer_id'] = wp_id(); $this->load->view('wp/vsptpd_form_at', $data); } } else { if (!wp_login()) { $this->load->view('vsptpd_form', $data); } else { $data['dt']['customer_id'] = wp_id(); $this->load->view('wp/vsptpd_form', $data); } } } } else { show_404(); } }
public function get_validasi() { $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)); } $this->session->set_userdata('mode', 'edit'); $p_usaha_id = $this->uri->segment(4); $p_type_id = $this->uri->segment(5); $p_id = $this->uri->segment(6); $this->session->set_userdata('usaha_id', $p_usaha_id); $sptpd = $this->sptpd_model->get($p_id); $tglinput = date('Y-m-d', strtotime($sptpd->created)); /* if ($tglinput < date('Y-m-d')) { $this->session->set_flashdata('msg_warning', 'Aktivitas Edit diperbolehkan hanya dalam waktu 1 hari'); 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}"); if ($p_id && ($get = $this->sptpd_model->get($p_id))) { $data['dt']['id'] = $get->id; $data['dt']['customer_usaha_id'] = $get->customer_usaha_id; $data['dt']['pajak_id'] = $get->pajak_id; $data['dt']['tahun'] = $get->tahun; $data['dt']['sptno'] = $get->sptno; $data['dt']['terimanip'] = $get->terimanip; $data['dt']['terimatgl'] = date('d-m-Y', strtotime($get->terimatgl)); $data['dt']['kirimtgl'] = date('d-m-Y', strtotime($get->kirimtgl)); $data['dt']['type_id'] = $get->type_id; $data['dt']['so'] = $get->so; $data['dt']['masadari'] = date('d-m-Y', strtotime($get->masadari)); $data['dt']['masapajak_bulan'] = date('M-Y', strtotime($get->masadari)); $masapajak_bulan = date('M-Y', strtotime($get->masadari)); $data['dt']['jatuhtempotgl'] = date('d-m-Y', strtotime('-1 day', strtotime($data['dt']['masadari']))); $data['dt']['masasd'] = date('d-m-Y', strtotime($get->masasd)); $data['dt']['minimal_omset'] = $get->minimal_omset; $data['dt']['dasar'] = $get->dasar; $data['dt']['pajak'] = $get->pajak_terhutang; $data['dt']['tarif'] = $get->tarif; if ($p_usaha_id == pad_air_tanah_id() || $p_usaha_id == pad_reklame_id()) { $data['dt']['denda'] = $get->denda; $data['dt']['bunga'] = $get->bunga; } else { $data['dt']['denda'] = 0; $data['dt']['bunga'] = 0; } $data['dt']['setoran'] = $get->setoran; $data['dt']['kenaikan'] = $get->kenaikan; $data['dt']['kompensasi'] = $get->kompensasi; $data['dt']['lain2'] = $get->lain2; $data['dt']['air_manfaat_id'] = $get->air_manfaat_id; $data['dt']['air_zona_id'] = $get->air_zona_id; $data['dt']['meteran_awal'] = $get->meteran_awal; $data['dt']['meteran_akhir'] = $get->meteran_akhir; $data['dt']['r_bayarid'] = $get->r_bayarid; $data['dt']['r_tarifid'] = $get->r_tarifid; $data['dt']['enabled'] = $get->enabled; $data['dt']['unit_id'] = $get->unit_id; $data['dt']['customer_id'] = $get->customer_id; $data['dt']['isprint_dc'] = $get->isprint_dc; $data['dt']['notes'] = $get->notes; $data['dt']['rekening_id'] = $get->rekening_id; $data['dt']['cara_bayar'] = $get->cara_bayar; $bulan_telat = $get->bulan_telat; if (wp_login()) { // data tambahan // } $data['dt']['nopd'] = $this->load->model('objek_pajak_model')->get_nopd($get->customer_usaha_id); $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; if ($rows->id == $get->pajak_id) { $nama_pajak = $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); $select_data = array((object) array('id' => 2, 'cara_bayar' => 'ATM / TELLER'), (object) array('id' => 1, 'cara_bayar' => 'TRANSFER')); $cara_bayar = ''; if ($select_data) { foreach ($select_data as $row) { if ($row->id == $data['dt']['cara_bayar']) { $cara_bayar .= "<option value={$row->id} selected >{$row->cara_bayar}</option>"; } else { $cara_bayar .= "<option value={$row->id}>{$row->cara_bayar}</option>"; } } } $trmtgl = (new DateTime($data['dt']['terimatgl']))->format('Y-m-d'); $masadari = (new DateTime($data['dt']['masadari']))->format('Y-m-d'); $jtptgl = (new DateTime($data['dt']['jatuhtempotgl']))->format('Y-m-d'); $val_data = $this->sptpd_model->get($p_id); $val_data->id = $data['dt']['id']; $val_data->masapajak_bulan = $masapajak_bulan; $val_data->nama_pajak = $nama_pajak; $val_data->cara_bayar = $cara_bayar; $val_data->pajak = $data['dt']['pajak']; $val_data->ijintgl_view = $data['dt']['terimatgl']; $val_data->persen_bunga = pad_bunga(); $val_data->jatuhtempotgl_view = date('d-m-Y', strtotime($data['dt']['jatuhtempotgl'])); $val_data->terimatgl_view = date('d-m-Y', strtotime($data['dt']['terimatgl'])); $val_data->masadari_view = date('d-m-Y', strtotime($data['dt']['masadari'])); if ($p_usaha_id == pad_reklame_id()) { if (strtotime($trmtgl) > strtotime($jtptgl)) { $query = $this->db->query("select hit_jdendarek_real('{$val_data->jatuhtempotgl_view}','{$val_data->terimatgl_view}') as bulan_telat"); foreach ($query->result() as $row) { $val_data->bulan_telat = $row->bulan_telat; $bulan_telat_real = $row->bulan_telat; } //cari interval $query = $this->db->query("SELECT date '{$jtptgl}' + interval '{$bulan_telat_real} months' as jatuhtempo_rek_new"); foreach ($query->result() as $row) { $newjtp = $row->jatuhtempo_rek_new; } $val_data->jatuhtempotgl_rek = $newjtp; $val_data->jatuhtempotgl_rek_view = date('d-m-Y', strtotime($newjtp)); if ($bulan_telat_real > 24) { $val_data->bulan_telat = 24; } $val_data->new_denda = round($val_data->dasar * $val_data->tarif * (pad_bunga() / 100) * $val_data->bulan_telat); $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda); } else { $val_data->jatuhtempotgl_rek = $data['dt']['jatuhtempotgl']; $val_data->jatuhtempotgl_rek_view = date('d-m-Y', strtotime($data['dt']['jatuhtempotgl'])); $val_data->bulan_telat = 0; $val_data->new_denda = 0; $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda); } $this->session->set_userdata('masadari_temp', $masadari); } else { if ($p_usaha_id == pad_air_tanah_id()) { $query = $this->db->query("select hit_jdendaat('{$val_data->masadari_view}','{$val_data->terimatgl_view}') as bulan_telat"); foreach ($query->result() as $row) { $val_data->bulan_telat = $row->bulan_telat; } $val_data->new_denda = round($val_data->dasar * $val_data->tarif * (pad_bunga() / 100) * $val_data->bulan_telat); $val_data->pajak = round($val_data->dasar * $val_data->tarif + $val_data->new_denda); $this->session->set_userdata('masadari_temp', $masadari); } } echo json_encode($val_data); $pajak_detail = $this->load->model('pad_model'); if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl, 0)) { $data['dt']['rekening_id'] = $row->rekening_id; $data['dt']['kode'] = $row->kode; $data['dt']['jatuhtempo'] = $row->jatuhtempo; $data['dt']['multiple'] = $row->multiple; } if ($p_usaha_id == pad_reklame_id() && $p_type_id == pad_dok_office_id()) { // } else { if ($p_usaha_id == pad_air_tanah_id() && $p_type_id == pad_dok_office_id()) { // } else { } } } else { show_404(); } }