@extends('layouts.app')

@section('title', 'Attendance Management | Institution Axis')

@section('sidebar-menu')
    @include('schooladmin.partials.sidebar')
@endsection

@section('sidebar-footer')
    <p>{{ auth()->user()->school?->name ?? 'Institution Axis' }}</p>
@endsection

@section('breadcrumb')
    <span><a href="{{ route('schooladmin.dashboard') }}">Home</a></span> / <span class="active-page">Attendance</span>
@endsection

@section('content')
    <div class="card shadow-sm rounded-4 border-0 mb-4">
        <div class="card-header bg-white">
            <h5><i class="fas fa-calendar-check text-primary"></i> Track Attendance</h5>
        </div>
        <div class="card-body">
            <form action="{{ route('schooladmin.attendance.index') }}" method="GET" class="row py-2 align-items-end g-3">
                <div class="col-md-4">
                    <label class="form-label">Select Class</label>
                    <select name="class_id" class="form-select">
                        <option value="">-- Choose Class --</option>
                    </select>
                </div>
                <div class="col-md-4">
                    <label class="form-label">Select Date</label>
                    <input type="date" name="date" class="form-control" value="{{ date('Y-m-d') }}">
                </div>
                <div class="col-md-4">
                    <button type="submit" class="btn btn-primary w-100">Load Roster</button>
                </div>
            </form>
        </div>
    </div>

    <!-- Attendance Form Area (Dynamically displayed based on selection) -->
    <div class="card shadow-sm rounded-4 border-0">
        <div class="card-body p-5 text-center text-muted">
            <i class="fas fa-search fa-3x mb-3 text-light"></i>
            <h5>Select a class and date to load the attendance sheet.</h5>
        </div>
    </div>
@endsection
