@extends('layout.mainlayout') @section('content')
{{-- ================= LEGEND ================= --}}
P Present A Absent L Leave LWP Leave Without Pay AP Attendance Pending LP Leave Pending Sat / Sun Weekend
{{-- ================= HEADER ================= --}} @foreach ($dates as $date) @php $day = \Carbon\Carbon::parse($date); @endphp @endforeach {{-- ================= BODY ================= --}} @foreach ($rows as $row) @foreach ($dates as $date) @php $status = $row[$date] ?? 'A'; @endphp @endforeach @endforeach
Employee {{ $day->format('d M') }}
{{ $day->format('D') }}
P A L LWP
{{ $row['name'] }}
{{ $row['employee_code'] ?? $row['email'] }}
@switch($status) {{-- PRESENT --}} @case('P') P @break @case('0.5P') 0.5P @break {{-- ABSENT --}} @case('A') A @break {{-- LEAVE --}} @case('L') L @break {{-- LWP --}} @case('LW') LWP @break {{-- WEEKENDS --}} @case('Sat') @case('Sun') {{ $status }} @break {{-- PENDING ATTENDANCE --}} @case('AP') AP @break {{-- PENDING LEAVE --}} @case('LP') LP @break {{-- FALLBACK --}} @default A @endswitch {{ $row['total_present'] }} {{ $row['total_absent'] }} {{ $row['total_leave'] }} {{ $row['total_lwp'] }}
@endsection @push('scripts') @endpush