Commit dd55aa06 authored by Hammad ul Azeem's avatar Hammad ul Azeem

index.ejs

parents
<!DOCTYPE html>
<html>
<head>
<title>Supply Chain Management</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1 class="my-5">Supply Chain Management</h1>
<div class="my-4">
<h2>Create Item</h2>
<form action="/create-item" method="POST" class="mb-3">
<div class="row">
<div class="col-md-4">
<div class="form-floating">
<input type="text" class="form-control" name="name" id="name" required>
<label for="name">Name</label>
</div>
</div>
<div class="col-md-4">
<div class="form-floating">
<input type="number" class="form-control" name="quantity" id="quantity" required>
<label for="quantity">Quantity</label>
</div>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">Create Item</button>
</div>
</div>
</form>
</div>
<div class="my-4">
<h2>Items</h2>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Quantity</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% for (const item of items) { %>
<tr>
<td><%= item.id %></td>
<td><%= item.name %></td>
<td><%= item.quantity %></td>
<td><%= item.status %></td>
<td>
<% if (item.status === 'Created') { %>
<form action="/mark-in-transit" method="POST" style="display: inline;">
<input type="hidden" name="itemId" value="<%= item.id %>">
<button type="submit" class="btn btn-success">Mark In Transit</button>
</form>
<% } else if (item.status === 'InTransit') { %>
<form action="/mark-delivered" method="POST" style="display: inline;">
<input type="hidden" name="itemId" value="<%= item.id %>">
<button type="submit" class="btn btn-primary">Mark Delivered</button>
</form>
<% } %>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment