<% if (allrecs.length > 0) {%>
    <table border="1">
        <tr>
            <th>Order ID</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Order Date</th>
            <th>Product</th>
            <th>Price</th>
            <th>Quantity</th>
        </tr>
        <% allrecs.forEach((recref, index) => { %>
            <tr>
                <td><%= recref.order_id %></td>
                <td><%= recref.firstname %></td>
                <td><%= recref.lastname %></td>
                <td><%= new Date(recref.saledate).toLocaleDateString('en-US', { timeZone: 'UTC' }) %></td>
                <td><%= recref.productname %></td>
                <td><%= Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(recref.saleprice) %></td>
                <td><%= recref.qty %></td>
            </tr>
        <% }); %>
    </table>
<% } else { %>
    <p>No Records Available</p>
<% } %>
    