@extends('dashboard.layouts.app') @section('content') @include('components.alert') @php $today = now()->toDateString(); $hasScopedResults = $selectedStaffId || $selectedDepartmentId || $viewSelf || $viewTeam || (!$is_hr && !$is_manager); $activeFiltersCount = collect([ filled($selectedDepartmentId), filled($selectedStaffId), request()->filled('from_date') && $date_from !== $today, request()->filled('to_date') && $date_to !== $today, $viewSelf, $viewTeam, ])->filter()->count(); $scopeLabel = match (true) { $viewSelf => 'My Attendance', $viewTeam => 'My Team', filled($selectedStaffId) => 'Selected Staff', filled($selectedDepartmentId) => 'Selected Department', $is_hr => 'HR Scope', $is_manager || $is_direct_manager => 'Managed Scope', default => 'Personal Scope', }; $emptyMessage = $hasScopedResults ? 'No attendance records found matching the current filters.' : 'Choose a staff member and date range to review attendance.'; $isSingleStaffScope = filled($selectedStaffId) || ($viewSelf && !$viewTeam) || (!$is_hr && !$is_manager && !$is_direct_manager); @endphp
Filter by department, staff, quick scope, and date range to inspect attendance records.
{{ $attendances->count() }} record(s) found between {{ $date_from }} and {{ $date_to }}.