<%- include ../partials/header.ejs %>

<%- include ../partials/main_nav.ejs %>
  

  <!-- Main Content -->
  <main class="container">
    <div class="row">
        <div class="offset-md-1 col-md-11">
            <br><h1><%= title %></h1><br>
            <a href="/product-list/add" class="btn btn-primary" role="button">
            <i class="fas fa-plus-circle"></i> Add a Item</a>
            <br><br>
            <table class="table table-bordered table-striped table-hover">
                <!-- Header Row -->
                <tr class="d-flex">
                    <th class="text-center col-sm"> Item Type</th>
                    <th class="text-center col-1">Quantity/
                        Number</th>
                    <th class="text-center col-2">Price/
                        Cost</th>
                    <th class="text-center col-1"></th>
                    <th class="text-center col-1"></th>
                </tr>

                <!-- Repeatable Template Row -->

                <% for(let count = 0; count < ProductList.length; count++) { %>
                    <tr class="d-flex">
                        <td class="text-center col-sm"><%= ProductList[count].name %></td>
                        <td class="text-center col-1"><%= ProductList[count].quantity %></td>
                        <td class="text-center col-2"><%= ProductList[count].price %></td>
                        <td class="text-center col-1">
                            <a href="/product-list/edit/<%= ProductList[count]._id %>" class="btn btn-primary btn-sm">
                            <i class="fas fa-pencil-alt"></i> Edit</a>
                        </td>
                        <td class="text-center col-1">
                            <a href="/product-list/delete/<%= ProductList[count]._id %>" class="btn btn-danger btn-sm">
                            <i class="fas fa-trash-alt"></i> Delete</a>
                        </td>
                    </tr>
                <% } %>
            </table>
        </div>
    </div>
  </main>
  
<%- include ../partials/bottom_nav.ejs %>  

<%- include ../partials/footer.ejs %>
  





