-
Notifications
You must be signed in to change notification settings - Fork 1
/
prescription.php
160 lines (135 loc) · 5.18 KB
/
prescription.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
<!DOCTYPE html>
<?php
include('session_doctor.php'); ?>
<html>
<head>
<meta charset="UTF-8">
<title>Healthcare</title>
<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/styles.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>
</head>
<body>
<nav class="navbar navbar-default" style="height:15px">
<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" aria-expanded="false">
<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>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Upload <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="prescription.php">Prescription</a></li>
<li role="separator" class="divider"></li>
<li><a href="test_upload.php">Test Request</a></li>
<li><a href="test_upload.php">Test Results</a></li>
</ul>
</li>
</ul>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Patient Info <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="view_patient.php">View Patient</a></li>
<li><a href="patient_reg.html">Register Patient</a></li>
</ul>
</li>
</ul>
</div>
<p style = "text-align: center;font-size:20px"> <b> Dr. <?php echo $_SESSION['user_name']; ?> </b></p>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="margin-top:-85px">Settings <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="logout.php">Log Out</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<?php
if(isset($_POST['patient_id'])){
include("config.php");
$pid = $_POST['patient_id'];
$diagnosis = $_POST['diagnosis'];
$sympt = $_POST['symptoms'];
$test = $_POST['tests_needed'];
$medi = $_POST['medication'];
$q1 = "INSERT INTO prescription (p_id, diagnosis, symptoms, test_needed, medication)
VALUES ('$pid','$diagnosis','$sympt','$test','$medi')";
$a = mysqli_query($conn,$q1);
if(!$a){
die(mysqli_error($conn));
}
echo "Prescription Uploaded";
mysqli_close($conn);
}else{ ?>
<div class="vertical-center">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2 well">
<h1 class="text-center">Prescritpion</h1>
<form action="#" method="POST">
<div class="form-group">
<label>Patient ID</label>
<div class="input-group">
<span class="input-group-addon">
</span>
<input type="text" name="patient_id" class="form-control" required>
</div>
</div>
<div class="form-group">
<label>Diagnosis</label>
<div class="input-group">
<span class="input-group-addon">
</span>
<input type="text" name="diagnosis" class="form-control" required>
</div>
</div>
<div class="form-group">
<label>Symptoms</label>
<div class="input-group">
<span class="input-group-addon">
</span>
<input type="text" name="symptoms" class="form-control" required>
</div>
</div>
<div class="form-group">
<label>Test needed</label>
<div class="input-group">
<span class="input-group-addon">
</span>
<input type="text" name="tests_needed" class="form-control" required>
</div>
</div>
<div class="form-group">
<label>Medication</label>
<div class="input-group">
<span class="input-group-addon">
</span>
<input type="text" name="medication" class="form-control" required>
</div>
</div>
<div class="form-group">
<input type="submit" value="Submit Prescription" class="btn btn-primary btn-block">
</div>
</form>
</div>
</div>
</div>
</div>
<?php } ?>
</body>
</html>