-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_view_request.php
186 lines (170 loc) · 4.13 KB
/
admin_view_request.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
<?php
session_start();
include("config.php");
if(!isset($_SESSION['usertype']))
{
header("location:admin.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("admin_head.php");?>
</head>
<body>
<?php include("admin_topnav.php"); ?>
<div class="container" style='margin-top:70px'>
<div class="row">
<div class="col-sm-3">
<?php include("admin_side_nav.php");?>
</div>
<div class="col-sm-9" >
<h3 class='text-primary'> Patient Details </h3><hr>
<div class="row">
<?php
if(isset($_POST["submit"]))
{
$id=$_GET['id'];
$cdate=$_POST["CDATE"];
$status=$_POST["STATUS"];
if($cdate=="")
{
$cdate="0000-00-00";
$status=1;
}
$sql="UPDATE request_blood SET CDATE='{$cdate}',STATUS='{$status}' WHERE ID='{$id}'";
if($con->query($sql))
{
$s= "<div class='alert alert-success fade in' ><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><strong>Success : </strong> Status Updated Success.</div>";
}
}
if(isset($_GET["id"]))
{
$sql="SELECT * FROM request_blood WHERE ID=".$_GET["id"];
$result=$con->query($sql);
if($result->num_rows>0)
{
$row=$result->fetch_assoc();
?>
<div class="col-md-4">
<div class="panel">
<div class="panel-body">
<img src="<?php echo $row["PIC"];?>" class="image-rounded" height="300px" width="100%">
</div>
</div>
</div>
<div class="col-md-8">
<table class="table table-striped">
<tr>
<th>Name</th>
<td><?php echo $row["NAME"];?></td>
</tr>
<tr>
<th>Blood</th>
<td><?php echo $row["BLOOD"];?></td>
</tr>
<tr>
<th>UNIT</th>
<td><?php echo $row["BUNIT"];?></td>
</tr>
<tr>
<th>Hospital</th>
<td><?php echo $row["HOSP"];?></td>
</tr>
<tr>
<th>District</th>
<td><?php echo $row["DISTRICT"];?></td>
</tr>
<tr>
<th>POST_CODE</th>
<td><?php echo $row["POST_CODE"];?></td>
</tr>
<tr>
<th>Doctor Name</th>
<td><?php echo $row["DOC"];?></td>
</tr>
<tr>
<th>Request Date</th>
<td><?php echo $row["RDATE"];?></td>
</tr>
<tr>
<th>Contact Person</th>
<td><?php echo $row["CNAME"];?></td>
</tr>
<tr>
<th>Address</th>
<td><?php echo $row["CADDRESS"];?></td>
</tr>
<tr>
<th>Email</th>
<td><?php echo $row["EMAIL"];?></td>
</tr>
<tr>
<th>Contact-1</th>
<td><?php echo $row["CON1"];?></td>
</tr>
<tr>
<th>Contact-2</th>
<td><?php echo $row["CON2"];?></td>
</tr>
<tr>
<th>Status</th>
<td><?php
if($row["STATUS"]==0)
{
echo "<b>Pending</b>";
}
else if($row["STATUS"]==1)
{
echo "<b>Not Completed</b>";
}
else if($row["STATUS"]==2)
{
echo "<b>Completed</b>";
}
?></td>
</tr>
<tr>
<th>Completed Date</th>
<td><?php echo $row["CDATE"];?></td>
</tr>
</table>
</div>
<div class="col-md-6">
<h3 class='text-primary'>Any Updation</h3>
<hr>
<?php if(isset($s)){echo $s;}?>
<form method='post' action="<?php echo $_SERVER['PHP_SELF']."?id=".$_GET["id"];?>">
<div class="form-group">
<label for="CDATE">Completed Date</label>
<input type="text" name="CDATE" id="CDATE" class="form-control DATES">
</div>
<div class="form-group">
<label for="STATUS">Status</label>
<select name="STATUS" required id="STATUS" class="form-control">
<option value="">Select Status</option>
<option value="0">Pending</option>
<option value="1">Not Completed</option>
<option value="2">Completed</option>
</select>
</div>
<button type='submit' class='btn btn-success ' name='submit'> Update Now</button>
<a href='admin_need_blood.php' class='btn btn-primary '>Back Page</a>
</form>
</div>
<?php
}
}
else
{
echo "<script>window.open('admin_donor.php','_self');</script>";
}
?>
</div>
</div>
</div>
</div>
<hr>
<?php include("admin_footer.php"); ?>
</body>
</html>