<%- include('../Includes/begin.ejs') %>
<%- include('../Includes/staff_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">Mark Attendance</h3>
                                        <%- include('../Includes/messages') %>
                                    </div>

                                </div>
                            </div>
                            <div class="card-body">
                                <h6 class="heading-small text-muted mb-4">Select Class</h6>

                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group focused">
                                            <form action="/staff/student-attendance" method="POST">
                                                <div class="row">
                                                    <div class="col-lg-12">
                                                        <label for="date-input" class="form-control-label">
                                                            Date
                                                        </label>
                                                        <div class="col-lg-3 col-sm-4 pb-4">
                                                            <input class="form-control" type="date" name="date"
                                                                id="date-input" required>
                                                        </div>
                                                    </div>
                                                    <div class="col-lg-12">
                                                        <div class="form-group">
                                                            <label class="form-control-label" for="classdata">Select
                                                                Your
                                                                Relevant
                                                                Class</label>
                                                            <select class="form-control" id="classdata" name="classdata"
                                                                style="height: max-content;">
                                                                <% for(let i=0; i < classData.length; i++) { %>
                                                                <option>
                                                                    <%= classData[i].name %>, <%=
                                                                                        classData[i].c_id %>, &nbsp;
                                                                     &nbsp;
                                                                    <%= classData[i].semester %>
                                                                    th sem
                                                                    &nbsp; , &nbsp;
                                                                    <%= user.dept_id %>
                                                                </option>
                                                                <% } %>
                                                            </select>
                                                        </div>
                                                    </div>

                                                </div>
                                                <button type="submit" class="btn btn-primary btn-block">
                                                    See Student's List</button>

                                            </form>
                                        </div>

                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div>




    </main>
</section>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
    integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
    integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
    integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
</script>
<script src="../../../JS/attendance.js"></script>
<script>
    document.querySelector("#date-input").max = new Date().toISOString("en-US", {
        timeZone: "Asia/Kolkata"
    }).split("T")[0];
</script>
<script>
    const $button = document.querySelector('#sidebar-toggle');
    const $wrapper = document.querySelector('#wrapper');

    $button.addEventListener('click', (e) => {
        e.preventDefault();
        $wrapper.classList.toggle('toggled');
    });
</script>
</body>

</html>