-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinventory.html
More file actions
83 lines (82 loc) · 2.15 KB
/
Copy pathinventory.html
File metadata and controls
83 lines (82 loc) · 2.15 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="manifest" href="manifest.json" />
<title>Inventory Management</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<h1>Inventory Management</h1>
<nav>
<a href="index.html">Back to Dashboard</a>
</nav>
</header>
<main>
<section id="add-product-form">
<h2>Add New Product</h2>
<form id="product-form">
<input
type="text"
id="product-name"
placeholder="Product Name"
required
/>
<input
type="number"
id="product-price"
placeholder="Price"
step="0.01"
min="0"
required
/>
<input
type="number"
id="product-stock"
placeholder="Stock Quantity"
min="0"
required
/>
<button type="submit">Add Product</button>
</form>
</section>
<section id="inventory-list">
<h2>Current Inventory</h2>
<table>
<thead>
<tr>
<th>Product ID</th>
<th>Name</th>
<th>Price</th>
<th>Stock</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="inventory-table-body">
<!-- Product rows will be inserted here by JavaScript -->
</tbody>
</table>
</section>
</main>
<script src="inventory.js"></script>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
.register("/sw.js")
.then((registration) =>
console.log(
"ServiceWorker registration successful with scope: ",
registration.scope
)
)
.catch((err) =>
console.log("ServiceWorker registration failed: ", err)
);
});
}
</script>
</body>
</html>