function edit_user() { $user_model = new user_model(); $user_service = new user_service(); $user_model->set_user_fname($this->input->post('user_fname', TRUE)); $user_model->set_user_lname($this->input->post('user_lname', TRUE)); $user_model->set_user_email($this->input->post('user_email', TRUE)); $user_model->set_user_job($this->input->post('user_job', TRUE)); $user_model->set_user_bday($this->input->post('user_bday', TRUE)); $user_model->set_user_contact($this->input->post('user_contact', TRUE)); $user_model->set_user_id($this->input->post('user_id', TRUE)); echo $user_service->update_user_profile($user_model); }
function edit_user() { $user_model = new user_model(); $user_service = new user_service(); $user_model->set_user_id($this->input->post('user_id', TRUE)); $user_model->set_user_fname($this->input->post('user_fname', TRUE)); $user_model->set_user_lname($this->input->post('user_lname', TRUE)); $user_model->set_user_password(md5($this->input->post('user_password', TRUE))); $user_model->set_user_email($this->input->post('user_email', TRUE)); $user_model->set_user_type($this->input->post('user_type', TRUE)); $user_model->set_user_bday($this->input->post('user_bday', TRUE)); $user_model->set_user_contact($this->input->post('user_contact', TRUE)); $user_model->set_user_avatar($this->input->post('user_avatar', TRUE)); $user_model->set_updated_by($this->session->userdata('USER_ID')); $user_model->set_updated_date(date("Y-m-d H:i:s")); $user_model->set_user_id($this->input->post('user_id', TRUE)); if ($this->input->post('user_id', TRUE) == $this->session->userdata('USER_ID')) { $this->session->set_userdata('USER_PROPIC', $this->input->post('user_avatar', TRUE)); } echo $user_service->update_user($user_model); }