-
Notifications
You must be signed in to change notification settings - Fork 93
/
cover.php
124 lines (106 loc) · 4.19 KB
/
cover.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
<!DOCTYPE html>
<html>
<body style="background-image:url(images/p2.jpg)">
<link rel="stylesheet" href="main.css">
<div class="header">
<ul>
<li style="float:left;border-right:none"><a href="cover.php" class="logo"><img src="images/cal.png" width="30px" height="30px"><strong> Skylabs </strong>Appointment Booking System</a></li>
<li><a href="locateus.php">Locate Us</a></li>
<li><a href="#home">Home</a></li>
</ul>
</div>
<div class="center">
<h1>Skylabs</h1><br>
<p style="text-align:center;color:black;font-size:30px;top:35%">Online Appointment Booking System</p><br>
<button onclick="document.getElementById('id01').style.display='block'" style="position:absolute;top:50%;left:50%">Login</button>
</div>
<div class="footer">
<ul style="position:absolute;top:93%;background-color:black">
<li><a href="admin/alogin.php">Admin Login</a></li>
<li><a href="admin/mlogin.php">Manager Login</a></li>
</ul>
</div>
<div id="id01" class="modal">
<form class="modal-content animate" method="post" action="cover.php">
<div class="imgcontainer">
<span style="float:left"><h2>    Log In</h2></span>
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="container">
<label><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit" name="login">Login</button>
<input type="checkbox" checked="checked"> Remember me
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
<button onclick="document.getElementById('id02').style.display='block';document.getElementById('id01').style.display='none'" style="float:right">Don't have one?</button>
</div>
</form>
</div>
<div id="id02" class="modal">
<form class="modal-content animate" action="signup.php" method="post">
<div class="imgcontainer">
<span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">×</span><br>
</div>
<div class="imgcontainer">
<img src="images/steps.png" alt="Avatar" class="avatar">
</div>
<div class="container">
<p style="text-align:center;font-size:18px;"><b>Sign Up -> Choose your Dates -> Book your visit</b></p>
<p style="text-align:center"><b>Booking an appointment has never been easier!</b></p>
<p style="text-align:center"><b>The 3 steps for an easier and healthy life</b></p>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" onclick="document.getElementById('id02').style.display='none'" class="cancelbtn">Cancel</button>
<button type="submit" name="signup" style="float:right">Sign Up</button>
</div>
</form>
</div>
<script>
// Get the modal
var modal = document.getElementById('id01');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
window.onclick = function(event) {
if (event.target == modal1) {
modal1.style.display = "none";
}
}
</script>
<?php
session_start();
$error='';
if (isset($_POST['login'])) {
if (empty($_POST['uname']) || empty($_POST['psw'])) {
$error = "Username or Password is invalid";
}
else
{
include 'dbconfig.php';
$username=$_POST['uname'];
$password=$_POST['psw'];
$query = mysqli_query($conn,"select * from patient where password='$password' AND username='$username'");
$rows = mysqli_fetch_assoc($query);
$num=mysqli_num_rows($query);
if ($num == 1) {
$_SESSION['username']=$rows['username'];
$_SESSION['user']=$rows['name'];
header( "Refresh:1; url=ulogin.php");
}
else
{
$error = "Username or Password is invalid";
}
mysqli_close($conn);
}
}
?>
</body>
</html>