@extends('layouts.master') @section('content')
TimeTable
@php $today = today(); $dates = []; for ($i = 1; $i < $today->daysInMonth + 1; ++$i) { $dates[] = \Carbon\Carbon::createFromDate($today->year, $today->month, $i)->format('Y-m-d'); } @endphp @foreach ($dates as $date) @endforeach @foreach ($employees as $employee) @for ($i = 1; $i < $today->daysInMonth + 1; ++$i) @php $date_picker = \Carbon\Carbon::createFromDate($today->year, $today->month, $i)->format('Y-m-d'); $check_attd = \App\Models\Attendance::query() ->where('emp_id', $employee->id) ->where('attendance_date', $date_picker) ->first(); $check_leave = \App\Models\Leave::query() ->where('emp_id', $employee->id) ->where('leave_date', $date_picker) ->first(); @endphp @endfor @endforeach
Employee Name Employee Position Employee ID {{ $date }}
{{ $employee->name }} {{ $employee->position }} {{ $employee->id }}
@if (isset($check_attd)) @if ($check_attd->status==1) @else @endif @else @endif
@if (isset($check_leave)) @if ($check_leave->status==1) @else @endif @else @endif
@endsection