Assalam,..
oiya iya pak maap..
jadi sekarang saya mau masalah fungsi tambah dan update untuk mobil kemaren tidak ada gambarnya..
lalu saya tambahin tabel untuk gambar, tapi gagal
untuk yang lain merubah nama sudah bisa tapi gambar tetep ngga masuk pak..
function mobil_update(){
$id = $this->input->post('id');
$merk = $this->input->post('merk');
$plat_mobil = $this->input->post('plat_mobil');
$harga_sewa = $this->input->post('harga_sewa');
$thn_keluaran = $this->input->post('thn_keluaran');
$no_mesin = $this->input->post('no_mesin');
$no_rangka = $this->input->post('no_rangka');
$status = $this->input->post('status');
$this->form_validation->set_rules('merk','Merk','required');
$this->form_validation->set_rules('plat_mobil','plat_mobil','required|min_length[4]');
$this->form_validation->set_rules('harga_sewa','harga_sewa','required|min_length[4]');
$this->form_validation->set_rules('thn_keluaran','thn_keluaran','required|min_length[4]');
$this->form_validation->set_rules('no_mesin','no_mesin','required|min_length[4]');
$this->form_validation->set_rules('no_rangka','no_rangka','required|min_length[4]');
$this->form_validation->set_rules('status','Status','required|min_length[4]');
$config['upload_path'] = './assets/images/';
$config['allowed_types'] = 'jpg|png|jpeg';
$config['max_size'] = '2048';
$config['file_name'] = 'gambar'.time();
$this->load->library('upload', $config);
$where = array('id' => $id); 'merk' =>$merk,
'plat_mobil' => $plat_mobil,
'harga_sewa' => $harga_sewa,
'thn_keluaran' => $thn_keluaran,
'no_mesin' => $no_mesin,
'no_rangka' => $no_rangka,
'gambar' => $image['file_name'],
'status' => $status
);
if($this->upload->do_upload('foto')){
$image=$this->upload->data();
unlink('assets/images/'.$this->input->post('old_pict', TRUE)); $data['gambar'] = $image['file_name'];
}
$this->m_data->update_data($where, $data,'mobil');
redirect(base_url().'petugas/mobil');
}