-
Notifications
You must be signed in to change notification settings - Fork 0
/
appo.php
148 lines (99 loc) · 2.73 KB
/
appo.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html>
<head>
<title>Cure All</title>
<meta charset="utf-8">
<link href="layout.css" rel="stylesheet" type="text/css" media="all">
</head>
<body id="top">
<div class="wrapper row1">
<header id="header" class="clear">
<div id="logo" class="fl_left">
<h1><a href="index.html">Cure all</a></h1>
</div>
</header>
</div>
<div class="wrapper row2">
<nav id="mainav" class="clear">
<ul class="clear">
<li class="button"><a href="index.html">Home</a></li>
<li class ="button"><a href="Emed.php">E-Medicine</a></li>
<li class ="button"><a href="Doctors.php">Doctors</a></li>
<li class ="active"><a href="LOGIN.php"> LOGIN</a></li>
</ul>
</nav>
</div>
<div class="wrapper row3">
<main class="container clear">
<h1>Appoinment</h1>
<form action="" method="post">
<p>
Username or id:<input type="text" name="user"></p>
<label>time:</label><select name="select">
<option value="non"> Select</option>
<option value="1">10:00 - 10:30</option>
<option value="2">10:30 - 11:00</option>
<option value="3">11:00 - 11:30</option>
<option value="4">11:30 - 12:00</option>
<option value="5">12:00 - 12:30</option>
<option value="6">12:30 - 01:00</option>
<option value="7">04:00 - 04:30</option>
<option value="8">04:30 - 05:00</option>
<option value="9">05:00 - 05:30</option>
<option value="10">05:30 - 06:00</option>
<option value="11">06:00 - 06:30</option>
<option value="12">06:30 - 07:00</option>
</select>
<input type="submit" value="register" name="submit"><br/>
</form
<?php
if(isset($_POST["submit"]))
{
if(!empty($_POST['user']) )
{
$time = $_POST['select'];
$user = $_POST['user'];
//DB Connection
$conn= mysqli_connect('localhost','root','123456','cureall');
$query = mysqli_query($conn, "SELECT * FROM appo WHERE time='".$time."'");
$numrows = mysqli_num_rows($query);
if($numrows == 0)
{
$sql = "INSERT INTO appo(id,time) VALUES('$user','$time')";
$result = mysqli_query($conn, $sql);
if($result){
echo "Registered";
}
else
{
echo "time taken";
}
}
else
{
echo "select other time";
}
}
else
{
?>
<!--Javascript Alert -->
<script>alert('Required all felds');</script>
<?php
}
}
?>
?>
</div>
<div class="wrapper row4">
<footer id="footer" class="clear">
<div class="row">
</footer>
</div>
</div>
<div class="wrapper row5">
<div id="copyright" class="clear">
<p class="fl_left">©Reserved by Avan avi</p>
</div>
</div>
</html>