{{ __('Today\'s Attendance') }} {{ format_date(Date('Y-m-d')) }}
@php $todayAttendance = \App\Models\Attendance::where('user_id', auth()->id()) ->whereDate('attendance_date', \Carbon\Carbon::today()) ->first(); @endphp @if($todayAttendance && $todayAttendance->check_in_time)
{{ __('Check In') }}

{{ $todayAttendance->check_in_time->format('h:i A') }}

{{ $totalHours }} {{ \Str::plural(__('Hour'), intval($totalHours)) }}
@if($todayAttendance->check_out_time)
{{ __('Check Out') }}

{{ $todayAttendance->check_out_time->format('h:i A') }}

@else
{{ __('Status') }}

{{ __('Currently Working') }}

@endif @else

{{ __('No attendance record for today') }}

{{ __('Attendance is recorded from device punches') }}
@endif
{{ __('Statistics') }}

{{ __('Today') }} {{ $totalHoursToday }} {{ \Str::plural(__('Hour'),$totalHoursToday) }}

{{ __('This Week ') }} {{ $totalHoursThisWeek }} {{ \Str::plural(__('Hour'),$totalHoursThisWeek) }}

{{ __('This Month') }} {{ $totalHoursThisMonth }} {{ \Str::plural(__('Hour'),$totalHoursToday) }}

{{ __('Today Activity') }}
    @if (!empty($todayActivity) && $todayActivity->count() > 0) @foreach ($todayActivity as $punch)
  • {{ __('Device Punch') }}

    {{ \Carbon\Carbon::parse($punch->punch_time)->format('h:i A') }}

  • @endforeach @else
  • {{ __('No activity today') }}

  • @endif
@if (!empty($attendances) && $attendances->count() > 0) @foreach ($attendances as $i => $attendance) @php // Use check-in date as the owning day; fall back to attendance_date or created_at $checkIn = $attendance->check_in_time ?? $attendance->created_at; $checkOut = $attendance->check_out_time; $displayDate = $attendance->attendance_date ?? optional($checkIn)->toDateString(); // Calculate hours (even if checkout crosses midnight) $workedHours = $checkOut ? $checkIn->diffInHours($checkOut) : $checkIn->diffInHours(now()); $isCompleteShift = $checkOut && $workedHours >= 15; @endphp @endforeach @else @endif
# {{ __('Date') }} {{ __('Check In') }} {{ __('Check Out') }} {{ __('Shift Status') }}
{{ ++$i }} {{ format_date($displayDate) }} {{ $checkIn ? $checkIn->format('h:i A') : '-' }} {{ $checkOut ? $checkOut->format('h:i A') : '-' }} @if($checkOut) @if($isCompleteShift) {{ __('Complete Shift') }} ({{ $workedHours }}h) @else {{ __('Incomplete') }} ({{ $workedHours }}h) @endif @else {{ __('Active') }} ({{ $workedHours }}h) @endif
{{ __('No attendance records found') }}
{{-- Removed manual clock in modal --}} @script @endscript