-
Notifications
You must be signed in to change notification settings - Fork 1
/
staff_doc_patient.php
123 lines (100 loc) · 3.35 KB
/
staff_doc_patient.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
<?php
include('header_staff.php');
session_start();
if(!isset($_SESSION["id"]) || $_SESSION["status"] != 2){
header("location: logout.php");
} else {
$id = $_SESSION["id"];
}
$p_id = $_REQUEST['id'];
if( $_SERVER['REQUEST_METHOD']=='POST' && isset($_POST['submit'] ) )
{
$id = $_POST["id"];
$analysis = $_POST["analysis"];
$rx = $_POST["rx"];
$sql="UPDATE patients SET analysis='$analysis', rx='$rx', status='1' WHERE id='$p_id'";
$result = mysql_query($sql) or die(mysql_error());
if($result){
echo "<script>
alert(\"Record successfully added.\");
window.location = \"staff_doc.php\";
</script>";
} else {
echo "<script>
alert(\"Error occured !\");
window.location = \"staff_doc.php\";
</script>";
}
}
?>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1 class="text-center">Treatment</h1>
<hr>
<table class="table table-responsive table-bordered">
<thead>
<tr>
<th>Student's ID</th>
<th>Name</th>
<th>Age</th>
<th>Blood Group</th>
<th>Weight (kg)</th>
<th>Height (m)</th>
<th>Symptoms</th>
</tr>
</thead>
<tbody>
<?php
$sql = "select * from patients where id='$p_id'";
$result=mysql_query($sql);
$count = mysql_num_rows($result);
while( $row =mysql_fetch_assoc( $result )){
$id = $row['id'];
$roll = $row['roll'];
$name = $row['name'];
$age = $row['age'];
$blood_group = $row['blood_group'];
$weight = $row['weight'];
$height = $row['height'];
$symptoms = $row['symptoms'];
echo "<td><a href=\"staff_doc_patient.php?id=$id\"><b>$roll</b></a> </td>
<td>$name</td>
<td>$age</td>
<td>$blood_group</td>
<td>$weight</td>
<td>$height</td>
<td>$symptoms</td>
</tr>
";
}
?>
</tbody>
</table>
<hr>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label">Analysis</label>
<div class="col-sm-10">
<textarea class="form-control" name="analysis" placeholder="Enter analysis of the patient" required></textarea>
<input name="id" type="hidden" value="<?=$p_id?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Prescription</label>
<div class="col-sm-10">
<textarea class="form-control" name="rx" placeholder="Enter prescription for the patient" required></textarea>
</div>
</div>
<button type="submit" name="submit" class="btn btn-primary btn-block">Submit</button>
</form>
</div>
</div>
</div>
<?php include('footer.php') ?>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include indivnameual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>