Laporan Per User

Pilih karyawan untuk melihat detail laporan

@if(request()->hasAny(['search', 'role']))
Reset
@endif
@if($users->count() > 0)
@foreach($users as $user) @php $currentMonth = now()->month; $currentYear = now()->year; $monthlyAttendances = $user->attendances->filter(function($attendance) use ($currentMonth, $currentYear) { return \Carbon\Carbon::parse($attendance->date)->month == $currentMonth && \Carbon\Carbon::parse($attendance->date)->year == $currentYear; }); $stats = [ 'total' => $monthlyAttendances->count(), 'present' => $monthlyAttendances->where('status', 'present')->count(), 'late' => $monthlyAttendances->where('status', 'late')->count(), 'absent' => $monthlyAttendances->where('status', 'absent')->count(), ]; @endphp
{{ strtoupper(substr($user->name, 0, 1)) }}
{{ $stats['total'] }}
Total
{{ $stats['present'] }}
Hadir
{{ $stats['late'] }}
Terlambat
{{ $stats['absent'] }}
Tidak Hadir
@endforeach
@if($users->hasPages())
{{ $users->links() }}
@endif @else

Tidak Ada Data

Tidak ada karyawan ditemukan sesuai kriteria pencarian.

@endif