-
Notifications
You must be signed in to change notification settings - Fork 0
/
appointment.php
268 lines (234 loc) · 9.32 KB
/
appointment.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
<?php
$yourEmail = 'tushar02614902014@msi-ggsip.com';
if(isset($_POST['submitted'])) {
if($_POST['fname'] === '') {
$hasError = true;
} else {
$fname = $_POST['fname'];
}
if($_POST['lname'] === '') {
$hasError = true;
} else {
$lname = $_POST['lname'];
}
if($_POST['email'] === '') {
$hasError = true;
} else if (!preg_match("/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i", $_POST['email'])) {
$hasError = true;
} else {
$email = $_POST['email'];
}
if($_POST['selection'] === '') {
$hasError = true;
} else {
$selection = $_POST['selection'];
}
if($_POST['work'] === '') {
$hasError = true;
} else {
$work = $_POST['work'];
}
if(!isset($hasError)) {
$emailTo = $yourEmail;
$subject = "Message From Your Website";
$body = "Name: $fname $lname \n\nEmail: $email";
$headers = 'From : my site <'.$emailTo.'>' . "\r\n" . 'answer to : ' . $email;
mail($emailTo, $subject, $body, $headers);
$subject = "HealthCare.com Team";
$body = "Dear user,\n\nThank you for requesting an appointment at www.HealthCare.com. We have received your request to book appointment for $selection department at $work and you will get an SMS as soon as your appointment gets confirmed.\n\nBest regards\nwww.HealthCare.com\nTel: +91-9958250076";
mail($email, $subject, $body);
$emailSent = true;
$servername="localhost";
$username="root";
$dbname="healthdb";
try {
$conn=new PDO("mysql:host=$servername;dbname=$dbname",$username);
$conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$SQL="INSERT INTO `healthtable` (`FName`,`LName`,`Email`,`Department`,`Time_Slot`) VALUES('$fname','$lname','$email','$selection','$work')";
$conn->exec($SQL);
}
catch(PDOException $e)
{
echo $SQL."<br>".$e->getMessage();
}
$conn=null;
}
}
?>
<html>
<head>
<title>HEALTHCARE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
.image{ position:absolute;
left:60%;
opacity:0.7;
}
</style>
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //Custom Theme files -->
<link href="css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="css/style.css" type="text/css" rel="stylesheet" media="all">
<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- //js -->
<!-- start-smooth-scrolling-->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
<!--//end-smooth-scrolling-->
</head>
<body>
<div class="bg-primary"><h1 class="col-lg-offset-5">HealthCare</h1></div>
<br></br>
<!-- NAVIGATION BAR-->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" >
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">HEALTHCARE</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li><a href="index.html">HOME<span class="sr-only">(current)</span></a></li>
<li><a href="aboutus.html">ABOUT US</a></li>
<li><a href="services.html">SERVICES</a></li>
<li class="active"><a href="appointment.html">MAKE AN APPOINTMENT</a></li>
<li><a href="donate.html">DONATE MEDICINE</a></li>
<ul class="nav navbar-nav navbar-left">
<li><a href="contactus.html">CONTACT US</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="bg-primary"><h1 class="col-lg-offset-4">MAKE AN APPOINTMENT</h1></div>
<br></br>
<div class="image">
<img src="images/healthcare.jpg" class="img-responsive" width="95%" height="70%">
</div>
<!-- forms -->
<form class="form-horizontal" method=post action="appointment.php">
<div class="form-group">
<label class="control-label col-sm-2" for="fname">First Name:</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="fname" placeholder="Enter first name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="lname">Last Name:</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="lname" placeholder="Enter last name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="age">Age:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="age" placeholder="Enter age" required>
</div>
</div>
<div class="form-group">
<label for="Gender" class="control-label col-sm-2">Gender:</label>
<label class="control-label col-sm-1">
<input type="radio" name="gender" id="m" value="male" checked>Male
</label>
<label class="control-label col-sm-1">
<input type="radio" name="gender" id="f" value="female">Female
</label>
</div>
<div class="form-group">
<label for="selection" class="control-label col-sm-2">Select department:</label>
<select class="form-label" name="selection">
<option>Cardiology</option>
<option>Dermatology</option>
<option>Gynecology</option>
<option>Plastic Surgery</option>
<option>Urology</option>
</select>
<br></br>
<div class="form-group">
<label for="timeslot" class="control-label col-sm-2">Time slot:</label>
<div class="col-sm-5">
<label class="control-label">
<input type="radio" name="work" id="time1" value="09:30-10:00" checked>09:30-10:00
</label>
<label class="control-label">
<input type="radio" name="work" id="time2" value="10:00-10:30">10:00-10:30
</label>
<label class="control-label">
<input type="radio" name="work" id="time3" value="10:30-11:00">10:30-11:00
</label>
<label class="control-label">
<input type="radio" name="work" id="time4" value="11:00-11:30">11:00-11:30
</label>
<label class="control-label">
<input type="radio" name="work" id="time5" value="11:30-12:00">11:30-12:00
</label>
<label class="control-label">
<input type="radio" name="work" id="time6" value="12:00-12:30">12:00-12:30
</label>
<label class="control-label">
<input type="radio" name="work" id="time7" value="12:30-13:00">12:30-13:00
</label>
<label class="control-label">
<input type="radio" name="work" id="time8" value="13:00-13:30">13:00-13:30
</label>
<label class="control-label">
<input type="radio" name="work" id="time9" value="14:30-15:00">14:30-15:00
</label>
<label class="control-label">
<input type="radio" name="work" id="time10" value="15:00-15:30">15:00-15:30
</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-5">
<input type="email" class="form-control" name="email" placeholder="Enter email" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="contact">Contact no.:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="contact" placeholder="Enter contact number" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" name=submitted class="btn btn-default">Submit</button>
<button type="reset" class="btn btn-default">Reset</button>
</div>
</div>
</form>
<script src="js/bootstrap.js"></script>
<div class="copy-right">
<div class="container">
<ul>
<li><a target=_new href="https://www.facebook.com/groups/1644758912264671/about/"></a></li>
<li><a target=_new href="https://plus.google.com/communities/101359307994708157958" class="gg"></a></li>
<li><a target=_new href="https://twitter.com/HealthCareGov" class="twt"></a></li>
</ul>
<div class="clearfix"> </div>
<p>© 2018 HealthCare</p>
</div>
</div>
</body>
</html>