-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblooddinfo.php
97 lines (89 loc) · 2.86 KB
/
blooddinfo.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
<?php
require 'file/connection.php';
session_start();
if(!isset($_SESSION['rid']))
{
header('location:login.php');
}
else {
?>
<!DOCTYPE html>
<html>
<?php $title="BloodCare | Add blood samples"; ?>
<?php require 'head.php'; ?>
<style>
body{
background: url(image/p2.png) no-repeat center;
background-size: cover;
min-height: 0;
height: 100%;
}
.login-form{
width: calc(100% - 20px);
max-height: 650px;
max-width: 450px;
background-color: white;
}
</style>
<body>
<?php require 'header.php'; ?>
<div class="container cont">
<?php require 'message.php'; ?>
<div class="row justify-content-center">
<div class="col-lg-4 col-md-5 col-sm-6 col-xs-7 mb-5">
<div class="card">
<div class="card-header title">Add blood group available in your known community</div>
<div class="card-body">
<form action="file/infoAddd.php" method="post">
<select class="form-control" name="bg" required="">
<option>A-</option>
<option>A+</option>
<option>B-</option>
<option>B+</option>
<option>AB-</option>
<option>AB+</option>
<option>O-</option>
<option>O+</option>
</select><br>
<input type="submit" name="add" value="Add" class="btn btn-primary btn-block"><br>
<a href="Userpage.html" class="float-right" title="click here">Cancel</a>
</form>
</div>
</div>
</div>
<?php if(isset($_SESSION['rid'])){
$rid=$_SESSION['rid'];
$sql = "SELECT * from blooddinfo where rid='$rid'";
$result = mysqli_query($conn, $sql);
}
?>
<div class="col-lg-4 col-md-5 col-sm-6 col-xs-7 mb-5">
<table class="table table-striped table-responsive">
<th colspan="4" class="title">User</th>
<tr>
<th>#</th>
<th>User</th>
<th>Action</th>
</tr>
<div>
<?php
if ($result) {
$row =mysqli_num_rows( $result);
if ($row) { //echo "<b> Total ".$row." </b>";
}else echo '<b style="color:white;background-color:red;padding:7px;border-radius: 15px 50px;">Nothing to show.</b>';
}
?>
</div>
<?php while($row = mysqli_fetch_array($result)) { ?>
<tr>
<td><?php echo ++$counter; ?></td>
<td><?php echo $row['bg'];?></td>
<td><a href="file/deleted.php?bdid=<?php echo $row['bdid'];?>" class="btn btn-danger">Delete</a></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</body>
<?php } ?>