@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')
| Learner | Enrollment | Attendance | Present | Late | Absent |
|---|---|---|---|---|---|
@if($u->avatarUrl()) {{ $u->name }} {{ $u->email }}@if($u->phone) · {{ $u->phone }}@endif |
@if($en) |
{{ $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. | |||||