<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title><%= title %></title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  <div class="container my-4">
    <h1>Products</h1>
    <a href="/admin/dashboard" class="btn btn-secondary mb-3">Back to Dashboard</a>
    <table class="table">
      <thead>
        <tr><th>Name</th><th>Price</th><th>Stock</th><th>Status</th></tr>
      </thead>
      <tbody>
        <% products.forEach(p => { %>
          <tr>
            <td><%= p.name %></td>
            <td>$<%= parseFloat(p.price).toFixed(2) %></td>
            <td><%= p.stockquantity %></td>
            <td><%= p.isactive ? 'Active' : 'Inactive' %></td>
          </tr>
        <% }) %>
      </tbody>
    </table>
  </div>
</body>
</html>