Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateDriverP()
- {
- $config['upload_path'] = './assets/uploads/';
- $config['allowed_types'] ='gif|jpg|png|swf';
- $config['max_size'] = '5000000';
- $config['max_width'] ='1600';
- $config['max_height'] = '1200';
- $this->load->library('upload',$config);
- if ( ! $this->upload->do_upload())
- {
- $error = array('error' => $this->upload->display_errors());
- $this->cekLevel();
- $this->load->view('vdriver/editDriver',$error);
- $this->load->view('vapp_right_menu');
- $this->load->view('vapp_footer');
- }
- else
- {
- $data =array('upload_data' => $this->upload->data());
- $data['title'] = 'Update Driver';
- $data['action'] = site_url('erp/driver/updateDriverP/');
- $data['link_back'] = anchor('erp/driver/','Back to list Driver',array('class'=>'back'));
- $this->load->helper('form');
- $this->load->helper('html');
- $this->load->model('m_driver');
- $this->_set_fields_edit();
- $this->_set_rules_edit();
- $this->form_validation->set_rules('id_driver', 'ID Driver', 'trim|required');
- $this->form_validation->set_rules('nama_driver', 'Name', 'trim|required');
- $this->form_validation->set_rules('no_polisi', 'Kuota', 'trim|required');
- $this->form_validation->set_rules('dob', 'Day of Birth', 'trim|required');
- $this->form_validation->set_rules('jk', 'GEnder', 'trim|required');
- $this->form_validation->set_rules('religion', 'Religion', 'trim|required');
- $this->form_validation->set_rules('tgl_gabung', 'Join Date', 'trim|required');
- $this->form_validation->set_rules('pekerjaan', 'Pekerjaan', 'trim|required');
- $this->form_validation->set_rules('alamat', 'Alamat', 'trim|required');
- $this->form_validation->set_rules('photo', 'Photo', 'trim|required');
- $this->form_validation->set_message('required', '* required');
- $this->form_validation->set_message('isset', '* required');
- $this->form_validation->set_error_delimiters('<p class="error">', '</p>');
- if ($this->form_validation->run() == FALSE)
- {
- $data['message'] = 'eror validasi';
- }
- else
- {
- // save data
- $id = $this->input->post('id_driver');
- $person = array(
- 'nama_driver' => $this->input->post('nama_driver'),
- 'no_polisi' => $this->input->post('no_polisi'),
- 'dob' => $this->input->post('dob'),
- 'jk' => $this->input->post('jk'),
- 'religion' => $this->input->post('religion'),
- 'tgl_gabung' => $this->input->post('tgl_gabung'),
- 'pekerjaan' => $this->input->post('pekerjaan'),
- 'alamat' => $this->input->post('alamat'),
- 'photo' => $_FILES['userfile']['name']);
- $this->m_driver->updateDriver($id,$person);
- $data['message'] = '<div class="success">update header success</div>';
- }
- redirect('erp/driver/','refresh');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment