@extends('layouts.admin') @section('page-title') {{__('Manage Leave')}} @endsection @section('breadcrumb') @endsection @section('action-btn')
@can('create leave') @endcan
@endsection @section('content')
@if(\Auth::user()->type != 'Employee') @endif @can('edit leave') @endcan @foreach ($leaves as $item) @if(\Auth::user()->type != 'Employee') @endif @endforeach
{{ __('Employee') }}{{ __('Leave Type') }} {{ __('Applied On') }} {{ __('Start Date') }} {{ __('End Date') }} {{ __('Total Days') }} {{ __('Leave Reason') }} {{ __('Status') }}{{ __('Action') }}
{{ !empty($item->employees) ? $item->employees->name : '-' }}{{ !empty($item->leaveType) ? $item->leaveType->title : '-' }} {{ \Auth::user()->dateFormat($item->applied_on) }} {{ \Auth::user()->dateFormat($item->start_date) }} {{ \Auth::user()->dateFormat($item->end_date) }} {{ $item->total_leave_days }} {{ $item->leave_reason }} @if($item->status == 'Pending')
{{ $item->status }}
@elseif($item->status == 'tl_approved')
{{ __('TL Approved') }}
@elseif($item->status == 'Approved')
{{ $item->status }}
@elseif($item->status == 'Reject')
{{ $item->status }}
@endif
@if(\Auth::user()->type == 'team_leader' && $item->status == 'Pending') @elseif(\Auth::user()->type == 'reporting_manager' && $item->status == 'tl_approved') @endif @if(\Auth::user()->type == 'Employee') @if(in_array($item->status, ['Pending', 'Reject'])) @can('edit leave') @endcan @endif @else @can('edit leave') @endcan @endif @can('delete leave')
{!! Form::open(['method' => 'DELETE', 'route' => ['leave.destroy', $item->id], 'id' => 'delete-form-'.$item->id]) !!} {!! Form::close() !!}
@endcan
@endsection @push('script-page') @endpush