-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
387 lines (95 loc) · 4.18 KB
/
signup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
class signup extends CI_Controller
{
function __construct() {
parent::__construct();
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'email-smtp.us-east-1.amazonaws.com',
'smtp_port' => 465,
'smtp_user' => 'AKIAIOTTT4Q6QYPJBJAA',
'smtp_pass' => 'AlAqsyuNaljTAJ4FZ5l69V2IiT35H2BfvNbAoCrKbtoP',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE,
'crlf' => '\r\n',
'smtp_crypto' => 'ssl',
'newline' => '\r\n'
);
$this->load->library('email', $config);
}
public function add_signup()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_error_delimiters('<div style="color: red;">', '</div>');
if ($this->form_validation->run() == FALSE)
{
// $data['content'] = 'admin/tickets_insert';
$this->load->view('signup_insert');
}
else
{
$data=array(
'email'=>$this->input->post('email'),
'password'=>$this->input->post('password'),
);
$this->gpi_model->insert($data,'login');
$this->load->library('email');
$this->email->from('[email protected]', 'amit');
$this->email->to($this->input->post('email'));
//$this->email->cc('[email protected]');
//$this->email->bcc('[email protected]');
$this->email->subject('Account Activation');
$this->email->message('Please Activate Your Account By Clicking On This Link. ');
$this->email->send();
// header("Location: ".base_url()."admin/tickets/tickets_view");
}
}
function signup_view()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('first_name', 'First Name', 'required');
$this->form_validation->set_rules('last_name', 'Last Name', 'required');
$this->form_validation->set_rules('username', 'User Name', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('phone_no', 'Contact No', 'required');
$this->form_validation->set_rules('password', 'Password', 'required|matches[confpassword]|alpha_numeric|callback_passwordstrength');
$this->form_validation->set_rules('confpassword', 'Confirm Password', 'required');
$this->form_validation->set_error_delimiters('<div style="color: red;">', '</div>');
if ($this->form_validation->run() == FALSE)
{
$data['content'] = 'signup';
$this->load->view('layout/layout', $data);
}
else
{
$email=$this->gpi_model->getemail($this->input->post("email"));
foreach($email as $email)
{
}
if($email)
{
$this->session->set_userdata("gpi_id", $email->user_id);
//header("Location: ".base_url()."login/dashbord");
$verify_reg_code = uniqid();
$data=array(
'first_name'=>$this->input->post('first_name'),
'last_name'=>$this->input->post('last_name'),
'email'=>$this->input->post('email'),
'username'=>$this->input->post('username'),
'phone_no'=>$this->input->post('phone_no'),
'zip_code'=>$this->input->post('zip_code'),
'organization'=>$this->input->post('organization'),
'password'=>$this->input->post('password'),
'verify_reg_id'=>$verify_reg_code,
);
//$this->gpi_model->insert($data,'users');
$this->gpi_model->update($data,"users",$email,"user_id");
echo "demo..... ";
}
// header("Location: ".base_url()."admin/tickets/tickets_view");
}
}
}