-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
268 lines (251 loc) · 7.07 KB
/
view.php
File metadata and controls
268 lines (251 loc) · 7.07 KB
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
<?php
session_start();
if(!isset($_SESSION["Admin_ID"])){
header("location:index.php");
exit;
}
include("connection.php");
$sql_test = "SELECT * FROM admin WHERE Admin_ID = " . $_SESSION["Admin_ID"] . "";
$result_test = mysqli_query($conn, $sql_test);
if(!$result_test){
echo "ERROR : ";
}
else{
if(mysqli_num_rows($result_test) == 1){
$row = mysqli_fetch_assoc($result_test);
$_SESSION["Admin_Name"] = $row["Admin_Name"];
$_SESSION["Admin_Contact"] = $row["Admin_Contact"];
$_SESSION["Admin_email"] = $row["Admin_email"];
}
}
?>
<html>
<head>
<title>View Profile : Blood Bank Status</title>
<style>
*{
padding:0px;
margin:0px;
}
nav{
background-color:black;
border-bottom:yellow 2px solid;
color:white;
justify-content: right;
padding:5px;
overflow: hidden;
}
.logo{
float:left;
font-size:18px;
margin:15px 3%;
padding:5px;
color:gold;
font-family:Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
nav img{
float : left;
width: 80px;
height:76px;
background-color: black;
}
.stylish{
margin:10px auto;
width:60%;
border-collapse:collapse;
font-family:calibri;
}
.stylish thead tr{
color:white;
background-color:#009879;
font-family:calibri;
text-align:left;
}
.stylish thead th, .stylish td{
padding:10px 20px;
font-weight:bold;
}
.stylish tbody tr{
border-bottom:#dddddd 1px solid;
}
.stylish tbody tr:last-of-type{
border-bottom: #009879 2px solid;
}
.stylish tbody .add{
background-color:lightgreen;
}
.stylish tbody .sub{
}
.info{
text-align:center;
margin:10px auto;
padding:10px;
font-family:calibri;
font-weight:bold;
font-size:26px;
}
.success{
border:green 2px solid;
color:green;
margin:auto auto;
font-weight:bold;
padding:8px;
border-radius:5px;
width:90%;
}
.danger{
border:red 2px solid;
color:red;
margin:auto auto;
font-weight:bold;
padding:8px;
border-radius:5px;
width:90%;
}
input{
padding:5px;
font-weight:bold;
font-family:calibri;
font-size:16px;
}
.controls input{
width:140px;
padding:5px;
margin:10px 25px;
font-weight:bold;
font-family:calibri;
font-size:16px;
}
button:hover{
cursor:pointer;
}
.controls{
display:flex;
justify-content:center;
}
.msg{
text-align:center;
margin:15px auto;
min-width:200px;
max-width:600px;
}
.copyrights{
color:white;
font-weight:bold;
background: linear-gradient(45deg,#E91E63,#edff55);
padding:15px;
font-size:24px;
font-family:Calibri;
text-align:center;
}
</style>
</head>
<body>
<nav>
<img src="img/3.jpg">
<div class="logo">
<h2>LifeSourceGroup</h2>
</div>
</nav>
<div class="info">
<?php
$get_hosp = "SELECT * FROM Hospital Where Hosp_ID = " . $_SESSION["Hosp_ID"] ."";
$res = mysqli_query($conn, $get_hosp);
if($res){
$row = mysqli_fetch_assoc($res);
echo "<h3>" . $row["Hosp_Name"] . "</h3>";
echo "<p><h6>" . $row["Hosp_Addr"] . "</h6></p>";
}
?>
</div>
<hr>
<div class="info">Blood Stock Status</div>
<table class="stylish">
<thead>
<tr>
<th>Blood Group</th>
<th>Blood Stock (in ml)</th>
</tr>
</thead>
<tbody>
<?php
$sql1 = "SELECT * FROM info WHERE Blood_Bank_ID = " . $_SESSION['Blood_Bank_ID'] . "";
$result1 = mysqli_query($conn, $sql1);
if(!$result1){
echo "ERROR : Currently";
exit;
}
$recv_items = mysqli_fetch_all($result1, MYSQLI_ASSOC);
foreach($recv_items as $recv_item) {?>
<tr>
<td><?php echo $recv_item["Blood_Grp"];?></td>
<td class="sub"><?php echo $recv_item["Stock"];?></td>
</tr>
<?php
} ?>
</tbody>
</table>
<br><hr><br>
<div class="info">Hello <?php echo $_SESSION["Admin_Name"] ?>, Welcome to your Profile</div>
<div class="profile">
<div class="msg"></div>
<table class="stylish">
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<form method="POST" id="profile_update">
<tr>
<td>Name</td>
<?php
echo "<td class='sub'><input id='name' type='text' name='Admin_Name' readonly='readonly' value = ". $_SESSION['Admin_Name'] . "></td>";
?>
</tr>
<tr>
<td>Email</td>
<?php
echo "<td class='sub'><input id='email' type='email' name='Admin_email' readonly='readonly' value = ". $_SESSION['Admin_email'] . "></td>";
?>
</tr>
<tr>
<td>Contact</td>
<?php
echo "<td class='sub'><input id='contact' type='number' name='Admin_Contact' readonly='readonly' value = ". $_SESSION['Admin_Contact'] . "></td>";
?>
</tr>
<tr>
<td>Admin_ID</td>
<td class='sub'><?php echo $_SESSION["Admin_ID"];?></td>
</tr>
<tr>
<td>Hospital Name</td>
<td class='sub'><?php echo $row["Hosp_Name"];?></td>
</tr>
</form>
</tbody>
</table>
<div class="controls">
<input type="button" id="edit" value="Edit"><br><br>
<input id="commit" type="submit" form="profile_update" value="Save Changes">
</div>
</div>
<div class="copyrights">Copyrights © <?php $today = date("Y"); echo $today; ?> LifeSourceGroup , all rights reserved.</div>
<script src="js/jquery.min.js"></script>
<script src="control_menu.js"></script>
<script>
document.getElementById("edit").onclick=function(){
document.getElementById("name").removeAttribute('readonly');
document.getElementById("email").removeAttribute('readonly');
document.getElementById("contact").removeAttribute('readonly');
};
document.getElementById("commit").onclick=function(){
document.getElementById("name").readOnly=true;
document.getElementById("email").readOnly=true;
document.getElementById("contact").readOnly=true;
};
</script>
</body>
</html>