Employee ID: {{ $employee->employee_id ?? '' }}
Name: {{ $employee->employee->last_name ?? '' }}
Department: {{ $employee->department->department_name ?? '' }}
@if ($startDate && $endDate)
Date Range: {{ $startDate }} to {{ $endDate }}
@endif
Selfie |
Date |
Time In |
Break Out |
Break In |
Time Out |
OT In |
OT Out |
Hours Worked |
@php $totalMinutes = 0; @endphp
@foreach ($attendances as $att)
@php
$img = null;
if ($att->selfie) {
try {
$imgData = Storage::disk('spaces')->get($att->selfie);
$img = 'data:image/png;base64,' . base64_encode($imgData);
} catch (\Exception $e) {
$img = null;
}
}
@endphp
@if ($img)
@else
No selfie
@endif
|
{{ $att->date }} |
{{ $att->time_in }} |
{{ $att->break_out }} |
{{ $att->break_in }} |
{{ $att->time_out }} |
{{ $att->ot_in }} |
{{ $att->ot_out }} |
{{ $att->hours_worked }} |
@php
preg_match('/(\d+)\s*hrs\s*(\d*)\s*mins?/', $att->hours_worked, $matches);
$hours = $matches[1] ?? 0;
$minutes = $matches[2] ?? 0;
$totalMinutes += $hours * 60 + $minutes;
@endphp
@endforeach
Total Hours Worked: |
@php
$totalHours = floor($totalMinutes / 60);
$remainingMinutes = $totalMinutes % 60;
echo $totalHours . ' hrs ' . $remainingMinutes . ' mins';
@endphp
|