<!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>Orders</h1>
    <a href="/admin/dashboard" class="btn btn-secondary mb-3">Back</a>
    <table class="table">
      <thead><tr><th>Order #</th><th>Amount</th><th>Status</th><th>Date</th></tr></thead>
      <tbody>
        <% orders.forEach(o => { %>
          <tr>
            <td>#<%= o.ordernumber %></td>
            <td>$<%= parseFloat(o.totalamount).toFixed(2) %></td>
            <td><%= o.status %></td>
            <td><%= new Date(o.createdat).toLocaleDateString() %></td>
          </tr>
        <% }) %>
      </tbody>
    </table>
  </div>
</body>
</html>