-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitems.html
More file actions
80 lines (77 loc) · 1.98 KB
/
items.html
File metadata and controls
80 lines (77 loc) · 1.98 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Interface</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
color: #333;
}
button {
background-color: #5cb85c;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-top: 10px;
}
button:hover {
background-color: #4cae4c;
}
form {
margin-top: 20px;
}
input, select {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<h2>Admin Interface</h2>
<button onclick="modifyProduct()">Modify Product</button>
<!-- Modified Add Product Button -->
<a href="additems.html"><button>Add Product</button></a>
<!-- Modify Product Form -->
<form id="modifyForm" style="display:none;">
<input type="text" id="modifyName" placeholder="Product Name">
<input type="number" id="modifyPrice" placeholder="Product Price">
<button type="button" onclick="submitModification()">Submit Modification</button>
</form>
</div>
<script>
// Function to show modify product form
function modifyProduct() {
document.getElementById('modifyForm').style.display = 'block';
}
// Function to handle product modification
function submitModification() {
var name = document.getElementById('modifyName').value;
var price = document.getElementById('modifyPrice').value;
// Here you would handle the modification of the product in the JSON file
console.log('Product Modified:', name, price);
}
</script>
</body>
</html>