I have problem in my source code, when input many images and different images/ upload file, the results obtained are the same image. how do i fix it, please help me
CONTROLLER
public function tambahprogress()
{
$this->load->helper('url','form');
$this->load->library('form_validation');
$this->form_validation->set_rules('keterangan','keterangan','trim|required');
$this->load->model('progress/progress_model');
if ($this->form_validation->run()==FALSE) {
$data['pekerjaan']=$this->progress_model->combopekerjaan();
$data['pekerja']=$this->progress_model->combopekerja();
$this->load->view('progress/tambahprogress', $data);
}else{
$config['upload_path'] = './assets/upload/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 1000000000;
$config['max_width'] = 10240;
$config['max_height'] = 7680;
$this->load->library('upload', $config);
if (! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('progress/tambahprogress',$error);
}
else
{
$image_data = $this->upload->data();
$configer = array (
'image_library'=>'gd2',
'source_image'=>$image_data['full_path'],
'width'=>800,
'height'=>600,
);
$this->load->library('image_lib',$config);
$this->image_lib->clear();
$this->image_lib->initialize($configer);
$this->image_lib->resize();
$this->progress_model->insertProgress();
$this->load->view('progress/tambahprogresssukses');
}
}
}
MODEL
public function insertProgress()
{
$object = array
(
'id_progress' =>$this->input->post('id_progress'), 'no_spk' =>$this->input->post('no_spk'),'progress' =>$this->input->post('progress'), 'keterangan' =>$this->input->post('keterangan'), 'gambar'=>$this->upload->data('file_name'), 'gambar2'=>$this->upload->data('file_name'), 'gambar3'=>$this->upload->data('file_name'), 'id_pekerja' =>$this->input->post('id_pekerja')
);
$this->db->insert('progress',$object);
}
VIEW(INPUT PROCESS)
<div class="form-group">
<label for="">Masukkan Gambar</label>
<<input type="file" name="userfile" size="20"/>
</div>
<div class="form-group">
<input type="file" name="userfile" size="20"/>
</div>
<div class="form-group">
<input type="file" name="userfile" size="20"/>
</div>
and the result is same images but when i input data, i input different image please help me