@php $configData = Helper::appClasses(); @endphp @extends('layouts/layoutMaster') @section('title', __('My Attendance')) @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/flatpickr/flatpickr.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js', 'resources/assets/vendor/libs/moment/moment.js' ]) @endsection @section('page-script') @vite(['resources/assets/js/app/hrcore-my-attendance.js']) @endsection @section('content')
{{-- Breadcrumb --}} {{-- Statistics Cards --}}

{{ __('Present Days') }}

{{ $statistics['present'] }}

({{ __('This Month') }})

{{ __('Absent Days') }}

{{ $statistics['absent'] }}

({{ __('This Month') }})

{{ __('Late Arrivals') }}

{{ $statistics['late'] }}

({{ __('This Month') }})

{{ __('Half Days') }}

{{ $statistics['half_day'] }}

({{ __('This Month') }})
{{-- Today's Status --}}
{{ __("Today's Status") }}
{{ now()->format('l, F d, Y') }}
@php $todayAttendance = $attendances->first(fn($att) => $att->date->isToday()); @endphp @if($todayAttendance)
{{ __('Check In') }} @php $checkIn = $todayAttendance->attendanceLogs->where('type', 'check_in')->first(); @endphp {{ $checkIn ? $checkIn->created_at->format('h:i A') : '--:--' }}
{{ __('Check Out') }} @php $checkOut = $todayAttendance->attendanceLogs->where('type', 'check_out')->last(); @endphp {{ $checkOut ? $checkOut->created_at->format('h:i A') : '--:--' }}
{{ __('Total Hours') }} @php $todayHours = floor($todayAttendance->working_hours ?? 0); $todayMinutes = round((($todayAttendance->working_hours ?? 0) - $todayHours) * 60); @endphp @if($todayHours > 0) {{ $todayHours }}h {{ $todayMinutes }}m @else {{ $todayMinutes }}m @endif
{{ __('Status') }} {{ __(ucfirst($todayAttendance->status)) }}
@if(!$checkOut)
{{ __("Don't forget to check out before leaving!") }}
@endif @else
{{ __('No attendance record for today. Please check in to mark your attendance.') }}
@endif
{{-- Attendance History --}}
{{ __('Attendance History') }}
@foreach($attendances as $attendance) @php $checkIn = $attendance->attendanceLogs->where('type', 'check_in')->first(); $checkOut = $attendance->attendanceLogs->where('type', 'check_out')->last(); @endphp @endforeach
{{ __('Date') }} {{ __('Day') }} {{ __('Check In') }} {{ __('Check Out') }} {{ __('Total Hours') }} {{ __('Overtime') }} {{ __('Status') }} {{ __('Actions') }}
{{ $attendance->date->format('M d, Y') }} {{ $attendance->date->format('l') }} @if($checkIn) {{ $checkIn->created_at->format('h:i A') }} @else --:-- @endif @if($checkOut) {{ $checkOut->created_at->format('h:i A') }} @else --:-- @endif @if($attendance->working_hours) @php $hours = floor($attendance->working_hours); $minutes = round(($attendance->working_hours - $hours) * 60); @endphp @if($hours > 0) {{ $hours }}h {{ $minutes }}m @else {{ $minutes }}m @endif @else -- @endif @if($attendance->overtime_hours > 0) @php $otHours = floor($attendance->overtime_hours); $otMinutes = round(($attendance->overtime_hours - $otHours) * 60); @endphp @if($otHours > 0) +{{ $otHours }}h {{ $otMinutes }}m @else +{{ $otMinutes }}m @endif @else -- @endif @php $statusColors = [ 'present' => 'success', 'absent' => 'danger', 'late' => 'warning', 'half_day' => 'info', 'holiday' => 'secondary', 'weekend' => 'secondary' ]; @endphp {{ __(ucfirst(str_replace('_', ' ', $attendance->status))) }}
{{-- View Attendance Details Offcanvas --}}
{{ __('Attendance Details') }}
{{ __('Loading...') }}
@endsection