@extends('layouts.userapp') @section('content') @php use Carbon\Carbon; @endphp

Whereabout

Today Attendance
@php $no = 0; @endphp @forelse($checkins as $userCheckins) @php // Filter check-ins for both IN, OUT, IN (OT), and OUT (OT) $userCheckinsFiltered = $userCheckins->whereIn('checkin_type', ['IN', 'OUT', 'IN (OT)', 'OUT (OT)']); // Separate the check-ins based on their type $inCheckin = $userCheckinsFiltered->firstWhere('checkin_type', 'IN'); $outCheckin = $userCheckinsFiltered->firstWhere('checkin_type', 'OUT'); $inOTCheckin = $userCheckinsFiltered->firstWhere('checkin_type', 'IN (OT)'); $outOTCheckin = $userCheckinsFiltered->firstWhere('checkin_type', 'OUT (OT)'); @endphp @empty No check-ins or check-outs recorded for today @endforelse
{{ $userCheckins->first()->username }}
@if($inCheckin) IN: {{ \Carbon\Carbon::parse($inCheckin->checkin_datetime)->format('g:i A') }}
{{ $inCheckin->checkin_sublocality }}, {{ $inCheckin->checkin_locality }}
@endif @if($outCheckin) OUT: {{ \Carbon\Carbon::parse($outCheckin->checkin_datetime)->format('g:i A') }}
{{ $outCheckin->checkin_sublocality }}, {{ $outCheckin->checkin_locality }}
@endif @if($inOTCheckin) IN (OT): {{ \Carbon\Carbon::parse($inOTCheckin->checkin_datetime)->format('g:i A') }}
{{ $inOTCheckin->checkin_sublocality }}, {{ $inOTCheckin->checkin_locality }}
@endif @if($outOTCheckin) OUT (OT): {{ \Carbon\Carbon::parse($outOTCheckin->checkin_datetime)->format('g:i A') }}
{{ $outOTCheckin->checkin_sublocality }}, {{ $outOTCheckin->checkin_locality }} @endif
Not checkin yet
@php $no = 0; @endphp @foreach($notcheckin as $notcheckin) @endforeach
NO. NAME
{{ ++$no }} {{ $notcheckin->employee_first_name }}
Today Absent Staff
@php $no = 0; @endphp @forelse($leave as $leave) @empty No staff take a leave today @endforelse
{{ $leave->username }}
{{ $leave->leavetype_name }} : {{ $leave->total_days }} DAYS
@endsection