@extends('dashboard.layouts.app') @section('title', __('dashboard.Schedules')) @section('page_heading', __('dashboard.Schedules')) @section('breadcrumb') @endsection @section('content')

{{ __('dashboard.Schedules') }}

{{ __('dashboard.Create Schedule') }}
{{ __('dashboard.Reset') }}
@if($schedules->isEmpty())
{{ __('dashboard.No schedules found') }}.
@else
@foreach ($schedules as $schedule) @endforeach
{{ __('dashboard.ID') }} {{ __('dashboard.Name') }} {{ __('dashboard.Teacher') }} {{ __('dashboard.Status') }} {{ __('dashboard.Start Date') }} {{ __('dashboard.End Date') }} {{ __('dashboard.Subscribers') }} {{ __('dashboard.Actions') }}
{{ $schedule->id }} {{ $schedule->item_name ?? ($schedule->trackLevel->name ?? $schedule->item->name ?? 'Unnamed') }} @if($schedule->teacher) {{ $schedule->teacher->name }} @else {{ __('dashboard.No Teacher Assigned') }} @endif $schedule->status === 'scheduled', 'badge-light-warning' => $schedule->status === 'pending', 'badge-light-danger' => $schedule->status === 'cancelled', 'badge-light-info' => $schedule->status === 'rescheduled', 'badge-light-primary' => $schedule->status === 'completed', ])> {{ __("dashboard." . ucfirst($schedule->status)) }} {{ $schedule->start_date?->format('Y-m-d') ?? '-' }} @php $weeklySlots = json_decode($schedule->weekly_slots, true); $slotsPerWeek = count($weeklySlots); $weeksNeeded = $slotsPerWeek ? ceil($schedule->sessions_count / $slotsPerWeek) : 0; $endDate = $schedule->start_date && $weeksNeeded ? $schedule->start_date->copy()->addWeeks($weeksNeeded)->subDay() : null; @endphp {{ $endDate?->format('Y-m-d') ?? '-' }} {{ __('dashboard.Subscribers') }}
{{ $schedules->appends(request()->query())->links() }} @endif
@endsection @section('scripts') @endsection