<%- include('../Includes/begin.ejs') %>

<%- include('../Includes/student_nav.ejs') %>


<section id="content-wrapper">
    <main role="main" class="pt-5 main">
        <div class="main-content">
            <!-- Header -->
            <div class="header pb-4 pb-sm-8 pt-5 pt-lg-8 d-flex align-items-center"
                style="height: 100px; background-size: cover; background-position: center top;">
                <!-- Header container -->
            </div>
            <!-- Page content -->
            <div class="container-fluid mt--7">
                <div class="row">
                    <div class="col-xl-12 order-xl-1">
                        <div class="card bg-secondary shadow">
                            <div class="card-header bg-white border-0">
                                <div class="row align-items-center">
                                    <div class="col-8">
                                        <h3 class="mb-0">View Attendance</h3>
                                    </div>
                                </div>
                            </div>
                            <div class="card-body">
                                <h6 class="form-control-label mb-5"><b>NAME : </b>
                                    <%= studentData.s_name %> || <b>SEMESTER : </b>
                                    <%= curSemester %>
                                </h6>
                                <div class="pl-lg-4">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group focused">
                                                <div class="table-responsive" style="overflow-x: hidden;">
                                                    <% for (let i = 0; i < monthDates.length; ++i) {%>
                                                    <table class="table table-striped">
                                                        <thead class="thead-dark">
                                                            <tr>
                                                                <th scope="col">Days</th>
                                                                <% for (let j = 0; j < courseData.length; ++j) {%>
                                                                <th scope="col"><%=courseData[j].c_id%></th>
                                                                <%}%>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <%for(let j = 0; j < monthDates[i].length; ++j) {%>
                                                            <tr>
                                                                <th><%=monthDates[i][j].monthName%>
                                                                    <%=monthDates[i][j].dayNumber%>
                                                                </th>
                                                                <% for (let k = 0; k < courseData.length; ++k) {%>
                                                                <td><%= isPresent[i][j][k]==undefined?'-':isPresent[i][j][k].status%>
                                                                </td>
                                                                <%}%>
                                                            </tr>
                                                            <%}%>
                                                                </tbody>
                                                    </table>
                                                    <%}%>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="card col-md-8">
                                            <div class="card-header">
                                                <div class="row align-items-center">
                                                    <div class="col-8">
                                                        <h3 class="mb-0">Course Details</h3>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card-body">
                                                <%for(let i = 0; i < courseData.length; ++i){%>
                                                    <div>
                                                        <span
                                                            class="badge badge-info col-md-2"><%=courseData[i].c_id%></span>
                                                        <span
                                                            class="badge badge-info col-md-6"><%=courseData[i].name%></span>
                                                    </div>
                                                    <%}%>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div>
    </main>
</section>

<%- include('../Includes/student_end.ejs') %>