-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_display_store_items.php
More file actions
43 lines (38 loc) · 1.09 KB
/
admin_display_store_items.php
File metadata and controls
43 lines (38 loc) · 1.09 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/admin_display_store_items.css" />
<link rel="stylesheet" href="E:/xampp/htdocs/Museum/fonts/fontawesome-free-5.10.2-web/css/all.min.css">
<title>Admin Display Store Items</title>
</head>
<body style="background:url('images/vad.jpg') no-repeat; background-size:cover;">
<center>
<h2 align="center">Items List</h2>
<table>
<tr>
<th>Item Name</th>
<th>Item ID</th>
<th>Price</th>
</tr>
<?php
$conn = mysqli_connect("localhost", "root", "", "museumsys");
if($conn->connect_error){
die("Connection failed:".$conn->connect_error);
}
$sql = "CALL showStoreItems()";
$result = $conn->query($sql);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
echo "<tr><td>".$row["item_name"]."</td><td>".$row["item_id"]."</td><td>".$row["item_price"]."</td></tr>";
}
echo "</table>";
}
else{
echo "<script>window.alert('No item to be displayed')</script>";
}
$conn->close();
?>
</table>
</body>
</html>