@extends('layout.admin') @section('head') @extends('layout.header') @section('header_title', 'Leaves') @endsection @section('content')

Leaves

@if (!empty($isAdmin)) Record time off for your team. Pending requests appear in the schedule only after they are approved. @if (!empty($canApproveLeave)) Use New leave request to add a row, then approve or reject from the list. @else You can add requests, but only users assigned under Settings → Leave settings can approve or reject. @endif @else Submit your own leave requests here. An administrator will approve or reject them. You can edit or delete pending requests only. @endif

@if (empty($isAdmin) && isset($leaveBalanceRows) && $leaveBalanceRows->isNotEmpty())

Leave balance

Monthly types refresh on the 1st; yearly types on your joining-date anniversary.
@foreach ($leaveBalanceRows as $bal) @php $bd = (float) $bal->balance_days; $bdStr = rtrim(rtrim(number_format($bd, 2, '.', ''), '0'), '.'); if ($bdStr === '') { $bdStr = '0'; } @endphp {{ $bal->leaveType->name ?? '—' }}: {{ $bdStr }} d @endforeach
@endif

{{ !empty($isAdmin) ? 'All leave requests' : 'My leave requests' }}

Sorted by start date in the table below
@forelse ($leaves as $leave) @php $pending = !$leave->approved_at && !$leave->rejected_at; @endphp @empty @endforelse
# Employee Type Dates Half day Description Status Approver Actions
{{ $loop->iteration }} {{ $leave->employee->Full_Name }} {{ $leave->leave_type }} {{ $leave->start_date }} {{ $leave->end_date }} @if ($leave->half_day == 1 || $leave->half_day === '1') Half — {{ $leave->half_day_type ?? '—' }} @else Full day @endif {{ \Illuminate\Support\Str::limit($leave->description, 48) }} @if ($leave->approved_at) Approved @elseif ($leave->rejected_at) Rejected @else Pending @endif @if ($pending) Awaiting approval {{ $pendingApproverLabel }} @else {{ optional($leave->user)->Name ?? '—' }} @endif
@if ($pending) @endif @if (!empty($canApproveLeave) && $pending) @endif
No leave records yet. Click New leave request to add the first one.
{{-- Add leave (same field IDs as leaves.js) --}} @endsection @section('script') @endsection