@extends('layouts.main_dashboard.app') @php $routePrefix = auth()->user()?->usesStaffPortal() ? 'teacher' : 'admin'; $isArabic = app()->getLocale() === 'ar'; $attendanceCollection = collect($attendanceRecords); @endphp @section('title', __('dashboard.All Attendance Records')) @section('page_heading', __('dashboard.All Attendance Records')) @section('page_subtitle', $course->name) @section('skip_page_hero', true) @section('content')
{{ $isArabic ? 'سجلات الحضور' : 'Attendance' }} {{ $course->name }}

{{ $isArabic ? 'جميع سجلات الحضور' : 'All Attendance Records' }}

{{ $isArabic ? 'سجل موحد وواضح لكل أيام الحضور في المقرر، مع نوع الجلسة، حالة النشر، وعدد الغياب.' : 'A unified and cleaner list of course attendance days with session type, publication status, and absence volume.' }}

@if($attendanceCollection->isEmpty())

{{ __('dashboard.No data found') }}

{{ __('dashboard.There are no attendance records to display, try creating one!') }}

{{ __('dashboard.Add New Attendance Record') }}
@else
@foreach($attendanceCollection as $record)

{{ $record->date?->format('Y-m-d') ?? 'N/A' }}

{{ $record->type === 'school' ? __('dashboard.School Class') : __('dashboard.Virtual Class') }} {{ $record->is_published ? __('dashboard.Published') : __('dashboard.Unpublished') }}
{{ __('dashboard.Date') }}: {{ $record->date?->format('Y-m-d') ?? 'N/A' }}
{{ __('dashboard.Type') }}: {{ $record->type === 'school' ? __('dashboard.School Class') : __('dashboard.Virtual Class') }}
{{ $isArabic ? 'الغياب المسجل:' : 'Recorded absences:' }} {{ $record->absent_students_count ?? 0 }}
{{ __('dashboard.View') }} {{ __('dashboard.Edit') }} @if(Route::has($routePrefix . '.courses.attendance.publish')) {{ $record->is_published ? __('dashboard.Unpublish') : __('dashboard.Publish') }} @endif
@csrf @method('DELETE')
@endforeach
@endif
@endsection