forked from MohdVara/Hostel-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
106 lines (89 loc) · 2.92 KB
/
login.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
<?php
require_once'core/init.php';
if(Input::exists()){
if(Token::check(Input::get('token'))){
$displayerrors= '';
$validate = new Validate();
$validation = $validate->check($_POST,array(
'id' => array(
'required' => true
),
'password' => array(
'required' => true
),
));
if($validation->passed())
{
$user = new User();
$login = $user->login(Input::get('id'), Input::get('password'));
if($login){
Redirect::to('index.php');
}else{
Session::flash('error','Either id or password do not match');
}
}
else{
foreach($validation->errors() as $error){
$displayerror.= $error.'<br>';
}
Session::flash('error',$displayerror);
}
}
}
?>
<!DOCTYPE html>
<html manifest="MMC.appcache" lang="en">
<head>
<meta charset=utf-8">
<meta name="Description" content="Multimedia College Hostel Registration System is a system where students are able to apply for hostel room in seconds.">
<title>MMC Hostel Registration</title>
<link rel="stylesheet" type="text/css" href="css/hostelRegistration.css">
</head>
<body>
<!-- container -->
<div id="container">
<!-- header -->
<div id="header">
<img src="image/project header.jpg" min-width="100%" height="100" />
</div>
<!-- end of header -->
<!-- button -->
<div id="NavBar">
<ul>
<li><a href="room_list.php">Room List</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<!-- end of button -->
<!-- content -->
<div id="content">
<img src="image/projectContent2.jpg" width="717" height="500" />
</div>
<!-- end of content -->
<!-- sidebar -->
<div id="sidebar">
<p align="center"> <font size="+4"> Sign In </font> </p>
<?php
if(Session::exists('error'))
{
echo '<hr color="#666666"/>';
echo '<p align="center">'.Session::flash('error').'</p>';
}
?>
<hr color="#666666"/>
<p align="center">Please insert your id <br /> and password :</p>
<form action method="post" name="logInForm">
<table>
<tr align="center"><td align="right"> ID :</td><td align="left"> <input name="id" type="text" /> </td> </tr>
<tr align="center"><td align="right">Password :</td><td align="left"> <input name="password" type="password" /> <td> </tr>
</table>
<p align="center"> <input name="submit" type="submit" value="Submit" /> <input type="hidden" name="token" value="<?php echo Token::generate();?>">
<input type="button" value="Register" onClick="window.location.href='registrationform.php'"/> </p>
</form>
<p align="center"> Please make sure you follow all <br /> regulations fixed by management and <br /> make sure you pay fees before <br /> date fixed. </p>
</div>
<!-- end of sidebar -->
</div>
<!-- end of container --?
</body>
</html>