-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview-supply.html
78 lines (69 loc) · 2.58 KB
/
view-supply.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Supply Information</title>
</head>
<body>
<h1>Supply Information</h1>
<?php
// Fetch and display supply information from the database
// Implement this part in a separate PHP file (e.g., fetch_supply.php)
// Use appropriate database connection and query mechanisms
$servername = "your_database_server";
$username = "your_username";
$password = "your_password";
$dbname = "your_database_name";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM supply";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table border='1'>
<tr>
<th>ID</th>
<th>Product Name</th>
<th>Supply Quantity</th>
<th>Sales Price</th>
<th>Cost Price</th>
<th>Date and Time</th>
<th>Supplier Name</th>
<th>Supplier Contact</th>
<th>Product Category</th>
</tr>";
while($row = $result->fetch_assoc()) {
echo "<tr>
<td>".$row["id"]."</td>
<td>".$row["productName"]."</td>
<td>".$row["supplyQty"]."</td>
<td>".$row["salesPrice"]."</td>
<td>".$row["costPrice"]."</td>
<td>".$row["datetime"]."</td>
<td>".$row["supplierName"]."</td>
<td>".$row["supplierContact"]."</td>
<td>".$row["productCategory"]."</td>
</tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
<footer>
<nav>
<ul>
<li><a href="sales.html">Sales</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="inventory.html">Inventory</a></li>
<li><a href="reports.html">Reports</a></li>
<li><a href="analytics.html">Analytics</a></li>
<li><a href="profile.html">Profile</a></li>
</ul>
</nav>
</footer>
</body>
</html>