@php
$total = 0;
$totalPresent = 0;
$totalAbsent = 0;
$totalNotMarked = 0;
@endphp
Attendance Report
Date |
Present |
Absent |
@foreach ($dateRange as $datenew)
{{ \Carbon\Carbon::create($datenew)->format('d M Y') }} |
@if(in_array(\Carbon\Carbon::create($datenew)->format('Y-m-d'), $holidays))
Holiday
|
@elseif($datenew->format('w') == 0 || $datenew->format('w') == 6)
Weekend
|
@else
@php
$status = '';
$total++;
foreach($attendances as $attendance){
\Illuminate\Support\Facades\Log::debug(\Carbon\Carbon::create($attendance['date_of_attendance'])->format('Y-m-d'));
\Illuminate\Support\Facades\Log::debug(\Carbon\Carbon::create($datenew)->format('Y-m-d'));
if(\Carbon\Carbon::create($datenew)->equalTo(\Carbon\Carbon::create($attendance['date_of_attendance']))){
if($attendance['is_present'] == 1){
$status = 'Present';
$totalPresent++;
}else{
$status = 'Absent';
$totalAbsent++;
}
}
}
@endphp
@if($status == 'Present')
{{$status}}
|
|
@elseif($status == 'Absent')
|
{{$status}}
|
@else
Not Marked
|
@php
$totalNotMarked++;
@endphp
@endif
@endif
@endforeach