@extends('layouts.app') @section('title', 'Student Attendance') @section('content') @php $cutoffTime = \Carbon\Carbon::createFromFormat('H:i', $cutoff)->format('H:i:s'); @endphp

Attendance sheet

Mark daily attendance manually or review ZKTeco biometric punches for a class.
Import punches Attendance report
@if($mode === 'biometric') @endif
@if($mode === 'biometric') @endif
@csrf
@if($mode === 'biometric')@endif @forelse($students as $i => $s) @php $group = $mode === 'biometric' ? $punches->get($s->id) : null; $first = $group?->sortBy('punched_at')->first()?->punched_at; $last = $group?->sortBy('punched_at')->last()?->punched_at; $derived = !$first ? 'absent' : ($first->format('H:i:s') > $cutoffTime ? 'late' : 'present'); $record = $existing->get($s->id); $current = $record?->status ?? ($mode === 'biometric' ? $derived : 'present'); $source = $record?->source ?? ($mode === 'biometric' ? ($first ? 'biometric' : 'no punch') : 'manual'); @endphp @if($mode === 'biometric') @endif @empty @endforelse
#Admission noLearnerStreamPunchesStatus
{{ $i + 1 }} {{ $s->admission_no }}@if($s->biometric_id)
{{ $s->biometric_id }}
@endif
{{ initials($s->full_name) }}{{ $s->full_name }}
{{ $s->stream ?: '—' }} @if($first)
{{ $first->format('H:i') }} in @if($last && $last->format('H:i:s') !== $first->format('H:i:s')) · {{ $last->format('H:i') }} out @endif
{{ $devices->firstWhere('id', $record?->device_id)?->name ?? 'Device' }}
@else No punch @endif
@if($mode === 'biometric')
{{ ucfirst(str_replace('no punch', 'No punch', $source)) }}
@endif
@foreach(['present' => 'Present', 'absent' => 'Absent', 'late' => 'Late', 'excused' => 'Excused'] as $key => $label) @endforeach
@if($students->count())
{{ $students->count() }} learners · {{ \Carbon\Carbon::parse($date)->format('l, j F Y') }} · {{ $mode === 'biometric' ? 'Biometric (cut-off ' . $cutoff . ')' : 'Manual' }}
@endif
@endsection @push('scripts') @endpush