-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
90 lines (80 loc) · 2.69 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
<?php
include('driver/config.php');
session_start();
if(isset($_POST['sign'])){
$pwd = $_POST['password'];
$username = $_POST['username'];
$check = mysqli_query($db,"select * from login where userid = '$username'");
if(mysqli_num_rows($check) > 0){
$login = mysqli_fetch_array($check, MYSQLI_ASSOC);
if($login['password']==$pwd){
$_SESSION['logged'] = 1;
$_SESSION['userid'] = $username;
$_SESSION['role'] = $login['role'];
header('location:home.php');
}
else{
$error = "Invalid Password!";
}
}
else{
$error = "Invalid Login Credentials!";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HOSPITAL - Login Page</title>
<style>
a{
text-decoration:none;
}
</style>
</head>
<body style="margin-top:0px;">
<table align="center" width="70%" height="600" border="1" style="border-collapse:collapse; border-style:solid;">
<tr>
<td width="30%" height="100"><img height="100%" width="100%" src="images/download.jpg" ></td>
<td height="80" colspan="2" align="center" bgcolor="black">
<h2 style="color:#ffF;">X-RAY FILMS DIGITALIZATION SYSTEM</h2>
</td>
</tr>
<tr style="border: 0px;">
<td colspan="3" height="20%" style="border-top: 0px; border-bottom: 0px;"><br><br><br> </td>
</tr>
<tr>
<td height="50%" colspan="3" align="center" style="border-top: 0px; border-bottom: 0px;">
<font face="Georgia, Times New Roman, Times, serif"><strong>Staff Login</strong></font>
<br /><br />
<form method="post">
<table style="border-radius:10px; background-color:#000; " align="center" width="51%">
<tr>
<td colspan="2" align="center" style="color:#F00;"><strong><?php echo $error!=""?$error:"" ?></strong></td>
</tr>
<tr>
<td><strong style="color:#FFF;">USERNAME</strong></td>
<td><input type="text" name="username" required oninvalid="setCustomValidity('Pls Enter Username! ')"
onchange="try{setCustomValidity('')}catch(e){}" /></td>
</tr>
<tr>
<td><strong style="color:#FFF;">PASSWORD</strong></td>
<td><input type="password" name="password" required oninvalid="setCustomValidity('Pls Enter Password! ')"
onchange="try{setCustomValidity('')}catch(e){}" /></td>
</tr>
<tr>
<td colspan="2" align="center"><br><input type="submit" value="SIGN IN" name="sign" ></td>
</tr>
</table>
</form>
</td>
</tr>
<tr style="border: 0px;">
<td colspan="3" height="130" style="border-top: 0px; border-bottom: 0px;"><br><br><br> </td>
</tr>
</table>
<center><br /><font color="#000000" size="+1" face="Georgia, Times New Roman, Times, serif">© Hulugh 2015</font>
</center>
</body>
</html>