-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
80 lines (72 loc) · 2.57 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
<?php
session_start();
?>
<link href="bootstrap.min.css" rel="stylesheet">
<?php
include("header.php");
include("library.php");
noAccessIfLoggedIn();
?>
<div class="container">
<h1>Welcome to Projectworlds Hospital Management System</h1>
<p class="block-quote">Our aim has always been to bring world–class medical care within the reach of common man.</p>
<p><?php include('slideshow.php');?></p>
<?php
if(isset($_POST['lemail'])){
$i = login($_POST['lemail'],$_POST['lpassword'],"users");
if($i==1){
echo '<script type="text/javascript"> window.location = "add_patient.php" </script>';
}
}else if(isset($_POST['remail'])){
$i = register($_POST['remail'],$_POST['rpassword'],$_POST['rfullname'],"users");
if($i==1){
echo '<script type="text/javascript"> window.location = "add_patient.php"</script>';
}
}else{
echo "<div class='alert alert-info'>
<strong>Info!</strong> Login or Register to be able to book your appointment.</div>";
}
unset($_POST);
?>
<div class="row">
<div class="col col-xl-6 col-sm-6">
<h2>Login</h2>
<form action="index.php" method="POST">
<div class="form-group">
<label for="usr">Email:</label>
<input type="email" class="form-control" name="lemail" required>
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" name="lpassword" required>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Login">
<input type="reset" class="btn btn-danger">
</div>
</form>
</div>
<div class="col col-xl-6 col-sm-6" id="register1">
<form method="post" action="index.php">
<h2>Registration</h2>
<div class="form-group">
<label for="usr">Full Name:</label>
<input type="text" class="form-control" name="rfullname" required>
</div>
<div class="form-group">
<label for="usr">Email:</label>
<input type="email" class="form-control" name="remail" required>
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" name="rpassword" required>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary">
<input type="reset" class="btn btn-danger"></button>
</div>
</form>
</div>
</div>
</div>
<?php include("footer.php"); ?>