-
Notifications
You must be signed in to change notification settings - Fork 0
/
prescribe.php
161 lines (131 loc) · 6 KB
/
prescribe.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
<!DOCTYPE html>
<?php
include('func1.php');
$pid='';
$ID='';
$appdate='';
$apptime='';
$fname = '';
$lname= '';
$doctor = $_SESSION['dname'];
if(isset($_GET['pid']) && isset($_GET['ID']) && ($_GET['appdate']) && isset($_GET['apptime']) && isset($_GET['fname']) && isset($_GET['lname'])) {
$pid = $_GET['pid'];
$ID = $_GET['ID'];
$fname = $_GET['fname'];
$lname = $_GET['lname'];
$appdate = $_GET['appdate'];
$apptime = $_GET['apptime'];
}
if(isset($_POST['prescribe']) && isset($_POST['pid']) && isset($_POST['ID']) && isset($_POST['appdate']) && isset($_POST['apptime']) && isset($_POST['lname']) && isset($_POST['fname'])){
$appdate = $_POST['appdate'];
$apptime = $_POST['apptime'];
$disease = $_POST['disease'];
$allergy = $_POST['allergy'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$pid = $_POST['pid'];
$ID = $_POST['ID'];
$prescription = $_POST['prescription'];
$query=mysqli_query($con,"insert into prestb(doctor,pid,ID,fname,lname,appdate,apptime,disease,allergy,prescription) values ('$doctor','$pid','$ID','$fname','$lname','$appdate','$apptime','$disease','$allergy','$prescription')");
if($query)
{
echo "<script>alert('Prescribed successfully!');</script>";
}
else{
echo "<script>alert('Unable to process your request. Try again!');</script>";
}
// else{
// echo "<script>alert('GET is not working!');</script>";
// }initial
// enga error?
}
?>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" />
<meta name="viewport" content="width=device-width, -scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="vendor/fontawesome/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<a class="navbar-brand" href="#"><i class="fa fa-hospital-o" aria-hidden="true"></i> Hospital Management System</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<style >
.bg-primary {
background: #F0F2F0; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #000C40, #F0F2F0); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #000C40, #F0F2F0); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.list-group-item.active {
z-index: 2;
color: #fff;
background-color: #342ac1;
border-color: #007bff;
}
.text-primary {
color: #342ac1!important;
}
.btn-primary{
background-color: #3c50c1;
border-color: #3c50c1;
}
</style>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="logout1.php"><i class="fa fa-power-off" aria-hidden="true"></i> Logout</a>
</li>
<li class="nav-item">
<a class="nav-link" href="doctor-panel.php"><i class="fa fa-sign-out" aria-hidden="true"></i>Back</a>
</li>
</ul>
</div>
</nav>
</head>
<style type="text/css">
button:hover{cursor:pointer;}
#inputbtn:hover{cursor:pointer;}
</style>
<body style="padding-top:50px;">
<div class="container-fluid" style="margin-top:50px;">
<h3 style = "margin-left: 40%; padding-bottom: 20px; font-family: 'IBM Plex Sans', sans-serif;"> Welcome  <?php echo $doctor ?>
</h3>
<div class="tab-pane" id="list-pres" role="tabpanel" aria-labelledby="list-pres-list">
<form class="form-group" name="prescribeform" method="post" action="prescribe.php">
<div class="row">
<div class="container">
<div class="form-group">
<label>Disease:</label>
<textarea id="disease" class="form-control" rows ="5" name="disease" required></textarea>
</div>
<div class="form-group">
<label>Allergies:</label>
<textarea id="allergy" class="form-control" rows ="5" name="allergy" required></textarea>
</div>
<div class="form-group">
<label>Prescription:</label>
<textarea id="prescription"class="form-control" rows ="5" name="prescription" required></textarea>
</div>
</div><br>
<input type="hidden" name="fname" value="<?php echo $fname ?>" />
<input type="hidden" name="lname" value="<?php echo $lname ?>" />
<input type="hidden" name="appdate" value="<?php echo $appdate ?>" />
<input type="hidden" name="apptime" value="<?php echo $apptime ?>" />
<input type="hidden" name="pid" value="<?php echo $pid ?>" />
<input type="hidden" name="ID" value="<?php echo $ID ?>" />
<br><br>
<input type="submit" name="prescribe" value="Prescribe" class="btn btn-primary" style="margin-left: 40pc;">
</div>
</div>
</form>
<br>
</div>
</div>