Files
coursera-ibm-java-developer…/RetailManagementSystem/front-end/edit-product.html

122 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IMS: Manage Inventory
</title>
<!-- Latest compiled and minified CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="frontend.css">
<link rel="shortcut icon" href="images/Logo.png" type="image/x-icon">
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div id="navitem">
<a class="navbar-brand" href="#">
<img src="images/Logo.png" alt="Avatar Logo" class="rounded-pill">
</a>
<div id="head">
<h1 style="color: white;">Edit Product</h1>
</div>
</div>
</nav>
<div id="form" style="display: flex;">
<form id="myform" onsubmit="updateProduct(event)">
<div>
<label for="ustoreId"> Store Id:</label>
<input type="text" name="ustoreId" id="ustoreId" placeholder=" Store ID" required readonly
disabled>
</div>
<div>
<label for="uproductId"> Product Id:</label>
<input type="number" name="productId" id="uproductId" placeholder=" Product Id" readonly disabled>
</div>
<div>
<label for="uproductName"> Product Name:</label>
<input type="text" name="productName" id="uproductName" placeholder=" Product Name" required
disabled>
</div>
<div>
<label for="ucategory">Select Category:</label>
<select name="category" class="category" id="ucategory" required disabled>
<option value="" selected disabled>Select category</option>
<option value="Mobile">Mobile </option>
<option value="TV and AV">TV and AV</option>
<option value="Home Appliances">Home Appliances</option>
<option value="Laptops and Monitors">Laptops and Monitors</option>
<option value="Accessories">Accessories</option>
</select>
</div>
<div>
<label for="uproductPrice"> Price:</label>
<input type="text" name="productPrice" id="uproductPrice" placeholder=" price in $" required
disabled>
</div>
<div>
<label for="uSKU"> SKU:</label>
<input type="text" name="SKU" id="uSKU" placeholder=" SKU" disabled>
</div>
<div>
<label for="ustockLevel"> Stock Level:</label>
<input type="text" name="stockLevel" id="ustockLevel" placeholder=" Stock Level">
</div>
<div>
<input type="submit" value="Update product">
</div>
</form>
</div>
<script>
window.onload = () => {
const url = window.location.href;
const params = new URLSearchParams(window.location.search);
const productId = params.get('productId');
let storeId = params.get('storeId');
let stockLevel = params.get('stockLevel');
let stockField = document.getElementById('ustockLevel')
let storeField = document.getElementById('ustoreId');
stockField.value = stockLevel;
storeField.value = storeId;
setInterval(viewProductByid(productId), 1000);
}
</script>
</body>
</html>