Пример #1
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'type_siup' => $this->input->post('type_siup'));
     $form_status = $this->input->post('form_status');
     $id_siup = $this->input->post('id_siup');
     if ($form_status == 'edit') {
         $this->db->where('id_siup', $id_siup);
         $this->db->update('ppu_siup', $data);
     } else {
         $this->db->insert('ppu_siup', $data);
     }
     return true;
 }
Пример #2
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'type_siup' => $this->input->post('type_siup'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'status_milik' => $this->input->post('status_milik'), 'rtrw' => $this->input->post('rtrw'), 'alamat' => $this->input->post('alamat'), 'provinsi' => $this->input->post('provinsi'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'kodepos' => $this->input->post('kodepos'), 'no_telp' => $this->input->post('no_telp'), 'fax' => $this->input->post('fax'), 'penanggung_jawab' => $this->input->post('penanggung_jawab'), 'modal' => $this->input->post('modal'), 'kbli' => $this->input->post('kbli'), 'keg_up' => $this->input->post('keg_up'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'tgl_berlaku' => convert_tgl($this->input->post('tgl_berlaku')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_siup = $this->input->post('id_siup');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_siup', $id_siup);
         $this->db->update('ppu_siup', $data);
     } else {
         $this->db->insert('ppu_siup', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
     } else {
         $this->db->trans_commit();
         return true;
     }
 }
Пример #3
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'nama_pemilik' => $this->input->post('nama_pemilik'), 'alamat_pemilik' => $this->input->post('alamat_pemilik'), 'npwp' => $this->input->post('npwp'), 'jenis_industri' => $this->input->post('jenis_industri'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_iuitpp = $this->input->post('id_iuitpp');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_iuitpp', $id_iuitpp);
         $this->db->update('ppu_iuitpp', $data);
     } else {
         $this->db->insert('ppu_iuitpp', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #4
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'bidang_usaha' => $this->input->post('bidang_usaha'), 'jenis_usaha' => $this->input->post('jenis_usaha'), 'jenis_barangjasa' => $this->input->post('jenis_barangjasa'), 'penanggung_jawab' => $this->input->post('penanggung_jawab'), 'alamat_pj' => $this->input->post('alamat_pj'), 'gol_pajak' => $this->input->post('gol_pajak'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'tgl_berlaku' => convert_tgl($this->input->post('tgl_berlaku')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_situ = $this->input->post('id_situ');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_situ', $id_situ);
         $this->db->update('ppu_situ', $data);
     } else {
         $this->db->insert('ppu_situ', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #5
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'nama' => $this->input->post('nama'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'fungsi_bangunan' => $this->input->post('fungsi_bangunan'), 'penanggung_jawab' => $this->input->post('penanggung_jawab'), 'alamat_bangunan' => $this->input->post('alamat_bangunan'), 'lokasi_kota' => convert_tgl($this->input->post('lokasi_kota')), 'lokasi_kec' => $this->input->post('lokasi_kec'), 'lokasi_kel' => $this->input->post('lokasi_kel'), 'sempadan' => $this->input->post('sempadan'), 'as_jalan' => $this->input->post('as_jalan'), 'sempadan_pagar' => $this->input->post('sempadan_pagar'), 'as_jalan_pagar' => $this->input->post('as_jalan_pagar'), 'luas_a' => $this->input->post('luas_a'), 'luas_b' => $this->input->post('luas_b'), 'luas_c' => $this->input->post('luas_c'), 'luas_d' => $this->input->post('luas_d'), 'sarana_a' => $this->input->post('sarana_a'), 'sarana_b' => $this->input->post('sarana_b'), 'sarana_c' => $this->input->post('sarana_c'), 'sarana_d' => $this->input->post('sarana_d'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_imb = $this->input->post('id_imb');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_imb', $id_imb);
         $this->db->update('ppu_imb', $data);
     } else {
         $this->db->insert('ppu_imb', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #6
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat_perusahaan' => $this->input->post('alamat_perusahaan'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'nama_pemilik' => $this->input->post('nama_pemilik'), 'alamat_pemilik' => $this->input->post('alamat_pemilik'), 'no_siup' => $this->input->post('no_siup'), 'tgl_siup' => convert_tgl($this->input->post('tgl_siup')), 'no_tdp' => $this->input->post('no_tdp'), 'tgl_tdp' => convert_tgl($this->input->post('tgl_tdp')), 'tmpt_keluar' => $this->input->post('tmpt_keluar'), 'siui' => $this->input->post('siui'), 'lokasi_prov' => $this->input->post('lokasi_prov'), 'lokasi_kota' => $this->input->post('lokasi_kota'), 'lokasi_kec' => $this->input->post('lokasi_kec'), 'lokasi_kel' => $this->input->post('lokasi_kel'), 'luas_gudang' => $this->input->post('luas_gudang'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'tgl_berlaku' => convert_tgl($this->input->post('tgl_berlaku')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_tdg = $this->input->post('id_tdg');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_tdg', $id_tdg);
         $this->db->update('ppu_tdg', $data);
     } else {
         $this->db->insert('ppu_tdg', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #7
0
 function saved()
 {
     $data = array('tgl_bap' => convert_tgl($this->input->post('tgl_bap')), 'jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'type_prinsip' => $this->input->post('type_prinsip'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'npwp' => $this->input->post('npwp'), 'jenis_industri' => $this->input->post('jenis_industri'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'alamat_usaha' => $this->input->post('alamat_usaha'), 'nama_pemohon' => $this->input->post('nama_pemohon'), 'jabatan_pemohon' => $this->input->post('jabatan_pemohon'), 'no_surat' => $this->input->post('no_surat'), 'tgl_permohonan' => convert_tgl($this->input->post('tgl_permohonan')), 'komoditi_industri' => $this->input->post('komoditi_industri'), 'kapasitas' => $this->input->post('kapasitas'), 'total_investasi' => $this->input->post('total_investasi'), 'modal_mesin' => $this->input->post('modal_mesin'), 'modal_kerja' => $this->input->post('modal_kerja'), 'tki' => $this->input->post('tki'), 'tka' => $this->input->post('tka'), 'type_merk' => $this->input->post('type_merk'), 'nama_merk' => $this->input->post('nama_merk'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_perluasan = $this->input->post('id_perluasan');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_perluasan', $id_perluasan);
         $this->db->update('ppu_perluasan', $data);
     } else {
         $this->db->insert('ppu_perluasan', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return true;
     }
 }
Пример #8
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat_notelp' => $this->input->post('alamat_notelp'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'kodepos' => $this->input->post('kodepos'), 'npwp' => $this->input->post('npwp'), 'nipik' => $this->input->post('nipik'), 'nama_pemilik' => $this->input->post('nama_pemilik'), 'alamat_pemilik' => $this->input->post('alamat_pemilik'), 'no_telp' => $this->input->post('no_telp'), 'jenis_industri' => $this->input->post('jenis_industri'), 'komoditi_industri' => $this->input->post('komoditi_industri'), 'modal' => $this->input->post('modal'), 'lokasi_prov' => $this->input->post('lokasi_prov'), 'lokasi_kota' => $this->input->post('lokasi_kota'), 'lokasi_kec' => $this->input->post('lokasi_kec'), 'lokasi_kel' => $this->input->post('lokasi_kel'), 'p_utama' => $this->input->post('p_utama'), 'p_pembantu' => $this->input->post('p_pembantu'), 'tenaga_penggerak' => $this->input->post('tenaga_penggerak'), 'kap_terpasang' => $this->input->post('kap_terpasang'), 'tkw' => $this->input->post('tkw'), 'tkp' => $this->input->post('tkp'), 'no_hilang' => $this->input->post('no_hilang'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')), 'status' => $this->input->post('status'));
     $form_status = $this->input->post('form_status');
     $id_tdi = $this->input->post('id_tdi');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_tdi', $id_tdi);
         $this->db->update('ppu_tdi', $data);
     } else {
         $this->db->insert('ppu_tdi', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #9
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'type_ho' => $this->input->post('type_ho'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'bidang_usaha' => $this->input->post('bidang_usaha'), 'nama_pemohon' => $this->input->post('nama_pemohon'), 'no_imb' => $this->input->post('no_imb'), 'tgl_imb' => convert_tgl($this->input->post('tgl_imb')), 'no_tdp' => $this->input->post('no_tdp'), 'tgl_tdp' => convert_tgl($this->input->post('tgl_tdp')), 'dba_malam' => $this->input->post('dba_malam'), 'dba_siang' => $this->input->post('dba_siang'), 'dba_pagisore' => $this->input->post('dba_pagisore'), 'dba_ruang' => $this->input->post('dba_ruang'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'tgl_berlaku' => convert_tgl($this->input->post('tgl_berlaku')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_ho = $this->input->post('id_ho');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_ho', $id_ho);
         $this->db->update('ppu_ho', $data);
     } else {
         $this->db->insert('ppu_ho', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return true;
     }
 }
Пример #10
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'kualifikasi' => $this->input->post('kualifikasi'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'penanggung_jawab' => $this->input->post('penanggung_jawab'), 'npwp' => $this->input->post('npwp'), 'tgl_tetap_pajak' => convert_tgl($this->input->post('tgl_tetap_pajak')), 'tgl_pajak_daerah' => convert_tgl($this->input->post('tgl_pajak_daerah')), 'jenis_reklame' => $this->input->post('jenis_reklame'), 'judul_reklame' => $this->input->post('judul_reklame'), 'ukuran' => $this->input->post('ukuran'), 'banyak' => $this->input->post('banyak'), 'lokasi' => $this->input->post('lokasi'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'tgl_berlaku' => convert_tgl($this->input->post('tgl_berlaku')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_ipr = $this->input->post('id_ipr');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_ipr', $id_ipr);
         $this->db->update('ppu_ipr', $data);
     } else {
         $this->db->insert('ppu_ipr', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return $data['no_pelayanan'];
     }
 }
Пример #11
0
 function saved()
 {
     $data = array('jenis_perizinan' => $this->input->post('jenis_perizinan'), 'tgl_pembuatan' => convert_tgl($this->input->post('tgl_pembuatan')), 'no_pelayanan' => $this->input->post('no_pelayanan'), 'keterangan' => $this->input->post('keterangan'), 'berlaku_awal' => convert_tgl($this->input->post('berlaku_awal')), 'berlaku_akhir' => convert_tgl($this->input->post('berlaku_akhir')), 'type_waralaba' => $this->input->post('type_waralaba'), 'nama_perusahaan' => $this->input->post('nama_perusahaan'), 'alamat' => $this->input->post('alamat'), 'kota' => $this->input->post('kota'), 'kecamatan' => $this->input->post('kecamatan'), 'kelurahan' => $this->input->post('kelurahan'), 'no_telp' => $this->input->post('no_telp'), 'email' => $this->input->post('email'), 'penanggung_jawab' => $this->input->post('penanggung_jawab'), 'jabatan_pj' => $this->input->post('jabatan_pj'), 'objek_waralaba' => $this->input->post('objek_waralaba'), 'merk' => $this->input->post('merk'), 'negara_asal' => $this->input->post('negara_asal'), 'pemberi_waralaba' => $this->input->post('pemberi_waralaba'), 'alamat_pw' => $this->input->post('alamat_pw'), 'no_telp_pw' => $this->input->post('no_telp_pw'), 'fax' => $this->input->post('fax'), 'email_pw' => $this->input->post('email_pw'), 'penanggung_jawab_pw' => $this->input->post('penanggung_jawab_pw'), 'no_perjanjian' => $this->input->post('no_perjanjian'), 'tgl_perjanjian' => convert_tgl($this->input->post('tgl_perjanjian')), 'pemasaran' => $this->input->post('pemasaran'), 'tgl_penetapan' => convert_tgl($this->input->post('tgl_penetapan')), 'no_registrasi' => $this->input->post('no_registrasi'), 'nama_pejabat' => $this->input->post('nama_pejabat'), 'jabatan' => $this->input->post('jabatan'), 'nip' => $this->input->post('nip'), 'jumlah_retribusi' => str_replace(",", "", $this->input->post('jumlah_retribusi')));
     $form_status = $this->input->post('form_status');
     $id_stpw = $this->input->post('id_stpw');
     $this->db->trans_begin();
     if ($form_status == 'edit') {
         $this->db->where('id_stpw', $id_stpw);
         $this->db->update('ppu_stpw', $data);
     } else {
         $this->db->insert('ppu_stpw', $data);
     }
     if ($this->db->trans_status() === FALSE) {
         $this->db->trans_rollback();
         return false;
     } else {
         $this->db->trans_commit();
         return true;
     }
 }
Пример #12
0
 function downloadWord($jp)
 {
     $data['jenis_perizinan'] = $jp;
     $data['tgl_awal'] = convert_tgl($this->input->get('tgl_awal'));
     $data['tgl_akhir'] = convert_tgl($this->input->get('tgl_akhir'));
     $data['tgl_bulan'] = $this->input->get('tgl_bulan');
     $data['per_type'] = $this->input->get('per_type');
     $data['per_kec'] = $this->input->get('per_kecamatan');
     $data['filter_type'] = $this->input->get('filter_type');
     //$data['results'] = $this->m_jenisizin->getData($data['jenis_perizinan'], $data['tgl_awal'], $data['tgl_akhir'], $data['tgl_bulan'],$data['filter_type']);
     $data['typeIzin'] = getTypeIzin($data['jenis_perizinan']);
     $data['nameIzin'] = getTabelJenisPerizinan()[$data['jenis_perizinan']];
     $data['listKecamatan'] = $this->m_global->getKecamatan();
     //debugy($data);
     $columns = array();
     $columns[KEY_COLUMN_ID] = getColumnNameID($data['jenis_perizinan']);
     $columns[KEY_COLUMN_TYPE] = getColumnNameType($data['jenis_perizinan']);
     $data['type'] = '';
     $data['results'] = $this->m_jenisizin->getAllData($data['jenis_perizinan'], $columns, $data['tgl_awal'], $data['tgl_akhir'], $data['tgl_bulan'], $data['filter_type'], $data['per_type'], $data['per_kec']);
     $data['row_total'] = count($data['results']);
     $data['row_start'] = 1;
     $data = mergeReportData($data, $columns);
     $this->load->library('word');
     // prepare template
     if ($data['per_type'] == 'yes' && $data['per_kec'] == 'yes') {
         $templateProcessor = new \PhpOffice\PhpWord\Template('./templates/Report_Per_Type_Template.docx');
     } else {
         if ($data['per_type'] == 'yes' || $data['per_kec'] == 'yes') {
             $templateProcessor = new \PhpOffice\PhpWord\Template('./templates/Report_Per_Type_Template.docx');
         } else {
             $templateProcessor = new \PhpOffice\PhpWord\Template('./templates/Report_Template.docx');
         }
     }
     // fill header
     $templateProcessor->setValue('bidang', 'PERIZINAN USAHA');
     $templateProcessor->setValue('periode_title', strtoupper($data['filter_type']));
     if ($data['filter_type'] == 'bulan') {
         $templateProcessor->setValue('periode', convert_to_id_month($data['tgl_bulan']));
     } else {
         $templateProcessor->setValue('periode', convert_to_id($data['tgl_awal']) . ' s/d ' . convert_to_id($data['tgl_akhir']));
     }
     $templateProcessor->setValue('jenis_izin', $data['nameIzin']);
     $templateProcessor->setValue('jumlah_pelayanan_all', $data['row_total']);
     //write report
     if ($data['per_type'] == 'yes' && $data['per_kec'] == 'yes') {
         $templateProcessor->cloneBlock('CLONEME', count($data['results']));
         $parent_index = 1;
         foreach ($data['results'] as $result) {
             //add index on cloned var
             $templateProcessor->setValue('block_name', '${block_name#' . $parent_index . '}', 1);
             $templateProcessor->setValue('block_title', '${block_title#' . $parent_index . '}', 1);
             $templateProcessor->setValue('jumlah_pelayanan', '${jumlah_pelayanan#' . $parent_index . '}', 1);
             $templateProcessor->setValue('kecamatan_title', '${kecamatan_title#' . $parent_index . '}', 1);
             $templateProcessor->setValue('no', '${no#' . $parent_index . '}', 1);
             $templateProcessor->setValue('tanggal', '${tanggal#' . $parent_index . '}', 1);
             $templateProcessor->setValue('nomor', '${nomor#' . $parent_index . '}', 1);
             $templateProcessor->setValue('perusahaan', '${perusahaan#' . $parent_index . '}', 1);
             $templateProcessor->setValue('pemohon', '${pemohon#' . $parent_index . '}', 1);
             $templateProcessor->setValue('alamat', '${alamat#' . $parent_index . '}', 1);
             $templateProcessor->setValue('kota', '${kota#' . $parent_index . '}', 1);
             $templateProcessor->setValue('kecamatan', '${kecamatan#' . $parent_index . '}', 1);
             $templateProcessor->setValue('keterangan', '${keterangan#' . $parent_index . '}', 1);
             //fill data on cloned var
             $templateProcessor->setValue('block_title#' . $parent_index, $data['title']);
             $templateProcessor->setValue('block_name#' . $parent_index, $result['name']);
             $templateProcessor->setValue('jumlah_pelayanan#' . $parent_index, $result['count']);
             //         		$templateProcessor->cloneRow('kecamatan_title#'.$parent_index, $result['count']);
             $templateProcessor->cloneRow('no#' . $parent_index, $result['count'] + count($result['data']));
             $parent_kec_index = 1;
             $index_row = 1;
             foreach ($result['data'] as $child) {
                 $templateProcessor->setValue('no#' . $parent_index . '#' . $index_row, $child['name']);
                 $templateProcessor->setValue('tanggal#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('nomor#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('perusahaan#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('pemohon#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('alamat#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('kota#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('kecamatan#' . $parent_index . '#' . $index_row, '');
                 $templateProcessor->setValue('keterangan#' . $parent_index . '#' . $index_row, '');
                 $index = 1;
                 $index_row++;
                 foreach ($child['data'] as $row) {
                     $templateProcessor->setValue('no#' . $parent_index . '#' . $index_row, $index);
                     $templateProcessor->setValue('tanggal#' . $parent_index . '#' . $index_row, convert_to_id($row['tgl_pembuatan'], FALSE));
                     $templateProcessor->setValue('nomor#' . $parent_index . '#' . $index_row, $row['no_pelayanan']);
                     $templateProcessor->setValue('perusahaan#' . $parent_index . '#' . $index_row, $row['nama_perusahaan']);
                     $templateProcessor->setValue('pemohon#' . $parent_index . '#' . $index_row, $row['penanggung_jawab']);
                     $templateProcessor->setValue('alamat#' . $parent_index . '#' . $index_row, $row['alamat']);
                     $templateProcessor->setValue('kota#' . $parent_index . '#' . $index_row, $row['kota']);
                     $templateProcessor->setValue('kecamatan#' . $parent_index . '#' . $index_row, $row['nama_kecamatan']);
                     $templateProcessor->setValue('keterangan#' . $parent_index . '#' . $index_row, 'Non Retribusi');
                     $index++;
                     $index_row++;
                 }
                 $parent_kec_index++;
             }
             $parent_index++;
         }
         //         	break;
     } else {
         if ($data['per_type'] == 'yes' || $data['per_kec'] == 'yes') {
             $templateProcessor->cloneBlock('CLONEME', count($data['results']));
             $parent_index = 1;
             foreach ($data['results'] as $result) {
                 //add index on cloned var
                 $templateProcessor->setValue('block_name', '${block_name#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('block_title', '${block_title#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('jumlah_pelayanan', '${jumlah_pelayanan#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('no', '${no#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('tanggal', '${tanggal#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('nomor', '${nomor#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('perusahaan', '${perusahaan#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('pemohon', '${pemohon#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('alamat', '${alamat#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('kota', '${kota#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('kecamatan', '${kecamatan#' . $parent_index . '}', 1);
                 $templateProcessor->setValue('keterangan', '${keterangan#' . $parent_index . '}', 1);
                 //fill data on cloned var
                 $templateProcessor->setValue('block_title#' . $parent_index, $data['title']);
                 $templateProcessor->setValue('block_name#' . $parent_index, $result['name']);
                 $templateProcessor->setValue('jumlah_pelayanan#' . $parent_index, $result['count']);
                 $templateProcessor->cloneRow('no#' . $parent_index, $result['count']);
                 $index = 1;
                 foreach ($result['data'] as $row) {
                     $templateProcessor->setValue('no#' . $parent_index . '#' . $index, $index);
                     $templateProcessor->setValue('tanggal#' . $parent_index . '#' . $index, convert_to_id($row['tgl_pembuatan'], FALSE));
                     $templateProcessor->setValue('nomor#' . $parent_index . '#' . $index, $row['no_pelayanan']);
                     $templateProcessor->setValue('perusahaan#' . $parent_index . '#' . $index, $row['nama_perusahaan']);
                     $templateProcessor->setValue('pemohon#' . $parent_index . '#' . $index, $row['penanggung_jawab']);
                     $templateProcessor->setValue('alamat#' . $parent_index . '#' . $index, $row['alamat']);
                     $templateProcessor->setValue('kota#' . $parent_index . '#' . $index, $row['kota']);
                     $templateProcessor->setValue('kecamatan#' . $parent_index . '#' . $index, $row['nama_kecamatan']);
                     $templateProcessor->setValue('keterangan#' . $parent_index . '#' . $index, 'Non Retribusi');
                     $index++;
                 }
                 $parent_index++;
             }
         } else {
             $templateProcessor->cloneRow('no', $data['row_total']);
             $index = 1;
             foreach ($data['results'] as $row) {
                 $templateProcessor->setValue('no#' . $index, $index);
                 $templateProcessor->setValue('tanggal#' . $index, convert_to_id($row['tgl_pembuatan'], FALSE));
                 $templateProcessor->setValue('nomor#' . $index, $row['no_pelayanan']);
                 $templateProcessor->setValue('perusahaan#' . $index, $row['nama_perusahaan']);
                 $templateProcessor->setValue('pemohon#' . $index, $row['penanggung_jawab']);
                 $templateProcessor->setValue('alamat#' . $index, $row['alamat']);
                 $templateProcessor->setValue('kota#' . $index, $row['kota']);
                 $templateProcessor->setValue('kecamatan#' . $index, $row['nama_kecamatan']);
                 $templateProcessor->setValue('keterangan#' . $index, 'Non Retribusi');
                 $index++;
             }
         }
     }
     $file_temp = './templates/Report_Temp_' . round(microtime(true) * 1000) . '.docx';
     $templateProcessor->saveAs($file_temp);
     // Saving the document as OOXML file...
     //$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($templateProcessor, 'Word2007');
     header('Pragma: public');
     // required
     header('Expires: 0');
     // no cache
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s', now()) . ' GMT');
     header('Cache-Control: private', false);
     header("Content-Type: application/vnd.ms-word");
     header("Content-disposition: attachment; filename=" . strtoupper($data['jenis_perizinan']) . '_' . date('Y-m-d') . ".docx");
     header('Content-Transfer-Encoding: binary');
     header('Connection: close');
     //$objWriter->save('php://output');
     readfile($file_temp);
     unlink($file_temp);
 }