@extends('employee.layouts.app') @section('title',get_setting('site_name').' Employee Dashboard') @section('content')
{{ auth()->user()->name }}

{{ auth()->user()->name }}

{{ auth()->user()->staff->designation->name }}
Joined on {{ auth()->user()->staff->joing_date }}
Department {{ auth()->user()->staff->department->name }}
Branch {{ auth()->user()->staff->warehouse->name }}
My Statistics
@php $today_attendance=\App\Models\Attendance::where('staff_id',auth()->user()->staff->id)->where('date',\Illuminate\Support\Carbon::today())->first(); @endphp
IN TIME
@if($today_attendance!==null)
{{date('h:i A',strtotime($today_attendance->signIn))}}
@else @endif
OUT TIME
@if($today_attendance!==null && $today_attendance->signOut!==null)
{{date('h:i A',strtotime($today_attendance->signOut))}}
@else @endif
@php $miss_attendances = \App\Models\Attendance::where('staff_id', auth()->user()->staff->id) ->where(function ($query) { $query->whereNull('signIn')->orWhereNull('signOut')->where('date','!=',date('Y-m-d'))->whereYear('date',date('Y')); }) ->get(); @endphp
@if(!empty($employeeModuleStats))
@foreach($employeeModuleStats as $m)

{{ $m['value'] }}

@if(!empty($m['route'])) {{ $m['label'] }} @else
{{ $m['label'] }}
@endif
@endforeach
@endif

{{\App\Models\Leave::where('staff_id', auth()->user()->staff->id)->whereYear('apply_date', \Illuminate\Support\Carbon::now()->year)->where('status',1)->sum('number_of_days')}}

Leave Spent

{{\App\Models\visiting_application::where('staff_id',auth()->user()->staff->id)->count()}}

Visit Token

{{count($miss_attendances)}}

@php $leave_application_pending=\App\Models\Leave::where('staff_id',auth()->user()->staff->id)->where(function ($query){ $query->where('status',0); }) ->count(); $attendance_reconciliation=\App\Models\attendance_reconcilition::where('staff_id',auth()->user()->staff->id)->where(function ($query){ $query->where('status',0); }) ->count(); @endphp

{{$leave_application_pending+$attendance_reconciliation}}

Pending Approval
MISSED ATTENDANCES
@foreach($miss_attendances as $miss_attendance) @endforeach
Attendance Date In Time Out Time
{{$miss_attendance->date}} @if($miss_attendance->signIn!=null) {{date('h:i a',strtotime($miss_attendance->signIn))}} @else {{__('-')}} @endif @if($miss_attendance->signOut != null) {{date('h:i a',strtotime($miss_attendance->signOut))}} @else {{__('-')}} @endif
Leave Summary
@php $currentYear = \Illuminate\Support\Carbon::now()->year; @endphp @foreach(\App\Models\LeaveType::where('group_id',auth()->user()->staff->leave_group_id)->get() as $leave_type) @php $taken = \App\Models\Leave::where('staff_id', auth()->user()->staff->id) ->where('leave_type_id', $leave_type->id) ->whereYear('apply_date', $currentYear) ->where('status',1) ->sum('number_of_days'); $adjustment=\App\Models\LeaveAdjustment::where('staff_id', auth()->user()->staff->id) ->where('year',$currentYear) ->where('leave_type_id', $leave_type->id) ->sum('balance'); @endphp @endforeach
{{$leave_type->name}} Allowed: @if (date('Y', strtotime(auth()->user()->staff->joing_date)) == date('Y')) {{$leave_have=round(($leave_type->day/12)*(12-date('m',strtotime(auth()->user()->staff->joing_date))+1),0)}} @else {{$leave_have=$leave_type->day}} @endif Adjustment: {{$adjustment}} Taken: {{$taken}} Remaining: {{($leave_have+$adjustment)-$taken}}
MY MONTHLY ATTENDANCE SUMMARY
{{--
--}} {{-- P=Present,D=Delay,E=Extra Delay, L=Leave,LFH=Leave First Half,LSH=Leave Second Half, W=Weekend--}} {{--
--}}
@endsection @section('modal') @endsection @section('script') @endsection