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

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

  <!-- Main Content -->
  <main class="container" style="background-color: cornsilk;">
    <div class="row">
        <div class="offset-md-1 col-md-11">
            <h1><%= title %></h1>
            <a href="/survey-list/add" class="btn btn-primary" role="button">
                <i class="fas fa-plus-circle"></i> Add new survey</a>
            <br><br>
            <table class="table table-bordered table-hover border-primary" style="background-color: bisque;">
                <!-- Header Row-->
                <tr class="d-flex">                    
                        <th class="text-center col-3">Name</th>
                        <th class="text-center col-3">Contact No</th>
                        <th class="text-center col-4">Email</th>                    
                        <th class="text-center col-1"></th>
                        <th class="text-center col-1"></th>                    
                </tr>

                <!-- Repeatable Template Row -->

                <% for(let count = 0; count < SurveyList.length; count++) { %>
                    <tr class="d-flex">
                            <td class="text-center col-3"><%= SurveyList[count].name %></td>
                            <td class="text-center col-3"><%= SurveyList[count].contactno %></td>
                            <td class="text-center col-4"><%= SurveyList[count].email %></td>                        
                            <td class="text-center col-1">
                                <a href="/survey-list/edit/<%= SurveyList[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="/survey-list/delete/<%= SurveyList[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 %>
  





