[eluser]RalphLeMouf[/eluser]
// CONTROLLER
Code:
if($this->form_validation->run() == FALSE )
{
$data['main_content'] = 'account/edit';
$this->load->view('includes/templates/main_page_template', $data);
}
elseif($this->form_validation->run() == TRUE)
{
$birthdate = $this->input->post('year') . "-" . $this->input->post('month') . "-" . $this->input->post('day');
$save_data = array(
'relation' => $this->input->post('relation'),
'location' => $this->input->post('location'),
'birthday' => date('Y-m-d',strtotime($birthdate)),
'gender' => $this->input->post('gender'),
'mylife' => $this->input->post('mylife'),
'occupation' => $this->input->post('occupation'),
'hobbies' => $this->input->post('hobbies'),
'books' => $this->input->post('books'),
'music' => $this->input->post('music'),
'movies' => $this->input->post('movies'),
'quote' => $this->input->post('quote'),
'mycysticlife' => $this->input->post('mycysticlife'),
'medicines' => $this->input->post('medicines'),
'treatments' => $this->input->post('treatments'),
'PFTs:FVC' => $this->input->post('PFTs:FVC'),
'FEV1' => $this->input->post('FEV1'),
'mutation' => $this->input->post('mutation'),
'twitter' => $this->input->post('twitter'),
'myspace' => $this->input->post('myspace'),
'facebook' => $this->input->post('facebook'),
'blogspot' => $this->input->post('blogspot'),
'youtube' => $this->input->post('youtube'),
'url' => $this->input->post('url'),
'city' => $this->input->post('city'),
);
$query = $this->account_model->update_edit($user['id'],$save_data);
$data['main_content'] = 'account/welcome';
$this->load->view('includes/templates/main_page_template', $data);
}
}
}