<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>
<div class="container-fluid">
    <div class="wrapper">
        <div class="content"></div>
                <h1>Behavior Reports</h1>
                <?= $this->include('partials/academic_filter') ?>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>Report ID</th>
                            <th>Student ID</th>
                            <th>Name</th>
                            <th>Incident</th>
                            <th>Date</th>
                            <th>Action Taken</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        // Example data - in a real scenario, this will be fetched from the database
                        $behaviorReports = [
                            ['report_id' => 'B001', 'student_id' => 'S001', 'name' => 'John Doe', 'incident' => 'Disruptive in class', 'date' => '2024-07-01', 'action' => 'Parent meeting'],
                            ['report_id' => 'B002', 'student_id' => 'S002', 'name' => 'Jane Smith', 'incident' => 'Fighting', 'date' => '2024-07-02', 'action' => 'Detention'],
                            ['report_id' => 'B003', 'student_id' => 'S003', 'name' => 'Michael Johnson', 'incident' => 'Bullying', 'date' => '2024-07-03', 'action' => 'Suspension'],
                            // Add more records as needed
                        ];

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