@php $profile = 'Home'; $start_date = date('Y-m-1'); $end_date = date('Y-m-t'); $petty_cash_amounts = App\Models\PettyCashAmount::whereYear('Month', date('Y')) ->whereDate('Month', '>=', $start_date) ->whereDate('Month', '<=', $end_date) ->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', 'asc') ->get(); $merged_petty_cash_records = $petty_cash_expenses->concat($petty_cash_amounts)->sortBy('created_at'); $active_users = App\Models\User::where('IsActive',1)->whereIn('roleID',[18,19,20,21,22,23,24,25,26,27])->pluck('UserID')->toArray(); $attendances = App\Models\Attendance::whereIn('UserID', $active_users) ->whereDate('AttendanceDate', date('Y-m-d'))->get(); $Group=DB::table('gcp_attendances') ->leftjoin('gcp_users','gcp_attendances.UserID','=','gcp_users.UserID') ->where('gcp_attendances.AttendanceDate',date('Y-m-d')) ->where('gcp_users.IsActive',true)->where('gcp_users.roleID','!=',16)->where('gcp_users.roleID','!=',17)->where('gcp_users.roleID','!=',28) ->orderBy('gcp_attendances.AttendanceDate')->select('gcp_attendances.Status', DB::raw('count(*) as total')) ->groupBy('gcp_attendances.Status') ->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(); $leaves = App\Models\LeaveRequest::where('Date', '>=', $start_date) ->where('Date', '<=', $currentDate) ->orderBy('id', 'desc') ->take(10) ->get(); $yesterday_attendance_count = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d', strtotime('-1 day'))) ->count(); $departments=App\Models\Departments::orderBy('Department_ID','desc')->get(); $designations=App\Models\Designations::orderBy('DesignationID','desc')->get(); $project_sources=App\Models\ProjectSource::orderBy('SourceID','desc')->where('IsActive',1)->get(); $project_sources_count=App\Models\ProjectSource::orderBy('SourceID','desc')->count(); $attendance_statuses=App\Models\AttendanceStatus::orderBy('Sno','desc')->get(); $shifts=App\Models\JobShifts::all(); $roles=App\Models\Roles::all(); @endphp
@php $profile = 'users/avater.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
DASHBOARD

{{-- --}}

@if ($today_attendance_count > 0) @if ($today_attendance_check->IsAttendanceCompleted == 0) @if ($yesterday_attendance_count > 0) @if ($yesterday_attendance_check->TimeIN != null && $yesterday_attendance_check->IsAttendanceCompleted == 0) You Have Clocked In At {{ date('h:i A', strtotime($yesterday_attendance_check->TimeIN)) }} @endif @else @if ($today_attendance_check->TimeIN != null) You Have Clocked In At {{ date('h:i A', strtotime($today_attendance_check->TimeIN)) }} @endif @endif @else Your Today Shift Has Been Completed @endif @endif

{{-- main content of dashboard --}}
{{-- attendance and break table --}}
@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) {{ $attendace_data->TotalTime }} @else @endif {{ $attendace_data->attendance_status->Status ?? '' }}
{{-- bottom icons --}}
{{-- main content ended --}}
{{-- petty cash modal start --}} {{-- petty cash modal ended --}} {{-- petty cash amount modal start --}} {{-- petty cash modal ended --}} @include('components.hr_modals.attendance_modal') @include('components.hr_modals.profile_modal') @include('components.hr_modals.salary_summary_modal') @include('components.hr_modals.attendance_status') @include('components.hr_modals.department_modal') @include('components.hr_modals.designation_modal') @include('components.hr_modals.project_sources') @include('components.hr_modals.leave_request') @include('components.hr_modals.test_candidate_modal') @include('components.hr_modals.salary_slip_modal') @include('components.hr_modals.employee_modal') @include('components.hr_modals.users_login_detail_modal')