public function ins_import()
 {
     global $basedomain;
     if ($_FILES['total']['error'] == 0) {
         //delete then replace as year
         $this->m_pelaporankeuangan->del_peryear('m_spmind', $_POST['thang']);
         $i = 0;
         $Test = new Prodigy_DBF($_FILES['total']['tmp_name']);
         // db($Test);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             // echo $Record;
             $data[$i]['THANG'] = $Record['thang'];
             $data[$i]['KDSATKER'] = $Record['kdsatker'];
             $data[$i]['KDDEPT'] = $Record['kddept'];
             $data[$i]['KDUNIT'] = $Record['kdunit'];
             $data[$i]['KDPROGRAM'] = $Record['kdprogram'];
             $data[$i]['KDGIAT'] = $Record['kdgiat'];
             $data[$i]['KDOUTPUT'] = $Record['kdoutput'];
             $data[$i]['TOTNILMAK'] = $Record['totnilmak'];
             $data[$i]['TOTNILMAP'] = $Record['totnilmap'];
             $data[$i]['NOSPM'] = $Record['nospm'];
             $data[$i]['TGSPM'] = $Record['tgspm'];
             $data[$i]['NOSP2D'] = $Record['nosp2d'];
             $data[$i]['TGSP2D'] = $Record['tgsp2d'];
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->m_pelaporankeuangan->insert_data($data[$i], 'm_spmind');
             }
             $i++;
         }
         //insert riwayat
         $riwayat['kdfile'] = 'M_SPMIND';
         $riwayat['nama_file'] = $_FILES['total']['name'];
         $riwayat['user_upload'] = $this->admin['id'];
         $riwayat['type'] = 'sakpa';
         $riwayat['keterangan'] = 'File Realisasi Total';
         $riwayat['KDSATKER'] = $_POST['kdsatker'];
         $this->m_pelaporankeuangan->insert_data($riwayat, 'dt_fileupload_keu');
     }
     if ($_FILES['akun']['error'] == 0) {
         //delete then replace as year
         $this->m_pelaporankeuangan->del_peryear('m_spmmak', $_POST['thang']);
         unset($data);
         $i = 0;
         $Test = new Prodigy_DBF($_FILES['akun']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = $Record['thang'];
             $data[$i]['KDSATKER'] = $Record['kdsatker'];
             $data[$i]['NOSPM'] = $Record['nospm'];
             $data[$i]['TGSPM'] = $Record['tgspm'];
             $data[$i]['NOSP2D'] = $Record['nosp2d'];
             $data[$i]['TGSP2D'] = $Record['tgsp2d'];
             $data[$i]['KDAKUN'] = $Record['kdakun'];
             $data[$i]['NILMAK'] = intval($Record['nilmak']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->m_pelaporankeuangan->insert_data($data[$i], 'm_spmmak');
             }
             $i++;
         }
         //insert riwayat
         $riwayat['kdfile'] = 'M_SPMMAK';
         $riwayat['nama_file'] = $_FILES['akun']['name'];
         $riwayat['user_upload'] = $this->admin['id'];
         $riwayat['type'] = 'sakpa';
         $riwayat['keterangan'] = 'File Realisasi Akun';
         $riwayat['KDSATKER'] = $_POST['kdsatker'];
         $this->m_pelaporankeuangan->insert_data($riwayat, 'dt_fileupload_keu');
     }
     echo "<script>alert('Data Berhasil Masuk');window.location.href='" . $basedomain . "pelaporanKeuangan/import'</script>";
     exit;
 }
 public function ins_import()
 {
     global $basedomain;
     if ($_FILES['output']['error'] == 0) {
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_output', $_POST['tahunAktif']);
         $i = 0;
         $Test = new Prodigy_DBF($_FILES['output']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['VOL'] = addslashes($Record['vol']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_output');
             }
             $i++;
         }
     }
     if ($_FILES['suboutput']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_soutput', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['suboutput']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['KDSOUTPUT'] = addslashes($Record['kdsoutput']);
             $data[$i]['URSOUTPUT'] = addslashes($Record['ursoutput']);
             $data[$i]['VOLSOUT'] = addslashes($Record['volsout']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_soutput');
             }
             $i++;
         }
     }
     if ($_FILES['komponen']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_kmpnen', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['komponen']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['KDSOUTPUT'] = addslashes($Record['kdsoutput']);
             $data[$i]['KDKMPNEN'] = addslashes($Record['kdkmpnen']);
             $data[$i]['URKMPNEN'] = addslashes($Record['urkmpnen']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_kmpnen');
             }
             $i++;
         }
     }
     if ($_FILES['subkomponen']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_skmpnen', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['subkomponen']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['KDSOUTPUT'] = addslashes($Record['kdsoutput']);
             $data[$i]['KDKMPNEN'] = addslashes($Record['kdkmpnen']);
             $data[$i]['KDSKMPNEN'] = addslashes($Record['kdskmpnen']);
             $data[$i]['URSKMPNEN'] = addslashes($Record['urskmpnen']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_skmpnen');
             }
             $i++;
         }
     }
     if ($_FILES['akun']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_akun', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['akun']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['KDSOUTPUT'] = addslashes($Record['kdsoutput']);
             $data[$i]['KDKMPNEN'] = addslashes($Record['kdkmpnen']);
             $data[$i]['KDSKMPNEN'] = addslashes($Record['kdskmpnen']);
             $data[$i]['KDAKUN'] = addslashes($Record['kdakun']);
             if ($Record['jumlah'] != '') {
                 $data[$i]['JUMLAH'] = addslashes($Record['jumlah']);
             } else {
                 $data[$i]['JUMLAH'] = 0;
             }
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_akun');
             }
             $i++;
         }
     }
     if ($_FILES['pok']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_item', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['pok']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['KDOUTPUT'] = addslashes($Record['kdoutput']);
             $data[$i]['KDSOUTPUT'] = addslashes($Record['kdsoutput']);
             $data[$i]['KDKMPNEN'] = addslashes($Record['kdkmpnen']);
             $data[$i]['KDSKMPNEN'] = addslashes($Record['kdskmpnen']);
             $data[$i]['KDAKUN'] = addslashes($Record['kdakun']);
             $data[$i]['HEADER1'] = addslashes($Record['header1']);
             $data[$i]['HEADER2'] = addslashes($Record['header2']);
             $data[$i]['KDHEADER'] = addslashes($Record['kdheader']);
             $data[$i]['NOITEM'] = addslashes($Record['noitem']);
             $data[$i]['NMITEM'] = addslashes($Record['nmitem']);
             $data[$i]['VOL1'] = addslashes($Record['vol1']);
             $data[$i]['SAT1'] = addslashes($Record['sat1']);
             $data[$i]['VOL2'] = addslashes($Record['vol2']);
             $data[$i]['SAT2'] = addslashes($Record['sat2']);
             $data[$i]['VOL3'] = addslashes($Record['vol3']);
             $data[$i]['SAT3'] = addslashes($Record['sat3']);
             $data[$i]['VOL4'] = addslashes($Record['vol4']);
             $data[$i]['SAT4'] = addslashes($Record['sat4']);
             $data[$i]['VOLKEG'] = addslashes($Record['volkeg']);
             $data[$i]['SATKEG'] = addslashes($Record['satkeg']);
             $data[$i]['HARGASAT'] = addslashes($Record['hargasat']);
             $data[$i]['JUMLAH'] = addslashes($Record['jumlah']);
             $data[$i]['JANUARI'] = addslashes($Record['januari']);
             $data[$i]['PEBRUARI'] = addslashes($Record['pebruari']);
             $data[$i]['MARET'] = addslashes($Record['maret']);
             $data[$i]['APRIL'] = addslashes($Record['april']);
             $data[$i]['MEI'] = addslashes($Record['mei']);
             $data[$i]['JUNI'] = addslashes($Record['juli']);
             $data[$i]['AGUSTUS'] = addslashes($Record['agustus']);
             $data[$i]['SEPTEMBER'] = addslashes($Record['september']);
             $data[$i]['OKTOBER'] = addslashes($Record['oktober']);
             $data[$i]['NOPEMBER'] = addslashes($Record['nopember']);
             $data[$i]['DESEMBER'] = addslashes($Record['desember']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_item');
             }
             $i++;
         }
     }
     if ($_FILES['trktrm']['error'] == 0) {
         unset($data);
         $i = 0;
         //delete then replace as year
         $this->m_penetapanAngaran->del_peryear('d_trktrm', $_POST['tahunAktif']);
         $Test = new Prodigy_DBF($_FILES['trktrm']['tmp_name']);
         while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
             $data[$i]['THANG'] = addslashes($Record['thang']);
             $data[$i]['KDSATKER'] = addslashes($Record['kdsatker']);
             $data[$i]['KDDEPT'] = addslashes($Record['kddept']);
             $data[$i]['KDUNIT'] = addslashes($Record['kdunit']);
             $data[$i]['KDPROGRAM'] = addslashes($Record['kdprogram']);
             $data[$i]['KDGIAT'] = addslashes($Record['kdgiat']);
             $data[$i]['RPHPAGU'] = addslashes($Record['rphpagu']);
             $data[$i]['KDTRKTRM'] = addslashes($Record['kdtrktrm']);
             $data[$i]['JNSBELANJA'] = addslashes($Record['jnsbelanja']);
             $data[$i]['JML01'] = addslashes($Record['jml01']);
             $data[$i]['JML02'] = addslashes($Record['jml02']);
             $data[$i]['JML03'] = addslashes($Record['jml03']);
             $data[$i]['JML04'] = addslashes($Record['jml04']);
             $data[$i]['JML05'] = addslashes($Record['jml05']);
             $data[$i]['JML06'] = addslashes($Record['jml06']);
             $data[$i]['JML07'] = addslashes($Record['jml07']);
             $data[$i]['JML08'] = addslashes($Record['jml08']);
             $data[$i]['JML09'] = addslashes($Record['jml09']);
             $data[$i]['JML10'] = addslashes($Record['jml10']);
             $data[$i]['JML11'] = addslashes($Record['jml11']);
             $data[$i]['JML12'] = addslashes($Record['jml12']);
             //insert data
             if ($data[$i]['THANG'] != '') {
                 $this->model->insert_import($data[$i], 'd_trktrm');
             }
             $i++;
         }
     }
     echo "<script>alert('Data Berhasil Masuk');window.location.href='" . $basedomain . "penetapanAnggaran/penetapananggaran'</script>";
     exit;
 }
Example #3
0
 public function test()
 {
     require_once './prodigy-dbf.php';
     $Test = new Prodigy_DBF(base_url() . "/tmp/0250810418198.12/d_giat0250810418198.12", base_url() . "/tmp/0250810418198.12/d_giat0250810418198.FPT");
     while ($Record = $Test->GetNextRecord(true) and !empty($Record)) {
         print_r($Record);
     }
 }