-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd_doctor.php
443 lines (362 loc) · 19.7 KB
/
add_doctor.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<?php
include("assets/modules/global_module.php");
include("assets/modules/theme.php");
check_token("admin");
$name = $_SESSION["admin_token"];
if(isset($_GET["id"]))
{
$id = $_GET["id"];
}
if(isset($_COOKIE["alert_true"]))
{
$alert_success = $_COOKIE["alert_true"];
setcookie("alert_true","",time()-10);
}
if(isset($_COOKIE["alert_false"]))
{
$alert_danger = $_COOKIE["alert_false"];
setcookie("alert_false","",time()-10);
}
elseif(isset($_SESSION["admin_token"]))
{
$id = $_SESSION["admin_token"];
}
$result = fetch_data("select * from admin where admin_id= '$id'","result");
$data = mysqli_fetch_assoc($result);
$result_d = fetch_data("select designation_name from designation","result");
if($_POST)
{
$doctor_id = key_engine("doctor");
$d_name = $_POST["d_name"];
$dr_dob = $_POST["dr_dob"];
$d_gender = $_POST["d_gender"];
$d_phone = $_POST["d_phone"];
$d_city = $_POST["d_city"];
$d_address = $_POST["d_address"];
$d_designation = $_POST["d_designation"];
$d_email = $_POST["d_email"];
$d_password = $_POST["d_password"];
if($doctor_id == "")
{
$alert_danger = "Enter Id";
}
elseif($d_name == "")
{
$alert_danger = "Enter Name";
}
elseif($dr_dob == "")
{
$alert_danger = "Enter DOB";
}
elseif($d_gender == "--Select--")
{
$alert_danger = "Select Gender";
}
elseif($d_phone == "")
{
$alert_danger = "Enter Phone Number";
}
elseif($d_city == "--Select City--")
{
$alert_danger = "Select City";
}
elseif($d_address == "")
{
$alert_danger = "Enter Address";
}
elseif($d_email == "")
{
$alert_danger = "Enter Email";
}
elseif($d_password == "")
{
$alert_danger = "Enter Password";
}
elseif($d_designation == "--Select Designation--")
{
$alert_danger = "Enter Designation";
}
else
{
$d_old = explode("-",$dr_dob);
$d_dob = $d_old[0]."-".$d_old[1]."-".$d_old[2];
$slot = key_engine("slot");
if(add_doctor($doctor_id,"insert into doctor(doctor_id,doctor_name,doctor_gender,doctor_email,doctor_phone,doctor_dob,doctor_city,doctor_address,doctor_password,doctor_designation,slot_id)
values('$doctor_id','$d_name','$d_gender','$d_email','$d_phone','$d_dob','$d_city','$d_address','$d_password','$d_designation','$slot')"))
{
header("LOCATION:add_doctor.php?msg_t='Doctor Added'");
}
else
{
$alert_danger = "Doctor Not Added";
}
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="assets/img/HMS.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Dashboard - Add Doctor</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<!-- Animation library for notifications -->
<link href="assets/css/animate.min.css" rel="stylesheet"/>
<!-- Light Bootstrap Table core CSS -->
<link href="assets/css/light-bootstrap-dashboard.css?v=1.4.0" rel="stylesheet"/>
<!-- Fonts and icons -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<link href="assets/css/pe-icon-7-stroke.css" rel="stylesheet" />
<link href="assets/css/demo.css" rel="stylesheet" />
<link href="assets/css/material-bootstrap-wizard.css" rel="stylesheet" />
</head>
<body>
<div class="wrapper">
<?php menu($data["admin_name"],"doctor","add_doctor"); ?>
<div class="main-panel">
<nav class="navbar navbar-default navbar-fixed">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-example-2">
<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="#">Dashboard<i class="pe-7s-angle-right"></i>Add Doctor</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="logout.php?for=<?php echo $data["admin_id"] ?>">
<p>Log out</p>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Big container -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<!-- Wizard container -->
<div class="wizard-container">
<div class="card wizard-card" data-color="<?php theme("class_moving_tab"); ?>" id="wizardProfile">
<form name="add_patient" method="POST">
<!-- You can switch " data-color="purple" " with one of the next bright colors: "green", "orange", "red", "blue" -->
<div class="wizard-header">
<h3 class="wizard-title">
Add Doctor
</h3>
<br>
<div class="container-fluid text-center" id="alert_box" >
<?php
if(isset($alert_success))
{
echo "<div class='container-fluid'><div class='alert alert-success' style='color:black' id='alert_body'>
<div class='container-fluid'>
<div class='alert-icon'>
<i class='material-icons'>done_all</i>
</div>
<h4>$alert_success</h4>
</div>
</div></div>";
}
else
{
echo "";
}
if(isset($alert_danger))
{
echo "<div class='alert alert-danger' id='alert_body'>
<div class='container-fluid'>
<div class='alert-icon pull-left'>
<i class='material-icons'>error_outline</i>
</div>
<h4> $alert_danger </h4>
</div>
</div>";
}
else
{
echo "";
}
?>
</div>
</div>
<div class="wizard-navigation">
<ul>
<li><a href="#about" data-toggle="tab">Details</a></li>
<li><a href="#account" data-toggle="tab">Login</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane" id="about">
<div class="container-fluid">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">vpn_key</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Docotr's Id</label>
<input type="text" name="doctor_id" value="<?php echo key_engine("doctor"); ?>" class="form-control" readonly>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">account_circle</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Doctor's Name</label>
<input type="text" name="d_name" value="<?php if(isset($d_name)){ echo $d_name; }?>" class="form-control">
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">today</i>
</span>
<div class="form-group label-floating">
<input type="date" name="dr_dob" value="<?php if(isset($dr_dob)){ echo $dr_dob; }?>" class="datepicker form-control" placeholder="Enter Birthdate" />
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">accessibility</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Gender</label>
<select name="d_gender" class="form-control">
<option>--Select--</option>
<option <?php if(isset($d_gender)){ if($d_gender == "Male"){echo "selected=true";}}?> >Male</option>
<option <?php if(isset($d_gender)){ if($d_gender == "Female"){echo "selected=true";}}?> >Female</option>
</select>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">call</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Doctor's Phone</label>
<input type="text" name="d_phone" value="<?php if(isset($d_phone)){ echo $d_phone; }?>" class="form-control">
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">place</i>
</span>
<div class="form-group label-floating">
<label class="control-label">city</label>
<input type="text" name="d_city" value="<?php if(isset($d_city)){ echo $d_city; }?>" class="form-control">
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">my_location</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Adress</label>
<input type="text" name="d_address" value="<?php if(isset($d_address)){ echo $d_address; }?>" class="form-control">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="account">
<div class="container-fluid">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">school</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Designation</label>
<select name="d_designation" class="form-control">
<option>--Select Designation--</option>
<?php
if($result_d)
{
while($row_d = mysqli_fetch_array($result_d)) {
echo "<option>".$row_d["designation_name"]."</option>";
}
}
?>
</select>
</div>
</div>
<div class="input-group ">
<span class="input-group-addon">
<i class="material-icons">email</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Doctor's Email</label>
<input type="email" name="d_email" value="<?php if(isset($d_email)){ echo $d_email; }?>" class="form-control">
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock_outline</i>
</span>
<div class="form-group label-floating">
<label class="control-label">Password</label>
<input type="text" name="d_password" value="<?php if(isset($d_password)){ echo $d_password; }?>" class="form-control" />
</div>
</div>
</div>
</div>
</div>
<div class="wizard-footer">
<div class="pull-right">
<input type='' class='btn btn-next btn-fill ' name='next' value='Next' id="<?php theme("id_btn"); ?>"/>
<input type='submit' class='btn btn-finish btn-fill btn-success btn-wd ' value='Add' id="<?php theme("id_btn"); ?>" />
</div>
<div class="pull-left">
<input type='button' class='btn btn-previous btn-fill btn-default btn-wd' name='previous' value='Previous' />
</div>
<div class="clearfix"></div>
</div>
</form>
</div>
</div> <!-- wizard container -->
</div>
</div><!-- end row -->
</div> <!-- big container -->
</div>
</div>
</body>
<!-- Core JS Files -->
<script src="assets/js/jquery.3.2.1.min.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/js/jquery.bootstrap.js" type="text/javascript"></script>
<script src="assets/js/jquery.validate.min.js"></script>
<script src="assets/js/material-bootstrap-wizard.js"></script>
<!-- Autohide Alet -->
<script src="assets/js/alert_autohide.js"></script>
<!-- Charts Plugin -->
<script src="assets/js/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="assets/js/bootstrap-notify.js"></script>
<!-- Google Maps Plugin -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
<!-- Light Bootstrap Table Core javascript and methods for Demo purpose -->
<script src="assets/js/light-bootstrap-dashboard.js?v=1.4.0"></script>
<!-- Drop down javascript -->
<script src="assets/js/dropdown.js"></script>
<script type="text/javascript">
$(document).ready(function(){
demo.initChartist();
$.notify({
icon: 'pe-7s-gift',
message: "Welcome to <b>Rudani Hospital</b> <br> Your Health Companion on-the-go."
},{
type: 'info',
timer: 4000
});
});
</script>
</html>