<?php
 require_once('includes/auth_check.php');
include_once('includes/header.php');
include_once('includes/sidebar.php');

?>
<main>
    <div class="container-fluid px-4">
        <h1 class="mt-4">Dashboard</h1>
        <div class="row">
            <div class="col-md-4">
                <div class="card shadow-sm">
                    <div class="card-body text-center">
                        <i class="fas fa-calendar-alt fa-3x mb-3 text-primary"></i>
                        <h5>Academic Sessions</h5>
                        <p class="text-muted">Manage school years and current session.</p>

                        <button type="button" class="btn btn-primary" data-bs-toggle="modal"
                            data-bs-target="#academicYearModal">
                            <i class="fas fa-plus"></i> Configure Years
                        </button>
                    </div>
                </div>
            </div>
            <div class="col-md-8">
                
            </div>
        </div>
        <!-- =============academict modal =================== -->
        <div class="modal fade" id="academicYearModal" tabindex="-1">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Add Academic Year</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                    </div>
                    <form id="academicYearForm">
                        <div class="modal-body">
                            <div class="mb-3">
                                <label class="form-label">Year Name (e.g., 2025-2026)</label>
                                <input type="text" class="form-control" name="year_name" placeholder="2025-2026"
                                    required>
                            </div>
                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">Start Date</label>
                                    <input type="date" class="form-control" name="start_date" required>
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">End Date</label>
                                    <input type="date" class="form-control" name="end_date" required>
                                </div>
                            </div>
                            <div class="form-check form-switch">
                                <input class="form-check-input" type="checkbox" name="is_current" id="is_current">
                                <label class="form-check-label" for="is_current">Set as Current Year</label>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                            <button type="submit" class="btn btn-primary">Save Academic Year</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</main>

<?php include_once('includes/footer.php') ?>