@php use App\Models\Attendance;use App\Models\Leave;use App\Models\LeaveType;use App\Models\SalarySetup;use App\Models\warehouse; @endphp @extends( (auth()->user()->user_type!=='staff') ? 'admin.layouts.app' : 'employee.layouts.app') @section('title',get_setting('site_name').' Employee Profile') @section('content')
{{$staff->user?->name ?? 'Unknown'}}
@if(auth()->user()->user_type!=='staff')  {{__('Edit')}} @endif {{__(' ID Card')}} {{__(' Visiting Card')}}
Profile Details
{{--
--}} {{-- --}} {{--
--}}

{{$staff->user?->name ?? 'Unknown'}}

{{$staff->designation->name}}{{"(".$staff->department->name.")"}}
@php $salary=SalarySetup::where('staff_id',$staff->id)->value('gross_salary') @endphp
Joining Date  {{date('d-m-y',strtotime($staff->joing_date))}}
Job Running   {{services_length($staff->joing_date)}}
Date Of Birth  {{date('d F, Y',strtotime($staff->dob))}}
Branch  {{warehouse::findorfail($staff->warehouse_id)->value('name')}}
Phone  {{$staff->user->phone}}
Email  {{$staff->user->email}}
Salary @if($salary!=null)  {{$salary}} @else @if(auth()->user()->user_type!='staff') @can('Salary-setup') {{__('Not setup yet')}}- {{__('Go to setup')}} @endcan @else {{__('Not setup')}} @endif @endif
@if(auth()->user()->user_type=='staff')
@csrf
@endif
MY STAT

IN TIME

@php $signin=Attendance::where('staff_id',$staff->id)->where('date',date('Y-m-d'))->first()@endphp @if($signin!=null && $signin->signIn!=null)
{{date('h:i A',strtotime($signin->signIn))}}
@endif

OUT TIME

@if($signin!=null &&$signin->signOut!=null)
{{date('h:i A',strtotime($signin->signOut))}}
@endif
Leave Summary
@foreach(LeaveType::where('group_id',$staff->leave_group_id)->get() as $leave_type) @php $adjustment=\App\Models\LeaveAdjustment::where('staff_id', $staff->id) ->where('year',date('Y')) ->where('leave_type_id', $leave_type->id) ->sum('balance'); @endphp @endforeach
{{$leave_type->name}} Allowed: @if (date('Y', strtotime($staff->joing_date)) == date('Y')) {{$leave_have=round(($leave_type->day/12)*(12-date('m',strtotime($staff->joing_date))+1),0)}} @else {{$leave_have=$leave_type->day}} @endif Adjustment: {{$adjustment}} Taken: {{$taken=Leave::where('staff_id',$staff->id)->where('leave_type_id',$leave_type->id)->whereYear('apply_date',\Illuminate\Support\Carbon::now()->year)->where('status',1)->sum('number_of_days')}} Remaining: {{($leave_have+$adjustment)-$taken}}
Attendance Scheduler
Shift Name SignIn Time SignOut Time Delay Time Extra Delay Time
Weekend Summary
Weekend Group Name Sunday Monday Tuesday Wednesday Thursday Friday Saturday
@if($weekend->Sunday==1) @else @endif @if($weekend->Monday==1) @else @endif @if($weekend->Tuesday==1) @else @endif @if($weekend->Wednesday==1) @else @endif @if($weekend->Thursday==1) @else @endif @if($weekend->Friday==1) @else @endif @if($weekend->Saturday==1) @else @endif
@endsection