@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')); $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(); $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(); @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
@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 ?? '' }}
@php $totalProjects = DB::table('gcp_projects') ->join( 'gcp_projectassignments', 'gcp_projects.ProjectID', '=', 'gcp_projectassignments.ProjectID', ) ->where('gcp_projectassignments.WriterID', Auth::user()->UserID) ->where('gcp_projectassignments.IsAssigned', true) ->whereIn('gcp_projects.Status', [12, 13]) ->count(); $cancelProjects = DB::table('gcp_projects') ->join( 'gcp_projectassignments', 'gcp_projects.ProjectID', '=', 'gcp_projectassignments.ProjectID', ) ->where('gcp_projectassignments.WriterID', Auth::user()->UserID) ->where('gcp_projectassignments.IsAssigned', true) ->whereIn('gcp_projects.Status', [11]) ->count(); @endphp {{ number_format($totalProjects) }} Total Projects
@php $totalWords = DB::table('gcp_projectplannings') ->join( 'gcp_projects', 'gcp_projectplannings.ProjectID', '=', 'gcp_projects.ProjectID', ) ->whereIn('gcp_projects.Status', [12, 13]) ->where('gcp_projectplannings.WriterID', Auth::user()->UserID) ->sum('gcp_projectplannings.DoneAssignedWords'); @endphp @if ($totalWords != 0) {{ number_format(round($totalWords / 500)) }} @endif Total Pages
@php $successRate = 0; if (Auth::User()->roleID == 18 && $cancelProjects != 0 && $totalProjects != 0) { $successRate = round(100 - ($cancelProjects / $totalProjects) * 100, 1); } @endphp {{ number_format($successRate) }} Success Rate
@php $projectsTypesNums = DB::table('gcp_projects') ->join( 'gcp_projectassignments', 'gcp_projects.ProjectID', '=', 'gcp_projectassignments.ProjectID', ) ->where('gcp_projectassignments.WriterID', Auth::user()->UserID) ->where('gcp_projectassignments.IsAssigned', true) ->whereIn('gcp_projects.Status', [12, 13]) ->groupBy('gcp_projects.ProjectType') ->orderByRaw('COUNT(gcp_projects.ProjectType) DESC') ->limit(3) ->pluck('gcp_projects.ProjectType'); $projectsTypes = []; foreach ($projectsTypesNums as $key => $projectsTypesNum) { $projectsTypes[$key] = DB::table('gcp_projecttypes') ->where('id', $projectsTypesNum) ->pluck('ProjectType'); } @endphp @foreach ($projectsTypes as $projectsType) {{ preg_replace('/[^A-Za-z0-9\s]/', '', $projectsType) }} , @endforeach Project Type
{{-- attendance modal --}} {{-- attendance modal ended --}} {{-- petty cash modal start --}} {{-- petty cash modal ended --}} {{-- petty cash amount modal start --}} {{-- petty cash modal ended --}} {{-- user profile modal --}} {{-- user profile modal --}} {{-- watch salary modal --}} {{-- watch salary modal end --}} {{-- leave modal start --}} {{-- leave modal ended --}}