@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $typeLabels = [ 'annual' => $isRtl ? 'سنوية' : 'Annual', 'sick' => $isRtl ? 'مرضية' : 'Sick', 'unpaid' => $isRtl ? 'بدون راتب' : 'Unpaid', 'maternity' => $isRtl ? 'أمومة' : 'Maternity', 'paternity' => $isRtl ? 'أبوة' : 'Paternity', 'emergency' => $isRtl ? 'طارئة' : 'Emergency', 'other' => $isRtl ? 'أخرى' : 'Other', ]; $statusColors = [ 'pending' => 'bg-amber-100 text-amber-700', 'approved' => 'bg-emerald-100 text-emerald-700', 'rejected' => 'bg-rose-100 text-rose-700', ]; $statusLabels = [ 'pending' => $isRtl ? 'معلقة' : 'Pending', 'approved' => $isRtl ? 'مقبولة' : 'Approved', 'rejected' => $isRtl ? 'مرفوضة' : 'Rejected', ]; @endphp @section('title', $isRtl ? 'الإجازات' : 'Leaves') @section('content')

{{ $isRtl ? 'الإجازات' : 'Leaves' }}

{{ $isRtl ? 'طلبات الإجازات والموافقات' : 'Leave requests and approvals' }}

{{ $isRtl ? 'معلقة:' : 'Pending:' }} {{ $pendingCount ?? 0 }}

{{ $isRtl ? 'طلب إجازة' : 'Request Leave' }}

@csrf
{{ $isRtl ? 'إعادة ضبط' : 'Reset' }}
@forelse($leaves as $leave) @empty @endforelse
{{ $isRtl ? 'الموظف' : 'Employee' }} {{ $isRtl ? 'النوع' : 'Type' }} {{ $isRtl ? 'الفترة' : 'Period' }} {{ $isRtl ? 'الأيام' : 'Days' }} {{ $isRtl ? 'الحالة' : 'Status' }} {{ $isRtl ? 'إجراءات' : 'Actions' }}

{{ $leave->employee->full_name ?? '—' }}

{{ $leave->employee->employee_id ?? '' }}

{{ $typeLabels[$leave->leave_type] ?? $leave->leave_type }} {{ $leave->start_date?->format('Y-m-d') }} → {{ $leave->end_date?->format('Y-m-d') }} {{ $leave->days }} {{ $statusLabels[$leave->status] ?? $leave->status }}
@if($leave->status === 'pending')
@csrf
@else @endif

{{ $isRtl ? 'رفض الإجازة' : 'Reject Leave' }}

{{ $leave->employee->full_name ?? '' }}

@csrf
{{ $isRtl ? 'لا توجد طلبات' : 'No requests' }}
@if($leaves->hasPages())
{{ $leaves->withQueryString()->links() }}
@endif
@endsection