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
130
131
132
133
134
135
136
137
138
139
140
|
<? include('_init.php');?> <? if($_GET['link'] && $_GET['type']){ $refid = aes_crypt($_GET['link'],2); $type = aes_crypt($_GET['type'],2); if($type == 'tutor'){ // $sql = "select id,cmsloginid from tutor_main where id = ? and (isemailverified is null or isemailverified = 0) LIMIT 1"; $parameters = array($refid); $row_tutor = bind_pdo($sql, $parameters, "selectone"); $sql = "select id from tutor_main where id = ? and isemailverified = 1 LIMIT 1"; $parameters = array($refid); $row2_tutor = bind_pdo($sql, $parameters, "selectone"); }else if($type == 'student'){ // $sql = "select id,cmsloginid from student_main where id = ? and (isemailverified is null or isemailverified = 0) LIMIT 1"; $parameters = array($refid); $row_student = bind_pdo($sql, $parameters, "selectone");
$sql = "select id from student_main where id = ? and isemailverified = 1 LIMIT 1"; $parameters = array($refid); $row2_student = bind_pdo($sql, $parameters, "selectone"); } // $status = 'false'; if($row_tutor['id']){ if($row_tutor['id']){ unset($tmp_data); $tmp_data['status'] = 2; $tmp_data['isemailverified'] = 1; $sql = mysql_install($tmp_data,'tutor_main','edit','id'); $tmp_data['id'] = $row_tutor['id']; $arraykey=array_keys($tmp_data); unset($parameters); for($i=0;$i<count($arraykey);$i++){ $parameters[$i]=$tmp_data[$arraykey[$i]]; } bind_pdo($sql, $parameters); $status = 'true'; }elseif($row2_tutor['id']){ $status = 'again'; }else{ $status = 'false'; } }else if($row_student['id']){ if($row_student['id']){ unset($tmp_data); $tmp_data['status'] = 2; $tmp_data['isemailverified'] = 1; $sql = mysql_install($tmp_data,'student_main','edit','id'); $tmp_data['id'] = $row_student['id']; $arraykey=array_keys($tmp_data); unset($parameters); for($i=0;$i<count($arraykey);$i++){ $parameters[$i]=$tmp_data[$arraykey[$i]]; } bind_pdo($sql, $parameters); $status = 'true'; }elseif($row2_student['id']){ $status = 'again'; }else{ $status = 'false'; } } }else{ $status = 'false'; } if($status=='true'){ unset($_SESSION['student_login']); unset($_SESSION['member_login']); if($row_tutor['id']){ $_SESSION['member_login'] = $row_tutor['id']; $path = 'signupTutor.php'; $parameters = array($row_tutor['cmsloginid'],'user',0); }else if($row_student['id']){ $_SESSION['student_login'] = $row_student['id']; $path = 'signupStudent.php'; $parameters = array($row_student['cmsloginid'],'user',0); } $sql = "select cmsloginname,cmsloginid,cmsrole,is_tutor,is_student from sys_cms_login as tb where `cmsloginid` = ? and cmsrole = ? and deleted = ? LIMIT 1"; $row_cms = bind_pdo($sql, $parameters, "selectone");
$_SESSION['loginname'] = aes_crypt($row_cms['cmsloginname'],2); $_SESSION['cmsloginname'] = aes_crypt($row_cms['cmsloginname'],2); $_SESSION['cmsusername'] = aes_crypt($row_cms['cmsloginname'],2); $_SESSION['cmsloginid'] = $row_cms['cmsloginid']; $_SESSION['loginid'] = $row_cms['cmsloginid']; $_SESSION['cmsrole'] = $row_cms['cmsrole']; $_SESSION['role'] = $row_cms['cmsrole']; $_SESSION['is_tutor'] = $row_cms['is_tutor']; $_SESSION['is_student'] = $row_cms['is_student']; if($row_tutor['id']){ $_SESSION['member_login'] = $row_tutor['id']; }else if($row_student['id']){ $_SESSION['student_login'] = $row_student['id']; } @header("Location: {$path}"); echo "<script language='JavaScript'>window.location='{$path}'</script>"; exit(); }else if($status=='again'){ //$path = 'index.php'; }else if($status=='false'){ //$path = 'index.php'; } ?> <!DOCTYPE html> <html lang="en"> <head> <? include('_head.php');?> <link href="css/_sign.css" type="text/css" rel="stylesheet"> </head>
<body> <!-- Navigation --> <? include('_header.php');?> <? include('_dialog.php') ?> <div class="formSection" style="margin-top:150px;"> <div class="TutorForm"> <? if($status=='true'){?> <p class="general_txt success bigger"> <?=_lang("Thank you for verification!")?> </p> <? }else if($status=='again'){?> <p class="general_txt success bigger"> <?=_lang("Thank you for verification! You have verified before. Please login your account.")?></p> <? }else if($status=='false'){?> <p class="general_txt error bigger"> <?=_lang("Thank you for verification! Verification is not success. Please try again.")?></p> <? }?> </div> </div> <? include('_footer.php')?> </body> </html>
|