Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addHumanProses()
- {
- // set common properties
- $data['action'] = site_url('welcome/addHumanProses');
- // set empty default form field values
- $this->_set_fieldsDriver();
- // set validation properties
- $this->_set_rulesDriver();
- $config['upload_path'] = './uploads/';
- $config['allowed_types'] ='gif|jpg|png';
- $config['max_size'] = '5000000';
- $config['max_width'] ='1600';
- $config['max_height'] = '850';
- $this->load->library('upload',$config);
- if ( ! $this->upload->do_upload())
- {
- $data = array('error' => $this->upload->display_errors());
- $this->load->view('header');
- $this->load->view('body-left');
- $this->load->view('body-center');
- $this->load->view('addHuman', $data);
- $this->load->view('information');
- $this->load->view('body-right');
- $this->load->view('footer');
- }
- else
- {
- $data =array('upload_data' => $this->upload->data());
- $this->load->helper('form');
- $this->load->helper('html');
- $this->load->model('person_model');
- if($this->form_validation->run() == FALSE)
- {
- $this->load->model('person_model');
- if($query = $this->person_model->saveDriver())
- {
- $data['message'] = '<div class="success">add new person success</div>';
- $this->load->view('header');
- $this->load->view('body-left');
- $this->load->view('body-center');
- $this->load->view('addHuman', $data);
- $this->load->view('information');
- $this->load->view('body-right');
- $this->load->view('footer');
- }
- else
- {
- $this->addHuman();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment