-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.php
274 lines (237 loc) · 6.99 KB
/
Application.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<?php
$link=mysqli_connect('localhost','root','');
mysqli_select_db($link,'testdb');
?>
<!DOCTYPE html>
<!-- saved from url=(0034)http://localhost/mysite/Home.html# -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Monotype Corosiva;
padding: 20px;
background: #F5B7B1 ;
}
/* Header/Blog Title */
.header {
padding: 40px;
font-size: 60px;
text-align: right;
background: #008080 url("https://i2.wp.com/hbgmedicalassistance.com/wp-content/uploads/2015/07/fortis-hospital-logo.jpg?w=700") no-repeat local top left;
}
/* Style the top navigation bar */
.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: red;
font-family: Arial, Helvetica, sans-serif;
}
/* Style the topnav links */
.topnav a {
display: block;
color: white;
text-align: center;
padding: 20px 16px;
text-decoration: none;
float: left;
}
/* Change color on hover */
.topnav a:hover {
background-color: #111;
}
/* Create two unequal columns that floats next to each other */
/* Left column */
.leftcolumn {
float: left;
width: 75%;
}
/* Right column */
.rightcolumn {
float: left;
width: 25%;
background-color: #f1f1f1;
padding-left: 20px;
}
/* Fake image */
.fakeimg {
width: 100%;
}
/* Add a card effect for articles */
.card {
background-color: #D1F2EB;
padding: 20px;
margin-top: 20px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Footer */
.footer {
padding: 20px;
text-align: center;
background: #ddd;
margin-top: 20px;
}
/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other */
@media (max-width: 800px) {
.leftcolumn, .rightcolumn {
width: 100%;
padding: 0;
}
}
/* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
@media (max-width: 400px) {
.topnav a {
float: none;
width:100%;
}
}
</style>
</head>
<script>
function validateForm() {
var x = document.forms["myForm"]["date"].value;
if (x == "") {
alert("Enter a valid Date");
return false;
}
var x = document.forms["myForm"]["time"].value;
if (x == "") {
alert("Enter a valid Time");
return false;
}
x = document.forms["myForm"]["reason"].value;
if (x == "") {
alert("Reason must be mentioned");
return false;
}
}
</script>
<script language="JavaScript">
function showInput() {
document.write("Appointment process successful...!!");
}
</script>
<body>
<div class="header">
<h2>APOLLO FORTIS</h2>
</div>
<div class="topnav">
<a href="http://localhost/mysite/patientHome.html">Home</a>
<a href="http://localhost/mysite/pHistory.html">History</a>
<a href="http://localhost/mysite/Application.php">Appointment</a>
<a href="http://localhost/mysite/pAchievements.html">Achievements</a>
<a href="http://localhost/mysite/logout.php" style="float:right">Logout</a>
</div>
<div class="container">
<form name="myForm" action="book.php" onsubmit="return validateForm()" method="post">
<div class="row">
<h2 style="text-align: center;">Book Health Check Appointment</h2>
</div>
<div class="row">
<p>Submit your details and we will call you</p>
</div>
<div class="row">
<div class="col-25">
<label style="float:left;width:100%" for="state">Patient ID</label>
<?php
session_start();
echo htmlspecialchars($_SESSION['username']);
?>
</div>
</div>
<?php
$query = $link->query("SELECT distinct deptname,deptid FROM department");
//Count total number of rows
$rowCount = $query->num_rows;
?>
<select style="float: left;width: 49%;padding: 10px" id="deptname" name="depname">
<option value="">Select Department</option>
<?php
if($rowCount > 0){
while($row = $query->fetch_assoc()){
echo '<option value="'.$row['deptid'].'">'.$row['deptname'].'</option>';
}
}else{
echo '<option value="">Dept not available</option>';
}
?>
</select>
<select style="float: right;width: 49%;padding: 10px" id="doctor" name="docname">
<option value="">Select Doctor</option>
</select>
<p id="time"></p>
<script type="text/javascript">
$(document).ready(function(){
$('#deptname').on('change',function(){
var countryID = $(this).val();
if(countryID){
$.ajax({
type:'POST',
url:'ajaxData.php',
data:'country_id='+countryID,
success:function(html){
$('#doctor').html(html);
}
});
}else{
$('#doctor').html('<option value="">Select country first</option>');
}
});
$('#doctor').on('change',function(){
var stateID = $(this).val();
var elem = document.getElementById("deptname");
var countryID = elem.options[elem.selectedIndex].value;
console.log(countryID);
if(stateID){
$.ajax({
type:'POST',
url:'ajaxData1.php',
data:'state_id='+stateID+'&country_id='+countryID,
success:function(html){
$('#time').html(html);
}
});
}
});
});
</script>
<div class="row">
<div class="col-25">
<label for="date">Appointment Date</label>
</div>
<div class="col-75">
<input style="width: 10%;margin-top: 6px;float:left;border-radius: 5px;padding: 5px;border: 1px solid #ccc;" type="date" id="date" name="date" placeholder="DD-MM-YYYY">
</div>
</div>
<div class="row">
<div class="col-25">
<label for="date">Appointment Time</label>
</div>
<div class="col-75">
<input style="width: 10%;margin-top: 6px;float:left;border-radius: 5px;padding: 5px;border: 1px solid #ccc;" type="time" id="time" name="time" placeholder="HH-MM-AM/PM">
</div>
</div>
<div class="row">
<div class="col-25">
<label for="reason">Reason</label>
</div>
<div class="col-75">
<textarea id="reason" name="reason" placeholder="Enter reason for Appointment" style="height:100px;width: 50%"></textarea>
</div>
</div>
<div class="row">
<input class="submit" name="submit" type="submit" onClick="validateForm();" value="Confirm" >
</div>
</form>
</div>
</body>
</html>