コード例 #1
0
ファイル: register_users.php プロジェクト: gayathma/SAHack
 function add_new_user()
 {
     $register_users_model = new Register_Users_model();
     $register_users_service = new Register_Users_service();
     $register_users_model->set_name($this->input->post('name', TRUE));
     $register_users_model->set_user_name($this->input->post('user_name', TRUE));
     $register_users_model->set_user_type('Admin', 'Manager', 'Surgeon', 'Op');
     $register_users_model->set_email(trim($this->input->post('email', TRUE)));
     $register_users_model->set_address($this->input->post('address', TRUE));
     $register_users_model->set_password(md5($this->input->post('password', TRUE)));
     $register_users_model->set_contact1($this->input->post('contact_no_1', TRUE));
     $register_users_model->set_is_deleted('0');
     echo $register_users_service->add_new_user_registration($register_users_model);
 }
コード例 #2
0
ファイル: register_users.php プロジェクト: nadee894/AutoVille
 function add_new_user()
 {
     $register_users_model = new Register_Users_model();
     $register_users_service = new Register_Users_service();
     $register_users_model->set_name($this->input->post('form_register_full_name', TRUE));
     $register_users_model->set_user_name($this->input->post('form_register_user_name', TRUE));
     $register_users_model->set_user_type('3');
     $register_users_model->set_email(trim($this->input->post('form_register_email', TRUE)));
     $register_users_model->set_address($this->input->post('form_register_address', TRUE));
     $register_users_model->set_contact1($this->input->post('form_register_contact', TRUE));
     //$register_users_model->set_contact2($this->input->post('contact_no_2', TRUE));
     $register_users_model->set_profile_pic('avatar.png');
     $register_users_model->set_password(md5($this->input->post('form_register_password', TRUE)));
     $register_users_model->set_is_online('0');
     $register_users_model->set_title(trim($this->input->post('title', TRUE)));
     $token = $this->generate_random_string();
     //generate account activation token
     $register_users_model->set_account_activation_code($token);
     $register_users_model->set_is_published('0');
     $register_users_model->set_is_deleted('0');
     //$register_users_model->set_added_by($this->input->post('added_by', TRUE));
     //$register_users_model->set_added_date($this->input->post('added_date', TRUE));
     //$register_users_model->set_updated_date($this->input->post('updated_date', TRUE));
     //$register_users_model->set_updated_by($this->input->post('updated_by', TRUE));
     $register_users_model->set_account_activation_code($token);
     $register_users_service->add_new_user_registration($register_users_model);
     $email = trim($this->input->post('form_register_email', TRUE));
     //'*****@*****.**';
     $email_subject = "AutoVille Account Activation";
     $data['name'] = $this->input->post('form_register_full_name', TRUE);
     $data['user_name'] = $this->input->post('form_register_user_name', TRUE);
     $data['pasword'] = $this->input->post('form_register_password', TRUE);
     $data['link'] = site_url() . '/login/activate?email=' . $this->input->post('form_register_email', TRUE) . '&token=' . $token;
     $msg = $this->load->view('template/mail_template/body', $data, TRUE);
     $headers = 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     $headers .= 'From: Autoville <*****@*****.**>' . "\r\n";
     $headers .= 'Cc: info.autovillle@gmail.com' . "\r\n";
     //        echo $msg;
     //        return;
     if (mail($email, $email_subject, $msg, $headers)) {
         echo "1";
         $this->session->set_flashdata('info', 'Please go to your email account and continue the registration process');
     } else {
         echo "0";
     }
     return true;
 }