function daftar() { /*SELECT a.PENDATAAN_ID, a.JENIS_PUNGUTAN, a.PENDATAAN_NO, a.TGL_PROSES, b.TGL_KIRIM, vp.PEMOHON, vp.NPWP, pp.NO_PENETAPAN, pp.TGL_PENETAPAN from PENDATAAN_SPT a left join spt b on b.PENDAFTARAN_ID=a.PENDAFTARAN_ID left join v_pendaftaran vp on vp.PENDAFTARAN_ID=a.PENDAFTARAN_ID left join penetapan_pr_content ppc on ppc.pendataan_id=a.pendataan_id left join penetapan_pr pp on pp.penetapan_pr_id=ppc.penetapan_pr_id where a.JENIS_PENDATAAN='RETRIBUSI'*/ if (!isset($_POST['oper'])) { $id = $this->uri->segment(3); $owhere['where'] = "a.jenis_pendataan='HOTEL' "; $limit = jqgrid_set_limit('pendataan_spt a', $owhere); $limit['where'] = $owhere['where']; $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $result = $this->data_model->get_data($limit)->result_array(); for ($i = 0; $i < count($result); $i++) { $response->rows[$i]['id'] = $result[$i]['PENDATAAN_ID']; $sistem_pungutan = $result[$i]['JENIS_PUNGUTAN'] == 'OFFICE' ? 'Office Assestment' : 'Selft Assestment'; if (isset($result[$i]['TGL_KIRIM'])) { $periode = date('Y', strtotime($result[$i]['TGL_KIRIM'])); } else { $periode = date('Y', strtotime($result[$i]['TGL_PROSES'])); } $response->rows[$i]['cell'] = array($result[$i]['PENDATAAN_ID'], $sistem_pungutan, $result[$i]['JENIS_PUNGUTAN'], sprintf('%05d', $result[$i]['PENDATAAN_NO']), format_date($result[$i]['PERIODE_AWAL']) . ' - ' . format_date($result[$i]['PERIODE_AKHIR']), $result[$i]['NPWP'], $result[$i]['PEMOHON'], format_date($result[$i]['TGL_PENETAPAN']), $result[$i]['NO_PENETAPAN'], format_date($result[$i]['TGL_PENERIMAAN']), format_date($result[$i]['TGL_PROSES']), format_date($result[$i]['TGL_ENTRY']), substr($result[$i]['NPWP'], 1, strlen($result[$i]['NPWP'])), $result[$i]['MEMO'], date('Y', strtotime($result[$i]['TGL_KIRIM'])), format_date($result[$i]['TGL_KIRIM']), sprintf('%05d', $result[$i]['SPT_NO']), $result[$i]['SPT_ID'], $result[$i]['PENDAFTARAN_ID'], $result[$i]['ALAMAT'], $result[$i]['NAMA_KECAMATAN'], $result[$i]['NAMA_DESA'], format_date($result[$i]['PERIODE_AWAL']), format_date($result[$i]['PERIODE_AKHIR']), $result[$i]['KODE_REKENING'], $result[$i]['NAMA_REKENING'], $result[$i]['ID_REKENING'], $result[$i]['PERSEN_TARIF'], $result[$i]['DASAR_PENGENAAN'], $result[$i]['NOMINAL'], $result[$i]['RESTORAN_NAMA'], $result[$i]['RESTORAN_ALAMAT']); } echo json_encode($response); } else { $id = $this->input->post('id'); if ($_POST['oper'] === 'add') { $this->insert(); } else { if ($_POST['oper'] === 'edit') { $this->update($id); } else { if ($_POST['oper'] === 'del') { if (!$this->data_model->isAbleDelete()) { $this->db->trans_start(); if ($this->data_model->delete_rincian_data($id)) { if ($this->data_model->delete_data($id)) { $this->db->trans_complete(); } } } } } } } }
function seeknpw() { $type = $this->uri->segment('3'); $kode = $this->uri->segment('4'); if ($kode != '') { $id_usaha = $this->db->query('select id from kode_usaha where kode=' . $this->db->escape($kode))->row()->ID; $owhere['where'] = " a.jenis_pendaftaran='" . $type . "' and a.id_usaha='" . $id_usaha . "'"; } else { $owhere['where'] = " a.jenis_pendaftaran='" . $type . "'"; } //$this->db->join('kode_usaha'); $limit = jqgrid_set_limit('v_pendaftaran a', $owhere); $limit['where'] = $owhere['where']; $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $result = $this->data_model->seeknpw($limit)->result_array(); for ($i = 0; $i < count($result); $i++) { $response->rows[$i]['id'] = $result[$i]['PENDAFTARAN_ID']; // data berikut harus sesuai dengan kolom-kolom yang ingin ditampilkan di view (js) $periode_spt = isset($result[$i]['TGL_KIRIM']) ? date('Y', strtotime($result[$i]['TGL_KIRIM'])) : ''; $tgl_spt = isset($result[$i]['TGL_KIRIM']) ? format_date($result[$i]['TGL_KIRIM']) : ''; $no_spt = isset($result[$i]['SPT_NO']) ? sprintf('%05d', $result[$i]['SPT_NO']) : ''; $response->rows[$i]['cell'] = array($result[$i]['PENDAFTARAN_ID'], $result[$i]['PEMOHON'], substr($result[$i]['NPWP'], 1, strlen($result[$i]['NPWP'])), $result[$i]['JENIS_USAHA'], $result[$i]['ALAMAT'], $result[$i]['NAMA_DESA'], $result[$i]['NAMA_KECAMATAN'], $periode_spt, $tgl_spt, $no_spt, $result[$i]['SPT_ID']); } echo json_encode($response); }
function sptprd() { $owhere['where'] = "b.pendataan_id is null and a.JENIS_PUNGUTAN='OFFICE' "; $this->db->join('penetapan_pr_content b', 'b.pendataan_id=a.pendataan_id', 'left'); $limit = jqgrid_set_limit('v_pendataan_spt a', $owhere); $limit['where'] = $owhere['where']; $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $result = $this->data_model->get_sptprd($limit)->result_array(); for ($i = 0; $i < count($result); $i++) { $sistem_pungutan = $result[$i]['JENIS_PUNGUTAN'] == 'OFFICE' ? 'Office Assesment' : 'Selft Assesment'; $response->rows[$i]['id'] = $result[$i]['ID']; // data berikut harus sesuai dengan kolom-kolom yang ingin ditampilkan di view (js) $response->rows[$i]['cell'] = array($result[$i]['ID'], $result[$i]['PENDATAAN_NO'], $result[$i]['TGL_ENTRY'], $result[$i]['NPWP'], $result[$i]['PEMOHON'], $result[$i]['JENIS_PENDATAAN'], $sistem_pungutan, $result[$i]['JENIS_PENDAFTARAN'], $result[$i]['SPT_NO'], $result[$i]['TGL_SPT'], $result[$i]['NOMINAL']); } echo json_encode($response); }
function grid_form() { $id = $this->uri->segment(3); if (isset($id) && $id != '') { $id = $this->uri->segment(3); $owhere['where'] = " a.pendataan_id=" . $this->db->escape($id); $limit = jqgrid_set_limit('pendataan_air a', $owhere); $limit['where'] = $owhere['where']; $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $query = 'select a.*, b.kode_rekening,b.nama_rekening from pendataan_air a left join rekening_kode b on b.id=a.id_rekening where a.pendataan_id=' . $this->db->escape($id); $result = $this->db->query($query); if ($result->num_rows() > 0) { $i = 0; foreach ($result->result() as $row) { $response->rows[$i]['id'] = $row->AIR_ID; $response->rows[$i]['cell'] = array($row->AIR_ID, $row->KODE_REKENING . ' - ' . $row->NAMA_REKENING, $row->JUMLAH, $row->DASAR_TARIF, $row->DASAR_PENGENAAN, $row->PERSEN_TARIF, $row->NOMINAL); $i++; } } echo json_encode($response); } else { echo '{"page":"1","total":0,"records":null}'; } }
function daftar() { $ids = $this->uri->segment(3); $this->db->join('penerimaan_pr_content aa', 'a.PENERIMAAN_PR_ID=aa.PENERIMAAN_PR_ID', 'left'); $this->db->join('satker sk', 'sk.ID_SATKER=a.SKPD_ID', 'left'); $this->db->join('v_pendaftaran vd', 'vd.PENDAFTARAN_ID=a.PENDAFTARAN_ID', 'left'); //$owhere['where'] = "d.STS_CONTENT_ID is null and a.id_ref_pembayaran='BD' "; //$owhere['group'] = array('b.id_rekening','a.thn_penerimaan','c.kode_rekening','c.nama_rekening'); //$owhere['group'] = 'b.ID_REKENING, a.THN_PENERIMAAN, c.ID, c.KODE_REKENING, c.NAMA_REKENING'; $limit = jqgrid_set_limit('PENERIMAAN_PR a'); //$limit['where'] = $owhere['where']; //$limit['group'] = $owhere['group']; $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $result = $this->data_model->get_data($limit)->result_array(); for ($i = 0; $i < count($result); $i++) { $response->rows[$i]['id'] = $result[$i]['PENERIMAAN_PR_ID']; $jenis_pungutan = $result[$i]['JENIS_PUNGUTAN'] == 'SELF' ? 'Self Assesment' : 'Office Assesment'; $response->rows[$i]['cell'] = array($result[$i]['PENERIMAAN_PR_ID'], $result[$i]['PENERIMAAN_PR_NO'], format_date($result[$i]['TGL_PENERIMAAN']), $jenis_pungutan, $result[$i]['NOMINAL_PAJAK'], $result[$i]['NAMA_SATKER'], $result[$i]['NPWP'], $result[$i]['PEMOHON']); } echo json_encode($response); }
function daftar() { if (!isset($_POST['oper'])) { $id = $this->uri->segment(3); $limit = jqgrid_set_limit('spt'); $response->page = $limit['page']; $response->total = $limit['total_pages']; $response->records = $limit['records']; $result = $this->data_model->get_data($limit)->result_array(); for ($i = 0; $i < count($result); $i++) { $response->rows[$i]['id'] = $result[$i]['SPT_ID']; // data berikut harus sesuai dengan kolom-kolom yang ingin ditampilkan di view (js) $sistem_pungutan = $result[$i]['JENIS_PUNGUTAN'] == 'OFFICE' ? 'Office Assesment' : 'Selft Assesment'; $response->rows[$i]['cell'] = array($result[$i]['SPT_ID'], sprintf('%05d', $result[$i]['SPT_NO']), format_date($result[$i]['TGL_KIRIM']), $sistem_pungutan, substr($result[$i]['NPWP'], 1, strlen($result[$i]['NPWP'])), $result[$i]['PEMOHON'], $result[$i]['JENIS_PUNGUTAN'], $result[$i]['ALAMAT'], $result[$i]['NAMA_KECAMATAN'], $result[$i]['NAMA_DESA'], $result[$i]['TGL_KEMBALI'], $result[$i]['KODE_REKENING'], $result[$i]['NAMA_REKENING'], $result[$i]['PENERIMA_NAMA'], $result[$i]['PENERIMA_ALAMAT'], $result[$i]['MEMO'], $result[$i]['PENDAFTARAN_ID']); } echo json_encode($response); } else { $id = $this->input->post('id'); if ($_POST['oper'] === 'add') { $this->insert(); } else { if ($_POST['oper'] === 'edit') { $this->update($id); } else { if ($_POST['oper'] === 'del') { $this->delete($id); } } } } }