-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
329 lines (294 loc) · 13.4 KB
/
index.php
File metadata and controls
329 lines (294 loc) · 13.4 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
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
319
320
321
322
323
324
325
326
327
328
329
<?php include("includes/dbconfig.php"); ?>
<?php
if(isset($_POST['studentform']))
{
$email = $_POST['email'];
$password = $_POST['password'];
$query = "SELECT * FROM students where email='$email' and password='$password'";
$statement = $conn->prepare($query);
$statement->execute();
$result = $statement->fetch(PDO::FETCH_OBJ);
// print_r($result);
if($result){
$_SESSION['user'] = "student";
$_SESSION['user_id'] = $result->id;
$_SESSION['status'] = 1;
header("Location: myprofile.php");
exit;
}else
{
$_SESSION['status'] = 0;
}
}
if(isset($_POST['facultyform']))
{
$email = $_POST['email'];
$password = $_POST['password'];
$query = "SELECT * FROM faculty where email='$email' and password='$password'";
$statement = $conn->prepare($query);
$statement->execute();
$result = $statement->fetch(PDO::FETCH_OBJ);
if($result){
$_SESSION['user'] = "faculty";
$_SESSION['user_id'] = $result->id;
$_SESSION['status'] = 1;
header("Location: students.php");
exit;
}else
{
$_SESSION['status'] = 0;
}
}
$query1 = "SELECT * FROM news order by id desc";
$statement1 = $conn->prepare($query1);
$statement1->execute();
$statement1->setFetchMode(PDO::FETCH_OBJ);
$newsresult = $statement1->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Hostel Control Management</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/style.css?v=1">
<link rel="stylesheet" type="text/css" href="assets/css/responsive.css?v=1">
<link rel="stylesheet" href="assets/css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css"
media="screen">
<link rel="icon" type="image/x-icon" href="assets/images/hostel.png">
<style>
label {
font-size:20px;
}
.book_now span {
font-size: 20px;
}
#facultyForm {
display: none;
}
.first-slide {
width: 100%;
height: 600px;
}
@media (max-width: 760px) {
.GP-logo {
display: none;
}
.first-slide {
height: 1050px;
}
#signin,
#news {
box-sizing: border-box;
min-width: 320px;
}
.banner_main {
overflow-x: auto;
height: 500px;
}
.carousel-inner {
overflow: hidden;
height: 1050px;
}
.booking_online {
}
}
@media only screen and (max-width: 600px) {
body {
overflow-x: hidden;
}
}
@media (max-width : 500px) {
#banner {
display: block;
width: 100%;
}
}
@media (max-width : 500px) {
#homeimg {
display: block;
width: 100%;
height: 802px;
}
}
</style>
</head>
<body class="main-layout" style="overflow-x: hidden;">
<div class="loader_bg">
<div class="loader">
<img src="assets/images/loading.gif" alt="#" />
</div>
</div>
<?php include("includes/header.php"); ?>
<div class="back_re">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="title">
<h2>Hostel Control System</h2>
</div>
</div>
</div>
</div>
</div>
<section class="banner_main">
<div id="carouselExample" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="first-slide" id="banner1" src="assets/images/image2.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image1.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image3.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image4.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image5.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image6.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="first-slide" id="banner2" src="assets/images/image7.jpg" alt="First slide">
</div>
<div class="booking_online">
<div class="container">
<div class="row">
<div class="col-md-12">
<?php
if(isset($_SESSION['status']))
{
if($_SESSION['status'] == 1){
?>
<label class="alert alert-success" style="width:100%">Login <?php if(isset($_SESSION['user'])){ echo $_SESSION['user']; } ?> successfully!</label>
<?php
}else if($_SESSION['status'] == 2){
?>
<label class="alert alert-warning" style="width:100%"><?php if(isset($_SESSION['user'])){ echo $_SESSION['user']; } ?> email id already exist!</label>
<?php
}else if($_SESSION['status'] == 0){
?>
<label class="alert alert-danger" style="width:100%">Email Id / Password invalid!</label>
<?php
}else{
}
$_SESSION['status'] = "";
}
?>
</div>
<div class="col-md-5">
<div class="book_room" id="news" style="margin-bottom: 20px;">
<h1>News & Update</h1>
<marquee id="newsMarquee" class="marque" behavior="scroll" direction="up" scrollamount="5" style="overflow: hidden; height: 330px;">
<?php
if($newsresult) {
foreach($newsresult as $row)
{
?>
<h2><?=$row->title?></h2>
<img src="assets/images/new.gif" width="30px">
<h3><?=$row->description?></h3>
<a href="<?=$row->pdf_file?>" target="_blank">Download PDF</a>
<br><br>
<?php } }?>
</marquee>
</div>
</div>
<div class="col-md-5">
<div class="book_room" id="signin">
<h1>Sign In</h1>
<label> <input type="radio" name="registrationType" id="studentRadio" checked> Student </label>
<label> <input type="radio" name="registrationType" id="facultyRadio"> Faculty </label>
<form class="book_now" id="studentForm" action="" method="post">
<div class="row">
<div class="col-md-12">
<span>Email :</span>
<input class="online_book" placeholder="abc@gmail.com" type="email" required name="email">
</div>
<br>
<div class="col-md-12">
<span>Password : </span>
<input class="online_book" placeholder="********" type="password" required name="password" style="margin-bottom: 0px;">
<div class="col-md-12" style="font-size:15px;">
<a href="forgetpassword.php" style="color: blue;">Forget Password? </a>
</div>
</div>
<div class="col-md-12">
<button class="book_btn" name="studentform">Sign In</button>
</div>
<div class="col-md-12" style="text-align:center;font-size:20px;">
<a href="registration.php" style="color: black;">Don't have account? Register here </a>
</div>
</div>
</form>
<form class="book_now" id="facultyForm" method="post">
<div class="row">
<div class="col-md-12">
<span>Email :</span>
<input class="online_book" placeholder="abc@gmail.com" type="email" name="email">
</div>
<br>
<div class="col-md-12">
<span>Password : </span>
<input class="online_book" placeholder="********" type="password" name="password">
</div>
<div class="col-md-12">
<button class="book_btn" name="facultyform">Sign In</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include("includes/footer.php"); ?>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/jquery-3.0.0.min.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="assets/js/custom.js"></script>
<script>
document.getElementById('facultyRadio').addEventListener('change', function () {
document.getElementById('studentForm').style.display = 'none';
document.getElementById('facultyForm').style.display = 'block';
});
document.getElementById('studentRadio').addEventListener('change', function () {
document.getElementById('studentForm').style.display = 'block';
document.getElementById('facultyForm').style.display = 'none';
});
$(document).ready(function () {
$('#carouselExample').carousel({
interval: 2000
});
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var newsMarquee = document.getElementById('newsMarquee');
// Function to pause the marquee
function pauseMarquee() {
newsMarquee.stop();
}
// Function to resume the marquee
function resumeMarquee() {
newsMarquee.start();
}
// Add event listeners for mouseover and mouseout
document.getElementById('news').addEventListener('mouseover', pauseMarquee);
document.getElementById('news').addEventListener('mouseout', resumeMarquee);
});
</script>
</body>
</html>