예제 #1
0
파일: users.php 프로젝트: nadee894/Hakathon
 function add_admin()
 {
     $user_model = new User_model();
     $user_service = new User_service();
     $avatar = $this->input->post('profile_pic', TRUE);
     $user_model->set_title($this->input->post('title', TRUE));
     $user_model->set_name($this->input->post('name', TRUE));
     if ($avatar == '') {
         $user_model->set_profile_pic('avatar.png');
     } else {
         $user_model->set_profile_pic($avatar);
     }
     $user_model->set_user_name($this->input->post('user_name', TRUE));
     $user_model->set_user_type($this->input->post('user_type', TRUE));
     $user_model->set_email($this->input->post('email', TRUE));
     $user_model->set_address($this->input->post('address', TRUE));
     $user_model->set_contact_no_1($this->input->post('contact_no_1', TRUE));
     $user_model->set_contact_no_2($this->input->post('contact_no_2', TRUE));
     $user_model->set_password(md5($this->input->post('password', TRUE)));
     $user_model->set_added_by($this->session->userdata('USER_ID'));
     $user_model->set_added_date(date("Y-m-d H:i:s"));
     $user_model->set_account_activation_code('code');
     $user_model->set_is_online('0');
     //        $body_type_model->set_updated_date(date("Y-m-d H:i:s"));
     //        $body_type_model->set_updated_by(1);
     $user_model->set_is_published('1');
     $user_model->set_is_deleted('0');
     echo $user_service->add_user($user_model);
 }
예제 #2
0
 function add_new_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_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_avatar('default_cover_pic.png');
     $user_model->set_del_ind('1');
     $user_model->set_added_by($this->session->userdata('USER_CODE'));
     $user_model->set_added_date(date("Y-m-d H:i:s"));
     echo $user_service->add_new_user($user_model);
 }
예제 #3
0
파일: users.php 프로젝트: gayathma/feedbox
 function add_user()
 {
     $user_model = new User_model();
     $user_service = new User_service();
     $user_model->set_name($this->input->post('name', TRUE));
     $user_model->set_user_name($this->input->post('user_name', TRUE));
     $user_model->set_user_type($this->input->post('user_type', TRUE));
     $location_id = "";
     if ($this->session->userdata('USER_TYPE') != '1') {
         $location_id = $this->session->userdata('USER_LOCATION');
     } else {
         $location_id = $this->input->post('location_id', TRUE);
     }
     $user_model->set_location_id($location_id);
     $user_model->set_email($this->input->post('email', TRUE));
     $user_model->set_password(md5($this->input->post('password', TRUE)));
     $user_model->set_added_by($this->session->userdata('USER_ID'));
     $user_model->set_added_date(date("Y-m-d H:i:s"));
     $user_model->set_is_published('1');
     $user_model->set_is_online('0');
     $user_model->set_is_deleted('0');
     echo $user_service->add_user($user_model);
 }