{{ __('Dashboard') }}

@if(Auth::user()->is_admin)
Total Employees
{{ $stats['total_employees'] ?? 0 }}
Departments
{{ $stats['total_departments'] ?? 0 }}
Pending Leaves
{{ $stats['pending_leaves'] ?? 0 }}
Today's Attendance
{{ $stats['today_attendance'] ?? 0 }}
@else
My Pending Leaves
{{ $stats['my_pending_leaves'] ?? 0 }}
My Total Leaves
{{ $stats['my_total_leaves'] ?? 0 }}
Attendance Days
{{ $stats['my_attendance_days'] ?? 0 }}
@endif
@if(Auth::user()->is_admin)

Attendance (Last 7 Days)

@foreach($chart as $d)
@php $present = (int) ($d['present'] ?? 0); $late = (int) ($d['late'] ?? 0); $absent = (int) ($d['absent'] ?? 0); $total = $present + $late + $absent; $hTotal = ($total / $chartMax) * 100; $hPresent = ($present / $chartMax) * 100; $hLate = ($late / $chartMax) * 100; $hAbsent = ($absent / $chartMax) * 100; @endphp
{{ \Carbon\Carbon::parse($d['date'])->format('M d') }}
@endforeach
Present
Late
Absent
@else

My Attendance (Last 7 Days)

@foreach($chart as $d)
@php $worked = (int) ($d['worked_minutes'] ?? 0); $ot = (int) ($d['overtime_minutes'] ?? 0); $total = $worked + $ot; $hTotal = ($total / $chartMax) * 100; $hWorked = ($worked / $chartMax) * 100; $hOt = ($ot / $chartMax) * 100; @endphp
{{ \Carbon\Carbon::parse($d['date'])->format('M d') }}
@endforeach
Worked
Overtime
@endif
@if(Auth::user()->is_admin)

Recent Leave Requests

@forelse($stats['recent_leaves'] ?? [] as $leave) @empty @endforelse
Employee Type Status
{{ $leave->employee->first_name }} {{ $leave->leaveType->name }} {{ ucfirst($leave->status) }}
No recent requests

Recent Attendance

@forelse($stats['recent_attendance'] ?? [] as $att) @empty @endforelse
Date Employee In/Out
{{ $att->date->format('M d') }} {{ $att->employee->first_name }} {{ $att->check_in->format('H:i') }} - {{ $att->check_out ? $att->check_out->format('H:i') : '--' }}
No recent attendance

Live Device Transactions

@if(Auth::user()->canAccess('can_manage_devices')) View All @endif
@forelse($liveTransactions as $log) @empty @endforelse
Time Device Employee
{{ $log->punch_time?->format('M d H:i') }} {{ $log->terminal_sn }} {{ $log->employee ? ($log->employee->first_name . ' ' . $log->employee->last_name) : ($log->emp_code ?? 'N/A') }}
No transactions
@else

My Recent Leave Requests

@forelse($stats['my_recent_requests'] ?? [] as $leave) @empty @endforelse
Type Dates Status
{{ $leave->leaveType->name }} {{ $leave->start_date->format('M d') }} - {{ $leave->end_date->format('M d') }} {{ ucfirst($leave->status) }}
No requests found

My Recent Punches

@forelse($liveTransactions as $log) @empty @endforelse
Time Device
{{ $log->punch_time?->format('M d H:i') }} {{ $log->terminal_sn }}
No punches
@endif