-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminportal.php
95 lines (79 loc) · 3.27 KB
/
adminportal.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Signup | BloodBank</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-blue-grey.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="css/modal.css" rel="stylesheet" type="text/css" media="all" />
<!-- Custom CSS -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<h2>Register Blood bank</h2>
<div>
<a href="#" class="btn btn-info" role="button">Register Recipient institution</a>
</div>
<form method="post" action="">
Blood bank names
<select name="pick">
<option value="1">Social service blood bank</option>
<option value="7">Habib mustafa khan blood bank</option>
<option value="3">Chiranjeevi eye & blood bank</option>
<option value="4">Sanjeevani blood bank</option>
<option value="5">Suraksha blood bank</option>
<option value="6">Gene blood bank</option>
<option value="2">ITMR blood bank</option>
<option value="8">Central blood bank</option>
</select>
<input type="submit" value="Submit the form"/>
</form>
<?php
$hostname = "localhost";
$username = "root";
$password = "root";
$dbname = "bloodbank";
$category="";
// echo "hbasbbass";
if (isset($_POST['pick']))
//echo "hbasbbass";
$category = $_POST['pick'];
//echo $category;
//
$conn = new mysqli($hostname, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
else{
//echo "connected";
}
$test = "SELECT * FROM bank_inventory where id=$category";
$result = $conn->query($test);
// echo "result: $result";
if ($result ==true) {
echo "connected";
// output data of each row
while($row = $result->fetch_assoc()) {
//echo "connected12";
echo $row["id"] ."\t";
echo $row["name"]."\t";
echo $row["BloodGroup"]."\t";
echo $row["units"]."\t";
}
}
$conn->close();
?>
</body>
</html>