@extends('layouts.app') @section('content')

Attendance Sessions

Dashboard
{{-- Filter Form --}}
{{-- Table --}}
@forelse($attendanceSessions as $index => $session) @empty @endforelse
# Class Date Taken By Locked Actions
{{ $index + 1 }} {{ $session->class->batch->name ?? 'N/A' }} {{ $session->session_date->format('Y-m-d') }} {{ $session->takenBy->username ?? 'N/A' }} @if($session->locked) Locked @else Open @endif View {{-- ✅ FIXED: Use the same route for both lock and unlock --}}
@csrf @if($session->locked) @else @endif
No attendance sessions found.
{{ $attendanceSessions->links() }}
{{-- JavaScript for AJAX lock/unlock (optional) --}} @endsection