@include('components.report-header', ['title' => __('admin.course_report')])

{{ __('admin.course_report') }}

@foreach($courses as $c) @endforeach
{{ __('admin.title') }}{{ __('admin.code') }}{{ __('admin.semester') }}{{ __('admin.credit_hours') }}{{ __('admin.teachers') }}{{ __('admin.students_enrolled') }}{{ __('admin.pass_rate') }}
{{ $c->title }} {{ $c->code ?? '—' }} {{ $c->semester->name ?? '' }} {{ $c->credit_hours ?? '—' }} {{ $c->teachers->pluck('name')->implode(', ') }} {{ $c->enrollments->where('status', 'active')->count() }} @php $total = \App\Models\StudentCourseResult::where('course_id', $c->id)->count(); $passed = \App\Models\StudentCourseResult::where('course_id', $c->id)->where('is_passed', true)->count(); $passRate = $total ? round(($passed/$total)*100, 2) : 0; @endphp {{ $passRate }}%