@extends('layouts.main_dashboard.app') @section('title', __('dashboard.Class Schedule')) @section('page_heading', __('dashboard.Class Schedule')) @section('page_subtitle', app()->getLocale() === 'ar' ? 'إدارة جدول الصف أسبوعيًا مع عرض أوضح للفترات والإجراءات المباشرة.' : 'Manage the class weekly schedule with a clearer view of periods and direct actions.') @section('skip_page_hero', true) @php $isArabic = app()->getLocale() === 'ar'; $weekDays = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']; $dayLabels = collect($weekDays)->mapWithKeys(fn ($day) => [$day => __('dashboard.' . $day)]); $usedDays = collect($weekDays)->filter(fn ($day) => $groupedByDay->get($day, collect())->isNotEmpty())->count(); $freeSlots = (count($periodRange) * count($weekDays)) - $summary['total_entries']; $filtersApplied = collect($filters)->filter(fn ($value) => filled($value))->count(); $copyRoute = $otherClasses->isNotEmpty() ? route('admin.schedules.copy', [$schoolClass->id, $otherClasses->first()->id]) : null; @endphp @section('content')
{{ $isArabic ? 'إدارة جدول الصف' : 'Class schedule management' }}
{{ $isArabic ? 'اعرض الفترات الأسبوعية، راجع المواد والمعلمين، ثم نفّذ التعديل أو النسخ من واجهة عملية ومباشرة.' : 'Review weekly periods, inspect courses and teachers, then update or copy the schedule from a direct workspace.' }}
{{ $isArabic ? 'إجمالي الإدخالات' : 'Total entries' }}
{{ $summary['total_entries'] }}
{{ $isArabic ? 'ملخص الجدول' : 'Schedule summary' }}
{{ $isArabic ? 'حالة الجدول الحالي قبل التعديل أو النسخ إلى صف آخر.' : 'Current schedule status before editing or copying to another class.' }}
{{ $isArabic ? 'المواد المغطاة' : 'Covered courses' }}
{{ $summary['courses'] }}
{{ $isArabic ? 'الدروس المستخدمة' : 'Used lessons' }}
{{ $summary['lessons'] }}
{{ $isArabic ? 'الأيام المفعلة' : 'Active days' }}
{{ $usedDays }}
{{ $isArabic ? 'فترات شاغرة' : 'Free slots' }}
{{ max(0, $freeSlots) }}
{{ $isArabic ? 'تصفية الجدول' : 'Filter schedule' }}
{{ $isArabic ? 'اعرض يومًا أو فترة أو مادة أو معلمًا محددًا للوصول بسرعة إلى الإدخالات المطلوبة.' : 'Filter by day, period, subject, teacher, or search term to focus the schedule.' }}
{{ $isArabic ? 'المصفوفة الأسبوعية' : 'Weekly matrix' }}
{{ $isArabic ? 'شبكة سريعة توضح ما إذا كانت كل فترة مشغولة أو فارغة.' : 'A quick matrix showing whether each period is occupied or empty.' }}
{{ $isArabic ? 'لا توجد حصص مطابقة للنطاق الحالي.' : 'No schedule entries match the current scope.' }}
| {{ __('dashboard.Period') }} | @foreach($weekDays as $day){{ $dayLabels[$day] }} | @endforeach
|---|---|
|
{{ __('dashboard.Period') }} {{ $period }} |
@foreach($weekDays as $day)
@php
$entries = $groupedByDay->get($day, collect())->where('period', $period);
@endphp
@if($entries->isEmpty())
{{ __('dashboard.No class') }}
@else
@foreach($entries as $entry)
@endif
{{ $entry->course?->name ?? __('dashboard.No Course') }} {{ \Illuminate\Support\Carbon::parse($entry->start_time)->format('H:i') }} - {{ \Illuminate\Support\Carbon::parse($entry->end_time)->format('H:i') }} @if($entry->lesson){{ $entry->lesson->title }} @endif |
@endforeach
{{ $isArabic ? 'الإدارة التنفيذية' : 'Execution list' }}
{{ $isArabic ? 'القائمة التالية مناسبة للتعديل والحذف السريع لكل حصة.' : 'Use this list for quick editing and deletion of each entry.' }}
| {{ $isArabic ? 'اليوم' : 'Day' }} | {{ __('dashboard.Period') }} | {{ $isArabic ? 'المساق' : 'Course' }} | {{ $isArabic ? 'الدرس' : 'Lesson' }} | {{ __('dashboard.Time') }} | {{ __('dashboard.Actions') }} |
|---|---|---|---|---|---|
| {{ $dayLabels[$entry->day_of_week] ?? $entry->day_of_week }} | {{ $entry->period }} |
{{ $entry->course?->name ?? __('dashboard.No Course') }} |
{{ $entry->lesson?->title ?? '-' }} | {{ \Illuminate\Support\Carbon::parse($entry->start_time)->format('H:i') }} - {{ \Illuminate\Support\Carbon::parse($entry->end_time)->format('H:i') }} |