-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
169 lines (145 loc) · 5.65 KB
/
index.php
File metadata and controls
169 lines (145 loc) · 5.65 KB
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
159
160
161
162
163
164
165
166
167
168
169
<?php
session_start();
include "link.php";
$query = "SELECT department FROM department";
$result = $mysqli->query($query);
?>
<!Doctype html>
<html>
<head>
<meta charset = "utf-8"/>
<title>Index</title>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="style.css" rel="stylesheet" media="screen">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/formValidation.js"></script>
</head>
<body>
<br/><br/>
<br/><br/>
<br/><br/>
<div class="container">
<div class="well">
<ul class="nav nav-tabs">
<li class="active"><a href="#loginTab" data-toggle="tab">Login</a></li>
<li><a href="#createStudent" data-toggle="tab">Create Account(student)</a></li>
<li><a href="#createProfessor" data-toggle="tab">Create Account(professor)</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active in" id="loginTab">
<form class="form-horizontal" method="post" action="login.php">
<fieldset>
<!-- Form Name -->
<legend>Login</legend>
<!-- Text input-->
<div class="control-group">
<label class="control-label">account</label>
<div class="controls">
<input id="account" name="account" type="text" placeholder="input account" class="input-xlarge" required="">
<p class="help-block"></p>
</div>
</div>
<!-- Password input-->
<div class="control-group">
<label class="control-label">password</label>
<div class="controls">
<input id="password" name="password" type="password" placeholder="input password" class="input-xlarge" required="">
<p class="help-block"></p>
</div>
</div>
<!-- Button -->
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<button id="login" name="login" class="btn btn-primary">login</button>
</div>
</div>
</fieldset>
</form>
</div>
<!-- Register(student) -->
<div class="tab-pane fade" id="createStudent">
<form id="tabS" method="post" action="register.php?type=student"
onsubmit="return submitStudentForm();">
<label>Account</label>
<input id="stdAccount" name="account" type="text" value=""
class="input-xlarge" onblur="validateAccountAndID(this,document.getElementById('stdAccountHelp'));">
<span class="" id="stdAccountHelp"></span>
<label>Password</label>
<input id="stdPassword" name="password" type="password" value=""
class="input-xlarge" onblur="validatePassword(this,document.getElementById('stdPasswordHelp'));">
<span class="help-block" id="stdPasswordHelp"></span>
<label>Name</label>
<input id="stdName" name="name" type="text" value=""
class="input-xlarge" onblur="validateName(this,document.getElementById('stdNameHelp'));">
<span class="help-block" id="stdNameHelp"></span>
<label>IDNumber</label>
<input id="stdID" name="idNumber" type="text" value=""
class="input-xlarge" onblur="validateAccountAndID(this,document.getElementById('stdIDHelp'));">
<span class="help-block" id="stdIDHelp"></span>
<label>Department</label>
<select id="stdDepartment" name="department">
<?php
while ($row = $result->fetch_assoc()){
echo"<option>";
echo $row['department'];
echo"</option>";
}
?>
</select>
<label>Grade</label>
<select id="stdGrade" name="grade">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
<div>
<button class="btn btn-primary">Create Account</button>
</div>
<span class="help-block" id="stdRegisterHelp"></span>
</form>
</div>
<div class="tab-pane fade" id="createProfessor">
<form id="tabP" method="post" action="register.php?type=professor"
onsubmit="return submitProfessorForm();">
<label>Account</label>
<input id="profAccount" name="account" type="text" value=""
class="input-xlarge" onblur="validateAccountAndID(this,document.getElementById('profAccountHelp'));">
<span class="help-block" id="profAccountHelp"></span>
<label>Password</label>
<input id="profPassword" name="password" type="password" value=""
class="input-xlarge" onblur="validatePassword(this,document.getElementById('profPasswordHelp'));">
<span class="help-block" id="profPasswordHelp"></span>
<label>Name</label>
<input id="profName" name="name" type="text" value=""
class="input-xlarge" onblur="validateName(this,document.getElementById('profNameHelp'));">
<span class="help-block" id="profNameHelp"></span>
<label>StaffNumber</label>
<input id="profID" name="idNumber" type="text" value=""
class="input-xlarge" onblur="validateAccountAndID(this,document.getElementById('profIDHelp'));">
<span class="help-block" id="profIDHelp"></span>
<label>Department</label>
<select id="profDepartment" name = "department">
<?php
mysqli_data_seek($result, 0) ;
while ($row = $result->fetch_assoc()){
echo"<option>";
echo $row['department'];
echo"</option>";
}
?>
</select>
<div>
<button class="btn btn-primary">Create Account</button>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>