@extends('layouts.backend') @section('title', 'Attendance') @section('content')

{{ __('Attendance') }}

@if($canManageAttendance && $hasAllAccess) {{ __('Template Download') }} @endif {{ __('Export Excel (CSV)') }}
@include('partials.flash')
{{ __('Manual Attendance Entry') }}
@csrf @if($canManageAttendance && $hasAllAccess)
@endif
@php($entryType = old('entry_type', 'checkin'))
@if($canManageAttendance && $hasAllAccess)
{{ __('Excel Import (CSV)') }}
@csrf
{{ __('No file selected') }}
Use template columns: employee_code, attendance_date, entry_type, entry_time, remarks.
@endif
{{ __('Attendance History') }}
@forelse($attendanceRows as $row) @empty @endforelse
{{ __('Date') }} {{ __('Employee') }} {{ __('Code') }} {{ __('First Check-in') }} {{ __('Last Check-out') }} {{ __('Duration') }} {{ __('Entries (Same Day)') }}
{{ \Illuminate\Support\Carbon::parse($row->attendance_date)->format('Y-m-d') }} {{ trim(($row->first_name ?? '').' '.($row->last_name ?? '')) ?: '-' }} {{ $row->employee_code ?: '-' }} {{ $row->first_check_in_at ? \Illuminate\Support\Carbon::parse($row->first_check_in_at)->format('H:i') : '-' }} {{ $row->last_check_out_at ? \Illuminate\Support\Carbon::parse($row->last_check_out_at)->format('H:i') : '-' }} @php($stayMinutes = is_numeric($row->stay_minutes ?? null) ? max(0, (int) $row->stay_minutes) : null) @if($stayMinutes === null) - @else {{ intdiv($stayMinutes, 60) }}h {{ $stayMinutes % 60 }}m @endif {{ (int) $row->total_entries }}
{{ __('No attendance data found for selected filters.') }}
{{ $attendanceRows->links('pagination::bootstrap-5') }}
@endsection @push('styles') @endpush @push('scripts') @endpush