@extends('layouts.portal') @php $min = $batch->minAttendance(); $lockDays = (int) config('infotics.attendance.trainer_edit_days', 7); $held = $sessions->whereNotNull('taken_at')->count(); $withPct = $roster->filter(fn ($r) => $r['percent'] !== null); $avg = $withPct->count() ? round($withPct->avg('percent')) : null; $low = $roster->filter(fn ($r) => $r['sessions_taken'] >= 3 && $r['percent'] !== null && $r['percent'] < $min); @endphp @section('title', $batch->course->title) @section('subtitle', 'Batch '.$batch->batch_code.' · '.$batch->start_date?->format('d M Y').' – '.$batch->end_date?->format('d M Y').($batch->schedule ? ' · '.$batch->schedule : '')) @section('actions') All batches Upload material @endsection @section('content')
Active learners{{ $roster->count() }}{{ $batch->seat_limit ? 'of '.$batch->seat_limit.' seats' : 'No seat limit' }}
Classes held{{ $held }}/{{ $sessions->count() }}{{ $sessions->count() - $held }} still to run
Average attendance{{ $avg !== null ? $avg.'%' : '—' }}Minimum {{ $min }}%
Below minimum{{ $low->count() }}{{ $low->isNotEmpty() ? 'Follow up with these learners' : 'Everyone is on track' }}
@forelse($roster as $r) @php $u = $r['user']; $en = $enrollments->get($u->id); $p = $r['percent']; $tone = $p === null ? '' : ($p >= $min ? 'green' : ($p >= $min - 10 ? 'amber' : 'red')); @endphp @empty @endforelse
LearnerEnrollmentAttendancePresentLateAbsent
@if($u->avatarUrl())@else{{ $u->initials() }}@endif
{{ $u->name }}
{{ $u->email }}@if($u->phone) · {{ $u->phone }}@endif
@if($en) @endif
{{ $p !== null ? $p.'%' : '—' }}@if($p !== null && $p < $min && $r['sessions_taken'] >= 3)Low@endif
{{ $r['present'] }}{{ $r['late'] }}{{ $r['absent'] }}
No active learners yet. Learners appear here once their enrollment is activated.
@forelse($sessions as $s) @php $cancelled = $s->status === 'cancelled'; $locked = $s->taken_at && $s->taken_at->lte(now()->subDays($lockDays)); @endphp
{{ $s->starts_at->format('d') }}{{ $s->starts_at->format('M') }}
{{ $s->displayTitle() }}@if($s->topic) · {{ $s->topic }}@endif
{{ $s->starts_at->format('D g:i A') }}@if($s->ends_at) – {{ $s->ends_at->format('g:i A') }}@endif @if($s->taken_at) {{ $s->present_count }}/{{ $roster->count() }} attended@endif @if($s->recording_url) Recording added@endif
@if($cancelled) @elseif($s->taken_at) @if($locked) LockedView@else Edit@endif @else Take attendance @endif
Edit class details
@csrf @method('PUT')
@empty @endforelse

Materials for this course

Upload to this batch
@forelse($resources as $rs)
{{ $rs->title }}
{{ strtoupper($rs->kind) }}@if($rs->humanSize()) · {{ $rs->humanSize() }}@endif · {{ $rs->batch_id ? 'This batch only' : 'All learners of the course' }} · {{ $rs->created_at->format('d M Y') }}
@empty Upload the first one @endforelse

Email this batch

{{ $roster->count() }} recipient{{ $roster->count() === 1 ? '' : 's' }}
@csrf
@endsection