<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>
<div class="container-fluid">
    <div class="wrapper">
        <div class="content"></div>
                <h1>Attendance Records</h1>
                <?= $this->include('partials/academic_filter') ?>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>Student ID</th>
                            <th>Name</th>
                            <th>Date</th>
                            <th>Status</th>
                            <th>Remarks</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        // Example data - in a real scenario, this will be fetched from the database
                        $attendanceRecords = [
                            ['student_id' => 'S001', 'name' => 'John Doe', 'date' => '2024-07-01', 'status' => 'Present', 'remarks' => ''],
                            ['student_id' => 'S002', 'name' => 'Jane Smith', 'date' => '2024-07-01', 'status' => 'Absent', 'remarks' => 'Sick'],
                            ['student_id' => 'S003', 'name' => 'Michael Johnson', 'date' => '2024-07-01', 'status' => 'Present', 'remarks' => ''],
                            // Add more records as needed
                        ];

                        foreach ($attendanceRecords as $record) {
                            $dateDisp = !empty($record['date']) ? local_date($record['date'], 'm-d-Y') : '';
                            echo "<tr>
                                    <td>{$record['student_id']}</td>
                                    <td>{$record['name']}</td>
                                    <td>" . esc($dateDisp) . "</td>
                                    <td>{$record['status']}</td>
                                    <td>{$record['remarks']}</td>
                                  </tr>";
                        }
                        ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?= $this->endSection() ?>
