@extends('layouts.app') @push('page-styles') @endpush @section('page-content')
{{ __('Attendances') }}
@for ($day = 1; $day <= $days_in_month; $day++) @endfor @if (!empty($employees)) @foreach ($employees as $employee) @for ($day = 1; $day <= $days_in_month; $day++) @php $currentMonth = request()->month ?? now()->month; $year = request()->year ?? now()->year; $attendance = $employee->attendances() ->whereDay('created_at', $day) ->whereMonth('created_at', $currentMonth) ->whereYear('created_at', $year) ->first(); @endphp @if (!empty($attendance->startDate) && !empty($attendance->endDate)) @else @endif @endfor @endforeach @endif
{{ __('Employee') }}{{$day}}
@php $img = !empty($employee->avatar) ? asset('storage/users/'.$employee->avatar): asset('images/user.jpg'); $link = route('employees.show', ['employee' => Crypt::encrypt($employee->id)]); @endphp {!! \Spatie\Menu\Laravel\Html::userAvatar($employee->fullname, $img, $link) !!}
@endsection @push('page-scripts') @endpush