@php $profile = 'Home'; $start_date = date('Y-m-1'); $end_date = date('Y-m-t'); // dd(App\Models\User::where('IsActive',1)->whereNotIn('RoleID',[16,17])->pluck('UserID','fullname')); $attendances = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', '>=', $start_date) ->whereDate('AttendanceDate', '<=', $end_date) ->get(); $monday = date('Y-m-d', strtotime('monday this week')); $currentDate = date('Y-m-d'); $attendace_datas = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->where('AttendanceDate', '>=', $monday) ->where('AttendanceDate', '<=', $currentDate) ->orderBy('AttendanceDate') ->get(); $today_attendance_count = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d')) ->count(); $today_attendance_check = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d')) ->first(); $yesterday_attendance_check = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d', strtotime('-1 day'))) ->first(); $yesterday_attendance_count = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d', strtotime('-1 day'))) ->count(); $leaves = App\Models\LeaveRequest::where('Date', '>=', $start_date) ->where('Date', '<=', $currentDate)->where('UserID', Auth::user()->UserID) ->orderBy('id','desc')->take(10)->get(); $petty_cash_amounts = App\Models\PettyCashAmount::OrderBy('Sno', 'desc') ->whereYear('Month', date('Y')) ->get(); $this_month_petty_cash_amount = App\Models\PettyCashAmount::whereDate('Month', '>=', $start_date) ->whereDate('Month', '<=', $end_date) ->sum('Amount'); $petty_cash_expenses_count = App\Models\PettyCashExpense::whereDate('Date', '>=', $start_date) ->whereDate('Date', '<=', $end_date) ->count(); // dd( $petty_cash_expenses_count); $petty_cash_expenses = App\Models\PettyCashExpense::whereDate('Date', '>=', $start_date) ->whereDate('Date', '<=', $end_date) ->orderBy('Date', 'desc') ->get(); @endphp
{{-- --}}
@php $profile = 'users/avatar.png'; if (isset(Auth::user()->profile_pic)) { $profile = asset('users/' . Auth::user()->profile_pic); } @endphp
@if ($today_attendance_count > 0) @if ( $today_attendance_check->TimeIN == null) @if ($yesterday_attendance_count > 0) @if ($yesterday_attendance_check->IsAttendanceCompleted == 1 || $yesterday_attendance_check->TimeIN == null) @endif @endif @endif @endif @if ($today_attendance_count > 0 ) @if ($today_attendance_check->TimeIN != null) @if ($yesterday_attendance_check->IsAttendanceCompleted == 1 || $yesterday_attendance_check->TimeIN == null) @if ($today_attendance_check->IsAttendanceCompleted != 1) @endif @endif @endif @endif @if ($yesterday_attendance_count > 0) @if ($yesterday_attendance_check->IsAttendanceCompleted != 1 && $yesterday_attendance_check->TimeIN != null) @endif @endif
@foreach ($attendace_datas as $attendace_data) @endforeach
Date Day Time In Time Out Total Time Status
{{ date('d F Y', strtotime($attendace_data->AttendanceDate)) }} {{ date('l', strtotime($attendace_data->AttendanceDate)) }} @if ($attendace_data->TimeIN != null) {{ date('h:i A', strtotime($attendace_data->TimeIN)) }} @else @endif @if ($attendace_data->TimeOUT != null) {{ date('h:i A', strtotime($attendace_data->TimeOUT)) }} @else @endif @if ($attendace_data->TotalTime != null) {{ date('h:i', strtotime($attendace_data->TotalTime)) }} @else @endif {{ $attendace_data->attendance_status->Status ?? '' }}
{{-- user profile modal --}} {{-- user profile modal --}} {{-- petty cash modal start --}} {{-- petty cash modal ended --}} {{-- leave modal --}} {{-- leave modal start --}} {{-- leave modal ended --}} {{-- leave modal end --}}