-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
212 lines (170 loc) · 8.91 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
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
<?php
session_start();
//error_reporting(0);
include('doctor/includes/dbconnection.php');
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$mobnum=$_POST['phone'];
$email=$_POST['email'];
$appdate=$_POST['date'];
$aaptime=$_POST['time'];
$specialization=$_POST['specialization'];
$doctorlist=$_POST['doctorlist'];
$message=$_POST['message'];
$aptnumber=mt_rand(100000000, 999999999);
$cdate=date('Y-m-d');
if($appdate<=$cdate){
echo '<script>alert("Appointment date must be greater than todays date")</script>';
} else {
$sql="insert into tblappointment(AppointmentNumber,Name,MobileNumber,Email,AppointmentDate,AppointmentTime,Specialization,Doctor,Message)values(:aptnumber,:name,:mobnum,:email,:appdate,:aaptime,:specialization,:doctorlist,:message)";
$query=$dbh->prepare($sql);
$query->bindParam(':aptnumber',$aptnumber,PDO::PARAM_STR);
$query->bindParam(':name',$name,PDO::PARAM_STR);
$query->bindParam(':mobnum',$mobnum,PDO::PARAM_STR);
$query->bindParam(':email',$email,PDO::PARAM_STR);
$query->bindParam(':appdate',$appdate,PDO::PARAM_STR);
$query->bindParam(':aaptime',$aaptime,PDO::PARAM_STR);
$query->bindParam(':specialization',$specialization,PDO::PARAM_STR);
$query->bindParam(':doctorlist',$doctorlist,PDO::PARAM_STR);
$query->bindParam(':message',$message,PDO::PARAM_STR);
$query->execute();
$LastInsertId=$dbh->lastInsertId();
if ($LastInsertId>0) {
echo '<script>alert("Your Appointment Request Has Been Send. We Will Contact You Soon")</script>';
echo "<script>window.location.href ='index.php'</script>";
}
else
{
echo '<script>alert("Something Went Wrong. Please try again")</script>';
}
}
}
?>
<!doctype html>
<html lang="en">
<head>
<title>GetDoc || Home Page</title>
<!-- CSS FILES -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-icons.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<script>
function getdoctors(val) {
// alert(val);
$.ajax({
type: "POST",
url: "get_doctors.php",
data:'sp_id='+val,
success: function(data){
$("#doctorlist").html(data);
}
});
}
</script>
</head>
<body id="top">
<main>
<?php include_once('includes/header.php');?>
<section class="hero" id="hero">
<div class="container">
<div class="row">
<div class="col-12">
<div id="myCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images\slider\medical2.jpg" class="img-fluid" alt="">
</div>
<div class="carousel-item">
<img src="images/slider/young-asian-female-dentist-white-coat-posing-clinic-equipment.jpg" class="img-fluid" alt="">
</div>
<div class="carousel-item">
<img src="images/slider/medical1.jpg" class="img-fluid" alt="">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="section-padding" id="about">
<div class="container">
<h2 class="mb-lg-3">About us</h2>
<p><div><font color=black face=\"arial, sans-serif\"><b>Welcome to GetDoc - Your Trusted Partner in Health Care! At GetDoc, we are committed to revolutionizing the way you access healthcare services. Our platform is designed to provide a seamless and convenient solution for managing your medical appointments, connecting with trusted healthcare professionals, and taking control of your health journey</b></font></div></p>
</div>
</section>
<section class="section-padding" id="booking">
<div class="container">
<div class="row">
<div class="col-lg-8 col-12 mx-auto">
<div class="booking-form">
<h2 class="text-center mb-lg-3 mb-2">Book an appointment</h2>
<form role="form" method="post">
<div class="row">
<div class="col-lg-6 col-12">
<input type="text" name="name" id="name" class="form-control" placeholder="Full name" required='true'>
</div>
<div class="col-lg-6 col-12">
<input type="email" name="email" id="email" pattern="[^ @]*@[^ @]*" class="form-control" placeholder="Email address" required='true'>
</div>
<div class="col-lg-6 col-12">
<input type="telephone" name="phone" id="phone" class="form-control" placeholder="Enter Phone Number" maxlength="10">
</div>
<div class="col-lg-6 col-12">
<input type="date" name="date" id="date" value="" class="form-control">
</div>
<div class="col-lg-6 col-12">
<select name="time" id="time" class="form-control">
<option value="">Select time slot</option>
<option value="09:00">9 AM</option>
<option value="10:00">10 AM</option>
<option value="11:00">11 AM</option>
<option value="12:00">12 PM</option>
<option value="13:00">1 PM</option>
<option value="14:00">2 PM</option>
<option value="15:00">3 PM</option>
</select>
</div>
<div class="col-lg-6 col-12">
<select onChange="getdoctors(this.value);" name="specialization" id="specialization" class="form-control" required>
<option value="">Select specialization</option>
<!--- Fetching States--->
<?php
$sql="SELECT * FROM tblspecialization";
$stmt=$dbh->query($sql);
$stmt->setFetchMode(PDO::FETCH_ASSOC);
while($row =$stmt->fetch()) {
?>
<option value="<?php echo $row['ID'];?>"><?php echo $row['Specialization'];?></option>
<?php }?>
</select>
</div>
<div class="col-lg-6 col-12">
<select name="doctorlist" id="doctorlist" class="form-control">
<option value="">Select Doctor</option>
</select>
</div>
<div class="col-12">
<textarea class="form-control" rows="5" id="message" name="message" placeholder="Additional Message"></textarea>
</div>
<div class="col-lg-3 col-md-4 col-6 mx-auto">
<button type="submit" class="form-control" name="submit" id="submit-button">Book Now</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</main>
<?php include_once('includes/footer.php');?>
<!-- JAVASCRIPT FILES -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/scrollspy.min.js"></script>
</body>
</html>