/
register.php
158 lines (135 loc) · 6.26 KB
/
register.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!--
TODO: Make sure password is used as md5
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<?php
$error=0;
if(isset($_GET['error'])){
$error=$_GET['error'];
}
require_once 'DB/initDB.php';
require_once 'DB/registerDB.php';
$rDB= new registerDB();
$departmentlist= $rDB->getDepartmentList();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Register</title>
<script type="text/javascript" src="static/js/jquery.js"></script>
<script type="text/javascript" src="static/js/register.js"></script>
</head>
<body>
<div id="registration_form">
<?php
switch($error){
case 1:
echo "<div class='form-error' style='display: block;'>";
echo "Please enter valid email address.";
echo "</div>";
break;
case 2:
echo "<div class='form-error' style='display: block;'>";
echo "User already exist . <a href='forgot.php'>Forgot Password ?</a>";
echo "</div>";
break;
case 3:
echo "<div class='form-error' style='display: block;'>";
echo "Password should be atleast 6 chars.";
echo "</div>";
break;
case 4:
echo "<div class='form-error' style='display: block;'>";
echo "Passwords are not matching.";
echo "</div>";
break;
case 5:
echo "<div class='form-error' style='display: block;'>";
echo "Please select user type.";
echo "</div>";
break;
case 6:
echo "<div class='form-error' style='display: block;'>";
echo "Please enter valid Contact Number.";
echo "</div>";
default:
break;
}
?>
<form name="register" method="post" action="registerUser.php">
<div class="textbox">
<span class="text">First Name</span>
<input type="text" name="first_name" placeholder="First Name" />
</div>
<div class="textbox">
<span class="text">Last Name</span>
<input type="text" name="last_name" placeholder="Last Name" />
</div>
<!-- <div class="textbox">
<span class="text">Desired User Name</span>
<input type="text" name="user_name" placeholder="Desired User Name" />
</div>-->
<div class="textbox">
<span class="text">Email</span>
<input type="text" name="email" placeholder="Email" />
</div>
<div class="password">
<span class="text">Password</span>
<input type="password" name="pass1" placeholder="Password" />
</div>
<div class="password">
<span class="text">Confirm Password</span>
<input type="password" name="pass2" placeholder="Confirm Password" />
</div>
<div class="textbox">
<span class="text">Contact No.</span>
<input type="text" name="contact" placeholder="Contact Number" />
</div>
<div class="checkbox">
<span class="text">Gender</span>
<input type="radio" name="sex" value="M" checked="true" > Male</input>
<input type="radio" name="sex" value="F" > Female</input>
</div>
<div class="selectbox">
<span class="text">Category</span>
<select name="user_type" id="usertype_list">
<option value="0">--Select--</option>
<option value="5">Student</option>
<option value="2">Head of Department</option>
<option value="3">Faculty Advisor</option>
<option value="4">Office Staff</option>
</select>
</div>
<div class="selectbox department_info">
<span class="text">Department</span>
<select name="department" id="department_list">
<?php while($row= mysql_fetch_row($departmentlist))
{
?>
<option value="<?php echo $row[0];?>"><?php echo $row[1]; ?></option>
<?php
}
?>
</select>
</div>
<div class="textbox student_info" >
<span class="text">Roll No.</span>
<input type="text" name="roll_number" placeholder="Roll Number"/>
</div>
<div class="textbox student_info" >
<span class="text">Category</span>
<select name="category" />
<option value="0">--Select--</option>
<option value="GATE">GATE</option>
<option value="SPONSORED">SPONSORED</option>
</select>
</div>
<div class="btn_1">
<input type="submit" Value="Submit" />
</div>
</form>
</div><!--end registration_form-->
</body>
</html>