-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts.php
More file actions
40 lines (36 loc) · 1.13 KB
/
Copy pathproducts.php
File metadata and controls
40 lines (36 loc) · 1.13 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
<a href="add_product.php" class="btn btn-success mb-3 pbtn">+ Add Product</a>
<?php include 'db.php'; ?>
<!DOCTYPE html>
<html>
<head><title>Products</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"></head>
<style>
.pbtn{
margin: .5rem ;
}
a{
font: bold;
color: black;
text-decoration-line: none;
}
</style>
<body>
<div class="container mt-5">
<a href="dashboard.php">⬅ Back</a>
<h3>Product List</h3>
<table class="table table-bordered table-striped">
<tr><th>ID</th><th>Product</th><th>Category</th><th>Supplier</th><th>Qty</th></tr>
<?php
$q = mysqli_query($conn,"
SELECT p.product_id,p.product_name,c.category_name,s.supplier_name,p.quantity
FROM products p
JOIN categories c ON p.category_id=c.category_id
JOIN suppliers s ON p.supplier_id=s.supplier_id
ORDER BY p.product_id
");
while($r=mysqli_fetch_assoc($q)){
echo "<tr><td>{$r['product_id']}</td><td>{$r['product_name']}</td><td>{$r['category_name']}</td><td>{$r['supplier_name']}</td><td>{$r['quantity']}</td></tr>";
}
?>
</table>
</div></body></html>