uas-web-22412056/Widuri-Client/index.html
2025-07-15 15:20:21 +07:00

93 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inventory Management System</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<header>
<h1>Inventory Management System</h1>
<button id="addBtn" class="btn btn-primary">Add New Item</button>
</header>
<div class="stats">
<div class="stat-card">
<h3>Total Items</h3>
<span id="totalItems">0</span>
</div>
<div class="stat-card">
<h3>Total Value</h3>
<span id="totalValue">$0.00</span>
</div>
<div class="stat-card">
<h3>Low Stock</h3>
<span id="lowStock">0</span>
</div>
</div>
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search items by name...">
<button id="refreshBtn" class="btn btn-secondary">Refresh</button>
</div>
<div class="table-container">
<table id="inventoryTable">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Total Value</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="inventoryTableBody">
</tbody>
</table>
</div>
<div class="loading" id="loading">
<div class="spinner"></div>
<p>Loading...</p>
</div>
<div class="error" id="error" style="display: none;">
<p id="errorMessage"></p>
</div>
</div>
<!-- Modal for Add/Edit Item -->
<div id="modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2 id="modalTitle">Add New Item</h2>
<span class="close">&times;</span>
</div>
<form id="itemForm">
<div class="form-group">
<label for="itemName">Name:</label>
<input type="text" id="itemName" required>
</div>
<div class="form-group">
<label for="itemPrice">Price:</label>
<input type="number" id="itemPrice" step="0.01" min="0" required>
</div>
<div class="form-group">
<label for="itemQty">Quantity:</label>
<input type="number" id="itemQty" min="0" required>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-secondary" id="cancelBtn">Cancel</button>
</div>
</form>
</div>
</div>
<script src="script.js"></script>
</body>
</html>