-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
318 lines (317 loc) · 18.7 KB
/
index.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?php
include "connection.php";
session_start();
if((isset($_SESSION["userName"])) and ($_SESSION["userType"]=="Admin")) {
?>
<script type="text/javascript">
window.location="admin/dashboard.php";
</script>
<?php
}
elseif((isset($_SESSION["userName"])) and ($_SESSION["userType"]=="Employee")) {
?>
<script type="text/javascript">
window.location="employee/dashboard.php";
</script>
<?php
}
elseif((isset($_SESSION["userName"])) and ($_SESSION["userType"]=="Student")) {
?>
<script type="text/javascript">
window.location="student/dashboard.php";
</script>
<?php
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/stylesheet_index.css">
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/script_index.js"></script>
<link rel="stylesheet" href="css/webfonts/all.css">
<link rel="icon" href="img/amslogofavicon.png">
<title>Academic Management System</title>
</head>
<body>
<!--Start Header-->
<header>
<!--Start Navigation Bar-->
<nav class="navbar navbar-expand-md navbar-light">
<!--Brand Logo-->
<div id="nav-brandlogo"></div>
<!--Brand Name-->
<a class="navbar-brand" href="index.php"><span id="nav-brandname">Academic Management System JUET</span></a>
<!--Start Navigation Bar Toggler-->
<button id="nav-toggler" class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsable-navbar" aria-controls="collapsable-navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="collapsable-navbar" class="collapse navbar-collapse text-center">
<!--Login Button-->
<button class="btn btn-primary navbar-btn nav-sm-size ml-auto" type="button" data-toggle="modal" data-target="#modal-login"><i class="fas fa-sign-in-alt"></i> Login</button>
<!--Start Modal-->
<div id="modal-login" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-title-login" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<!--Start Modal Header-->
<div class="modal-header">
<h5 id="modal-title-login" class="modal-title">Login to AMS JUET</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!--End Modal Header-->
<!--Start Modal Body-->
<div class="modal-body text-left">
<form action="" id="loginForm" method="POST">
<div class="form-group">
<label for="input-member-type">Member Type</label>
<select id="input-member-type" class="form-control custom-select" name="userType">
<option disabled selected>Select Member Type</option>
<option>Admin</option>
<option>Employee</option>
<option>Student</option>
</select>
</div>
<div id="form-group-id" class="form-group">
<label id="input-label-id" for="input-id"></label>
<input id="input-id" class="form-control" type="text" name="userName" required>
</div>
<div id="form-group-dob" class="form-group">
<label for="input-dob"><a data-toggle="tooltip" title="" data-original-title="DD-MM-YYYY">Date of Birth</a>
</label>
<input id="input-dob" class="form-control" type="date" placeholder="DD-MM-YYYY">
</div>
<div id="form-group-password" class="form-group">
<label for="input-password">Password</label>
<input id="input-password" class="form-control" type="password" placeholder="Password" name="password" required>
<a href="">Forgot Password?</a>
</div>
<span id="login-fields-mandatory">All fields are mandatory!</span>
</form>
</div>
<!--End Modal Body-->
<!--Start Modal Footer-->
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fas fa-times"></i> Close</button>
<button type="submit" name="login" form="loginForm" class="btn btn-success"><i class="fas fa-sign-in-alt"></i> Login</button>
</div>
<!--End Modal Footer-->
</div>
</div>
</div>
<!--End Modal-->
<!--Start Navigation Bar Menu-->
<ul class="navbar-nav">
<!--<li class="nav-item active nav-sm-size">
<a class="nav-link" href="index.html"><i class="fas fa-home"></i> Home</a>
</li>-->
<li class="nav-item dropdown nav-sm-size">
<a id="nav-dropdown" class="nav-link dropdown-toggle" href="index.html" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
More
</a>
<div class="dropdown-menu dropdown-menu-right text-center" aria-labelledby="nav-dropdown">
<a class="dropdown-item nav-sm-size" href="about.php"><i class="fas fa-info-circle"></i> About Us</a>
<a class="dropdown-item nav-sm-size" href="contact.php"><i class="fas fa-envelope"></i> Contact Us</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item nav-sm-size" href="#"><i class="fas fa-question-circle"></i> Having issues? Report to us!</a>
</div>
</li>
</ul>
<!--End Navigation Bar Menu-->
</div>
<!--End Navigation Bar Toggler-->
</nav>
<!--End Navigation Bar-->
</header>
<!--End Header-->
<!--Start Main Content-->
<div id="main-content">
<!--Start Carousel-->
<div id="carousel-photos-juet" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-photos-juet" data-slide-to="0" class="active"></li>
<li data-target="#carousel-photos-juet" data-slide-to="1"></li>
<li data-target="#carousel-photos-juet" data-slide-to="2"></li>
<li data-target="#carousel-photos-juet" data-slide-to="3"></li>
<li data-target="#carousel-photos-juet" data-slide-to="4"></li>
<li data-target="#carousel-photos-juet" data-slide-to="5"></li>
<li data-target="#carousel-photos-juet" data-slide-to="6"></li>
<li data-target="#carousel-photos-juet" data-slide-to="7"></li>
<li data-target="#carousel-photos-juet" data-slide-to="8"></li>
<li data-target="#carousel-photos-juet" data-slide-to="9"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/juet10.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet4.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet1.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet2.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet3.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet5.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet6.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet7.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet8.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
<div class="carousel-item">
<img src="img/juet9.jpg" class="d-block w-100 carousel-image-size" alt="">
<div class="carousel-caption d-none d-md-block">
<h5>Jaypee University of Engineering and Technology</h5>
<p>Welcome to Academic Management System JUET</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carousel-photos-juet" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel-photos-juet" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!--End Carousel-->
<div id="about-ams" class="text-center">
<img src="img/amslogo.png" alt="logo" height=100px width=100px>
<h4>Academic Management System</h4>
<p class="text-justify">This Academic Management System is maintained by Jaypee University of Engineering and Technology. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Omnis optio vero amet veritatis voluptatibus, iure incidunt facere consequatur voluptates, et obcaecati laborum atque quae temporibus distinctio cumque dolore quis eos. Lorem ipsum dolor sit amet consectetur, adipisicing elit. Minima eum praesentium vero in perspiciatis ipsam debitis rem. Iure eius placeat eaque quidem illo nisi quos? Fuga nisi libero dolorum sed. Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi nam, culpa recusandae, perspiciatis eaque, porro nihil repellat cum repudiandae maiores vero tempora a minima! Explicabo aliquid assumenda asperiores alias velit? Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quo accusamus labore iste illo optio laborum amet, ex neque reiciendis porro? Fuga atque vel sed est voluptates dolorum possimus sequi voluptas?</p>
</div>
</div>
<!--End Main Content-->
<!--Start Footer-->
<footer>
</footer>
<!--End Footer-->
<!--Start Copyright-->
<div class="copyright-size text-center">© Academic Management System 2020</div>
<!--End Copyright-->
</body>
</html>
<?php
if(isset($_POST['login'])){
$count=0;
if($_POST['userType']=='Student'){
$sql="SELECT * FROM registration WHERE userName='$_POST[userName]' AND password='$_POST[password]'";
$result=$mysqli->query($sql);
$count=$result->num_rows;
if($count!=0){
$_SESSION["userName"]=$_POST["userName"];
$_SESSION["userType"]=$_POST["userType"];
?>
<script type="text/javascript">
window.location="student/dashboard.php";
</script>
<?php
}
else {
?>
<script type="text/javascript">
alert("Invalid credentials! Recheck your username and password and try again!");
</script>
<?php
}
}
elseif($_POST['userType']=='Employee'){
$userName=mysqli_real_escape_string($mysqli,$_POST['userName']);
$password=mysqli_real_escape_string ($mysqli,$_POST['password']) ;
$sql="SELECT * FROM admin_login WHERE userName='$userName' and password='$password' and admin=0";
$result=$mysqli->query($sql);
$count=$result->num_rows;
if($count!=0){
$_SESSION['userName']=$_POST['userName'];
$_SESSION["userType"]=$_POST["userType"];
?>
<script type="text/javascript">
window.location="employee/dashboard.php";
</script>
<?php
}
else {
?>
<script type="text/javascript">
alert("Invalid credentials! Recheck your username and password and try again!");
</script>
<?php
}
}
elseif($_POST['userType']=='Admin'){
$userName=mysqli_real_escape_string($mysqli,$_POST['userName']);
$password=mysqli_real_escape_string ($mysqli,$_POST['password']);
$sql="SELECT * FROM admin_login WHERE userName='$userName' and password='$password' and admin=1";
$result=$mysqli->query($sql);
$count=$result->num_rows;
if($count!=0){
$_SESSION['userName']=$_POST['userName'];
$_SESSION["userType"]=$_POST["userType"];
?>
<script type="text/javascript">
window.location="admin/dashboard.php";
</script>
<?php
}
else {
?>
<script type="text/javascript">
alert("Invalid credentials! Recheck your username and password and try again!");
</script>
<?php
}
}
}
?>