Advertisement
jamboljack

Save Data

Oct 15th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.17 KB | None | 0 0
  1. if (!empty($upload_data1)) {
  2.             $filePath1  = $upload_data1['file_name']; // Cek Nama Image Profil
  3.             $foto1      = "'rtlh_foto' => ".$filePath1.",";
  4.         } else {
  5.             $foto1      = "";
  6.         }
  7.  
  8.         if (!empty($upload_data2)) {
  9.             $filePath2  = $upload_data2['file_name']; // Cek Nama Image Rumah
  10.             $foto2      = "'rtlh_foto_rmh1' => ".$filePath2.",";
  11.         } else {
  12.             $foto2      = "";
  13.         }
  14.  
  15.         // Input ke RTLH
  16.         $data = array(
  17.             'rtlh_kode_wilayah'     => trim($this->input->post('kd_wilayah', 'true')),
  18.             'rtlh_no_urut'          => trim($no_RTLH),
  19.             'penduduk_nik'          => trim($this->input->post('no_ktp', 'true')),
  20.             'no_kec'                => $this->input->post('no_kec', 'true'),
  21.             'no_kel'                => $this->input->post('no_kel', 'true'),
  22.             'penghasilan_id'        => $this->input->post('lstPenghasilan', 'true'),
  23.             'pengeluaran_id'        => $this->input->post('lstPengeluaran', 'true'),
  24.             'status_tanah_id'       => $this->input->post('lstPemilikTanah', 'true'),
  25.             'bukti_tanah_id'        => $this->input->post('lstBuktiTanah', 'true'),
  26.             'pemilik_rumah_id'      => $this->input->post('lstPemilikRumah', 'true'),            
  27.             'rtlh_rumah_lain'       => $this->input->post('lstAsetRumah', 'true'),
  28.             'rtlh_tanah_lain'       => $this->input->post('lstAsetTanah', 'true'),
  29.             'rtlh_imb'              => $this->input->post('lstIMB', 'true'),
  30.             'bantuan_id'            => $this->input->post('lstBantuan', 'true'),
  31.             'rtlh_pondasi'          => $this->input->post('lstPondasi', 'true'),
  32.             'rtlh_kondisi_balok'    => $this->input->post('lstKondisiBalok', 'true'),
  33.             'rtlh_kondisi_atap'     => $this->input->post('lstKondisiKonstruksiAtap', 'true'),
  34.             'rtlh_jendela'          => $this->input->post('lstJendela', 'true'),
  35.             'ventilasi_id'          => $this->input->post('lstVentilasi', 'true'),
  36.             'rtlh_sanitasi'         => $this->input->post('lstSanitasi', 'true'),
  37.             'rtlh_kondisi_sanitasi' => $this->input->post('lstKondisiSanitasi', 'true'),
  38.             'sanitasi_id'           => $this->input->post('lstJenisSanitasi', 'true'),
  39.             'rtlh_septitank'        => $this->input->post('lstSeptitank', 'true'),
  40.             'rtlh_kondisi_septitank'=> $this->input->post('lstKondisiSeptitank', 'true'),
  41.             'air_minum_id'          => $this->input->post('lstAirMinum', 'true'),
  42.             'listrik_id'            => $this->input->post('lstListrik', 'true'),
  43.             'rtlh_luas'             => $this->input->post('luas', 'true'),
  44.             'rtlh_jml_orang'        => $this->input->post('jml_orang', 'true'),
  45.             'rtlh_no_kk_lain'       => $this->input->post('no_kk_lain', 'true'),
  46.             'rtlh_jml_kk'           => $this->input->post('jml_kk', 'true'),
  47.             'tinggi_id'             => $this->input->post('lstTinggi', 'true'),
  48.             'rtlh_ruang_keluarga'   => $this->input->post('lstKamarTidur', 'true'),
  49.             'material_atap_id'      => $this->input->post('lstMaterialAtap', 'true'),
  50.             'kondisi_atap_id'       => $this->input->post('lstKondisiAtap', 'true'),
  51.             'material_dinding_id'   => $this->input->post('lstMaterialDinding', 'true'),
  52.             'kondisi_dinding_id'    => $this->input->post('lstKondisiDinding', 'true'),
  53.             'material_lantai_id'    => $this->input->post('lstMaterialLantai', 'true'),
  54.             'luas_lantai_id'        => $this->input->post('lstLuasLantai', 'true'),
  55.             'rtlh_lat'              => $this->input->post('lat', 'true'),
  56.             'rtlh_long'             => $this->input->post('long', 'true'),
  57.             'rtlh_status'           => 'Baru',
  58.             'rtlh_prioritas'        => $StatusPrioritas,
  59.             $foto1.$foto2.
  60.             'user_username'         => $this->session->userdata('username'),
  61.             'rtlh_post'             => date('Y-m-d H:i:s'),
  62.             'rtlh_update'           => date('Y-m-d H:i:s')
  63.         );
  64.  
  65.         $this->db->insert('rtlh_rtlh', $data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement