@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
P - Present CL/SL/PL - Leave LOP A - Absent W - Weekly Off (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'; $displayText = '-'; if ($status == 'Present') { $class = 'present'; $displayText = 'P'; $presentCount++; } elseif ($status == 'Sunday') { $class = 'sunday'; $displayText = 'W'; // Sundays don't count as absent } elseif (in_array($status, ['CL','SL','PL'])) { $class = 'leave'; $displayText = $status; $leaveCount++; } elseif ($status == 'LOP') { $class = 'lop'; $displayText = 'LOP'; $absentCount++; } elseif ($status == 'Absent') { $class = 'absent'; $displayText = 'A'; $absentCount++; } @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 }}
{{ $displayText }} {{ $presentCount }} {{ $leaveCount }} {{ $absentCount }}
@endsection @section('scripts') @endsection