@extends('admin.layouts.form') @section('custom_page_style') @endsection @section('content')
@if(session('message'))
{{ session('message') }}
@endif

{!! strtoupper(Auth()->user()->name) !!}

Designation: {!! Auth::user()->employee->designation !!}

Department: {!! Auth::user()->employee->department !!}

@if(\App\Models\TeamLeader::where('user_id',auth()->user()->id)->first())
Team's Leave Application
@php $departments = \App\Models\TeamLeader::where('user_id',auth()->user()->id)->pluck('department'); $all_team_leaders = \App\Models\TeamLeader::groupBy('user_id')->pluck('user_id'); $pending_leave_application = []; $user_ids = \App\Models\Employee::whereIn('department',$departments)->where('user_id','!=',auth()->user()->id)->whereNotIn('user_id',$all_team_leaders)->pluck('user_id'); //return $user_ids; $pending_leave_application = \App\Models\LeaveApplication::orderBy('id','desc')->where('status','Pending')->whereIn('user_id',$user_ids)->paginate(20); @endphp @foreach($pending_leave_application as $i=>$result) @endforeach
Employee Department Leave type Reason From date To date Duration Status Submitted At Option
{!! $result->user->name !!} {!! $result->user->employee->department !!} {!! $result->leave_type !!} {!! $result->reason !!} {!! $result->from_date !!} {!! $result->to_date !!} {!! $result->duration !!} @if($result->status == 'Approved') {!! $result->status !!} @elseif($result->status == 'Rejected') {!! $result->status !!} @elseif($result->status == 'Pending') {!! $result->status !!} @endif {!! $result->created_at->toDateString() !!} {!! Form::select('leave_type', ['Approved'=>'Approved', 'Rejected'=>'Rejected'], $result->status, ['class'=>'form-control selectpicker', 'required'=>'true', 'v-model'=>'selectedStatus', '@change'=>'on_update_status('.$result->id.')','placeholder'=>'--Please Select--']) !!}
@endif @if(auth()->user()->employee->designation == 'CEO') @php $team_leader_ids = \App\Models\TeamLeader::pluck('user_id'); //print_r($team_leader_ids); $pending_leave_application = \App\Models\LeaveApplication::orderBy('id','desc')->where('status','Pending')->whereIn('user_id',$team_leader_ids)->paginate(20); @endphp @if(count($pending_leave_application) > 0)
Team leader's Leave Application
@foreach($pending_leave_application as $i=>$result) @endforeach
Employee Department Leave type Reason From date To date Duration Status Submitted At Option
{!! $result->user->name !!} {!! $result->user->employee->department !!} {!! $result->leave_type !!} {!! $result->reason !!} {!! $result->from_date !!} {!! $result->to_date !!} {!! $result->duration !!} @if($result->status == 'Approved') {!! $result->status !!} @elseif($result->status == 'Rejected') {!! $result->status !!} @elseif($result->status == 'Pending') {!! $result->status !!} @endif {!! $result->created_at->toDateString() !!} {!! Form::select('leave_type', ['Approved'=>'Approved', 'Rejected'=>'Rejected'], $result->status, ['class'=>'form-control selectpicker', 'required'=>'true', 'v-model'=>'selectedStatus', '@change'=>'on_update_status('.$result->id.')','placeholder'=>'--Please Select--']) !!}
@endif @endif
Welcome on Board
Name Designation Department
My Leave Balance
@if(auth()->user()->employee->gender == 'Male') @else @endif
Type Opening Avail Balance
Casual Leave {!! $leave_details['casual_leave']['opening'] !!} {!! $leave_details['casual_leave']['applied'] !!} {!! $leave_details['casual_leave']['balance'] !!}
Sick Leave {!! $leave_details['sick_leave']['opening'] !!} {!! $leave_details['sick_leave']['applied'] !!} {!! $leave_details['sick_leave']['balance'] !!}
Earned Leave {!! $leave_details['earned_leave']['opening'] !!} {!! $leave_details['earned_leave']['applied'] !!} {!! $leave_details['earned_leave']['balance'] !!}
Paternal Leave for 1st Child {!! $leave_details['paternal_leave_for_first_child']['opening'] !!} {!! $leave_details['paternal_leave_for_first_child']['applied'] !!} {!! $leave_details['paternal_leave_for_first_child']['balance'] !!}
Paternal Leave for 2nd Child {!! $leave_details['paternal_leave_for_second_child']['opening'] !!} {!! $leave_details['paternal_leave_for_second_child']['applied'] !!} {!! $leave_details['paternal_leave_for_second_child']['balance'] !!}
Maternity Leave for 1st Child {!! $leave_details['maternity_leave_for_first_child']['opening'] !!} {!! $leave_details['maternity_leave_for_first_child']['applied'] !!} {!! $leave_details['maternity_leave_for_first_child']['balance'] !!}
Maternity Leave for 2nd Child {!! $leave_details['maternity_leave_for_second_child']['opening'] !!} {!! $leave_details['maternity_leave_for_second_child']['applied'] !!} {!! $leave_details['maternity_leave_for_second_child']['balance'] !!}
Work From Home {!! $leave_details['applied_work_from_home']['opening'] !!} {!! $leave_details['applied_work_from_home']['applied'] !!} {!! $leave_details['applied_work_from_home']['balance'] !!}
Non Paid Leave {!! $leave_details['applied_non_paid_leave']['opening'] !!} {!! $leave_details['applied_non_paid_leave']['applied'] !!} {!! $leave_details['applied_non_paid_leave']['balance'] !!}
@endsection @section('custom_page_script') @endsection