@extends('layouts.layoutMaster') @section('title', __('View Attendance')) @section('vendor-style') @vite([ 'resources/assets/vendor/libs/leaflet/leaflet.scss', ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/leaflet/leaflet.js', ]) @endsection @section('page-script') @vite([ 'resources/assets/js/app/hrcore-attendance-view.js', ]) @endsection @section('content')
{{ $attendance->created_at->translatedFormat('l, F j, Y') }}
@php $statusClass = match($attendance->status) { 'present' => 'success', 'late' => 'warning', 'absent' => 'danger', default => 'secondary' }; @endphp {{ __($attendance->status ?? 'present') }}
@if($checkInLog = $attendance->attendanceLogs->where('type', 'check_in')->first()) {{ $checkInLog->created_at->format('h:i A') }} @else {{ __('Not checked in') }} @endif
@if($checkOutLog = $attendance->attendanceLogs->where('type', 'check_out')->last()) {{ $checkOutLog->created_at->format('h:i A') }} @else {{ __('Not checked out') }} @endif
@if($checkInLog && $checkOutLog) @php $totalHours = $checkInLog->created_at->diffInHours($checkOutLog->created_at); $totalMinutes = $checkInLog->created_at->diffInMinutes($checkOutLog->created_at) % 60; @endphp {{ $totalHours }}h {{ $totalMinutes }}m @else {{ __('N/A') }} @endif
{{ $attendance->late_reason ?? __('N/A') }}
{{ $attendance->early_checkout_reason }}
@if($attendance->late_hours > 0) {{ formatHours($attendance->late_hours) }} @else {{ __('On Time') }} @endif
@if($attendance->early_hours > 0) {{ formatHours($attendance->early_hours) }} @else {{ __('N/A') }} @endif
@if($attendance->overtime_hours > 0) {{ formatHours($attendance->overtime_hours) }} @else {{ __('None') }} @endif
{{ \Carbon\Carbon::parse($attendance->shift->start_time)->format('h:i A') }}
{{ \Carbon\Carbon::parse($attendance->shift->end_time)->format('h:i A') }}
{{ $log->address }}
@endif @if($log->notes){{ $log->notes }}
@endif