@extends('layouts.teacher-portal') @section('title', 'Take Attendance') @section('header', 'Take Attendance') @section('content')
@if ($existing->isNotEmpty() && !$canEdit)
The register for this date has already been submitted. Editing is locked by your administrator.
@endif @if ($class)
@csrf

{{ $class->name }} — {{ \Carbon\Carbon::parse($date)->format('l, j M Y') }}

{{ $students->count() }} active students

@forelse ($students as $i => $student) @php($saved = $existing->get($student->id))
{{ $i + 1 }} @if ($student->photo) @else {{ $student->initials }} @endif

{{ $student->full_name }}

{{ $student->admission_no }}

@foreach (['present', 'absent', 'late', 'excused', 'sick'] as $status) @endforeach
@if ($saved) Saved @endif
@empty

No active students in this class.

@endforelse
@if (!($existing->isNotEmpty() && !$canEdit) && $students->isNotEmpty()) @endif
@else

No classes are assigned to you for attendance.

@endif @endsection