@extends('layouts.dashboard.superadminapp') @section('title', 'Attendance Matrix') @section('styles') @endsection @section('content')

UEPL | Attendance Matrix

day, 00 month 0000
@if(session('success')) @endif @if(session('error')) @endif
Filter Options
Attendance Matrix - {{ \Carbon\Carbon::parse($month.'-01')->format('F Y') }}
Calendar View Daily Reports
Present CL/SL/PL LOP Absent Sunday
Total Employees: {{ count($employees) }}  |  Days in Month: {{ count($dates) }}
@foreach($dates as $date) @php $dayOfWeek = \Carbon\Carbon::parse($date)->dayOfWeek; $isSunday = $dayOfWeek === 0; @endphp @endforeach @foreach($employees as $emp) @php $presentCount = 0; $leaveCount = 0; $absentCount = 0; @endphp @foreach($dates as $date) @php $status = $matrix[$emp->employee_id][$date] ?? ''; $dayOfWeek = \Carbon\Carbon::parse($date)->dayOfWeek; $isSunday = $dayOfWeek === 0; $class = 'unknown'; if ($status == 'Present') { $class = 'present'; $presentCount++; } elseif (in_array($status, ['CL','SL','PL'])) { $class = 'leave'; $leaveCount++; } elseif ($status == 'LOP') { $class = 'lop'; $absentCount++; } elseif ($status == 'Absent') { $class = 'absent'; $absentCount++; } if ($isSunday && $class == 'unknown') { $class = ''; } @endphp @endforeach @endforeach
Employee {{ \Carbon\Carbon::parse($date)->format('d') }}
{{ \Carbon\Carbon::parse($date)->format('D')[0] }}
P L A
{{ $emp->name }}
{{ $emp->employee_id }}
@if($status == 'Present') @elseif(in_array($status, ['CL','SL','PL'])) {{ $status }} @elseif($status == 'LOP') L @elseif($status == 'Absent') @else @if($isSunday) S @else – @endif @endif {{ $presentCount }} {{ $leaveCount }} {{ $absentCount }}
@endsection @section('scripts') @endsection