@extends('layouts.app') @section('title', 'Attendance - ' . ($class->subject->title ?? 'Class')) @section('content')

Attendance — {{ $class->subject->title ?? '—' }} ({{ $class->batch->name ?? '—' }})

Back to Classes Class Details
Teacher: {{ $teacher->user->name }}
Batch: {{ $class->batch->name }} ({{ $class->batch->code ?? 'No Code' }})
Room: {{ $class->room->name ?? 'Not assigned' }} {{ $class->room->number ? '(' . $class->room->number . ')' : '' }}
Subject: {{ $class->subject->title }} ({{ $class->subject->code ?? 'No Code' }})
Semester: {{ $class->semester }}
Weekly Hours: {{ $class->weekly_hours }} hours
{{-- ⚙️ Attendance Form --}}
@csrf {{-- 📅 Session Date --}}
@error('session_date')
{{ $message }}
@enderror
Select the date for this attendance session
{{-- 👥 Student List --}}
@forelse($students as $student) @empty @endforelse
# Student Name Student ID Attendance Status
{{ $loop->iteration }} {{ $student->name }} @if($student->email)
{{ $student->email }} @endif
{{ $student->institute_id ?? '—' }} @if($student->roll_number)
Roll: {{ $student->roll_number }} @endif
No students found

No students are enrolled in this batch.

Enroll Students
@if($students->count())
@endif
{{-- 📊 Previous Attendance Sessions --}} @if($attendanceSessions->count())
Previous Attendance Sessions
@foreach($attendanceSessions as $session) @php $counts = $session->attendanceEntries ->groupBy('status') ->map(fn($s) => $s->count()); $presentCount = $counts['present'] ?? 0; $absentCount = $counts['absent'] ?? 0; $totalCount = $presentCount + $absentCount; @endphp @endforeach
Date Total Students Present Absent Actions
{{ \Carbon\Carbon::parse($session->session_date)->format('M d, Y') }}
{{ \Carbon\Carbon::parse($session->session_date)->format('l') }}
{{ $totalCount }} {{ $presentCount }} @if($totalCount > 0)
{{ number_format(($presentCount/$totalCount)*100, 1) }}% @endif
{{ $absentCount }} @if($totalCount > 0)
{{ number_format(($absentCount/$totalCount)*100, 1) }}% @endif
{{ $attendanceSessions->links() }}
@else
No attendance records yet

Take attendance to see the history here.

@endif
@endsection @push('styles') @endpush @push('scripts') @endpush