-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacc.php
More file actions
executable file
·119 lines (117 loc) · 3.39 KB
/
Copy pathacc.php
File metadata and controls
executable file
·119 lines (117 loc) · 3.39 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
<!DOCTYPE html>
<html>
<head>
<title>Table with database</title>
<style>
table {
border-collapse: collapse;
width: 100%;
color: #588c7e;
font-family: monospace;
font-size: 25px;
text-align: left;
}
th {
background-color: #588c7e;
color: white;
}
.india {
text-indent: 50px;
text-align: justify;
letter-spacing: 3px;
font-family: "Comic Sans MS", cursive, sans-serif;
color: rgb(255,0,0);
font-weight: bold;
text-align: center;
}
.tour {
text-indent: 50px;
text-align: justify;
letter-spacing: 3px;
font-family: "Comic Sans MS", cursive, sans-serif;
color: #000000;
font-weight: bold;
text-align: center;
}
.heading{
text-align: center;
}
.info{
text-indent: 50px;
text-align: center;
letter-spacing: 3px;
font-family: "Comic Sans MS", cursive, sans-serif;
color: rgb(255,0,0);
font-weight: bold;
text-align: center;
}
tr:nth-child(even) {background-color: #f2f2f2}
</style>
</head>
<body>
<div class="head">
<div class="heading">
<h1><span class="india">Donate</span><span class="tour"> Online!</span></h1>
</div>
<table>
<?php
if($_POST["hidden"]=="bloodacc"){
echo "<h2 class='info'>Blood Donors Available</h2>";
$conn = mysqli_connect("localhost", "root", "", "donation");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM blood";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td><p>" . $row["name"]. "</p><p>" . $row["bloodgroup"] . "</p><p>"
. $row["age"]."</p><p>" . $row["gender"] . "</p></td><td><button>Contact</button</td></tr>";
}
echo "</table>";
} else { echo "0 results"; }
$conn->close();
}
else if($_POST["hidden"]=="organacc"){
echo "<h2 class='info'>Organ Donors Available</h2>";
$conn = mysqli_connect("localhost", "root", "", "donation");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM organs";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td><p>" . $row["name"] . "</p><p>" . $row["organ"] . "</p><p>"
. $row["age"] . "</p><p>" . $row["gender"] . "</p></td><td><button>Contact</button</td></tr>";
}
echo "</table>";
} else { echo "0 results"; }
$conn->close();
}
else if($_POST["hidden"]=="clothacc"){
echo "<h2 class='info'>Cloth Donors Available</h2>";
$conn = mysqli_connect("localhost", "root", "", "donation");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM clothes";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td><p>" . $row["name"] . "</p><p>"
. $row["clothtype"]."</p><p>" . $row["clothfor"]."</p><p>" . $row["contact"]."</p><p>" . $row["address"] ."</p><p>". $row["quantity"]."</p><p>" . $row["clothgender"] . "</p></td><td><button>Contact</button</td></tr>";
}
echo "</table>";
} else { echo "0 results"; }
$conn->close();
}?>
</table>
</body>
</html>