@section('title', get_setting('site_name') . ' | Approval Center') @push('css') @endpush
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif

{{ __('Approval Center') }}

{{ __('Review pending approvals, track your requests, and search the approval history.') }}

@if(get_setting('supervisor') == 1 || $isAdmin)
{{ number_format($inboxTotal) }}
{{ __('Pending inbox') }}
@endif
{{ number_format($myRequests->total()) }}
{{ __('My requests') }}
{{ number_format($allRecent->total()) }}
{{ __('Recent / filtered') }}
@if($isAdmin)
{{ __('Search & filters') }}

{{ __('Applies to pending inbox and recent requests below.') }}

@elseif(!$isAdmin)
{{ __('Search & filter') }}

{{ __('Filters recent requests and your pending inbox (if you are a supervisor).') }}

@endif @if(get_setting('supervisor') == 1 || $isAdmin)
{{ $isAdmin ? __('Pending requests (admin)') : __('Pending for my approval') }} {{ $inboxTotal }}
{{ __('Page') }} {{ $inbox->currentPage() }} / {{ max($inbox->lastPage(), 1) }}
{{-- Mobile cards --}}
@forelse($inbox as $item)
{{ __('Pending') }} {{ $item->request_type_label }}
{{ $item->subject ?: '—' }}
{{ __('Employee') }}: {{ $this->employeeLine($item->user) }}
{{ __('Department') }}: {{ $item->user?->staff?->department?->name ?? '—' }}
@if($isAdmin)
{{ __('Approver') }}: {{ $this->employeeLine($item->currentApprover) }}
@endif @include('livewire.partials.approval-inbox-actions', ['item' => $item, 'isAdmin' => $isAdmin])
@empty
{{ __('No pending approvals.') }}
@endforelse
{{-- Desktop table --}}
@if($isAdmin) @endif @forelse($inbox as $item) @if($isAdmin) @endif @empty @endforelse
{{ __('Employee') }} {{ __('Department') }} {{ __('Type') }} {{ __('Subject') }}{{ __('Current approver') }}{{ __('Action') }}
{{ $this->employeeLine($item->user) }} {{ $item->user?->staff?->department?->name ?? '—' }} {{ $item->request_type_label }} {{ $item->subject ?: '—' }}{{ $this->employeeLine($item->currentApprover) }} @include('livewire.partials.approval-inbox-actions', ['item' => $item, 'isAdmin' => $isAdmin])
{{ __('No pending approvals.') }}
@if($inbox->hasPages())
{{ $inbox->links() }}
@endif
@endif
{{ __('My requests') }}
{{ $myRequests->total() }} {{ __('total') }}
@forelse($myRequests as $req)
{{ ucfirst($req->status) }} {{ $req->request_type_label }}
{{ $req->subject ?: '—' }}
{{ __('Approver') }}: {{ $this->employeeLine($req->currentApprover) }}
@empty
{{ __('No requests yet.') }}
@endforelse
@forelse($myRequests as $req) @empty @endforelse
{{ __('Type') }} {{ __('Subject') }} {{ __('Status') }} {{ __('Approver') }}
{{ $req->request_type_label }} {{ $req->subject ?: '—' }} {{ ucfirst($req->status) }} {{ $this->employeeLine($req->currentApprover) }}
{{ __('No requests yet.') }}
@if($myRequests->hasPages())
{{ $myRequests->links() }}
@endif
{{ $isAdmin ? __('Recent all requests') : __('Recent requests') }}

{{ __('Showing :count results', ['count' => $allRecent->total()]) }}

@forelse($allRecent as $ar)
{{ ucfirst($ar->status) }} {{ $ar->created_at?->format('Y-m-d H:i') ?? '—' }}
{{ $ar->subject ?: '—' }}
{{ __('Employee') }}: {{ $this->employeeLine($ar->user) }}
{{ __('Department') }}: {{ $ar->user?->staff?->department?->name ?? '—' }}
{{ __('Type') }}: {{ $ar->request_type_label }}
{{ __('Approver') }}: {{ $this->employeeLine($ar->currentApprover) }}
@empty
{{ __('No matching requests.') }}
@endforelse
@forelse($allRecent as $ar) @empty @endforelse
{{ __('Employee') }} {{ __('Department') }} {{ __('Type') }} {{ __('Subject') }} {{ __('Status') }} {{ __('Current approver') }} {{ __('Date') }}
{{ $this->employeeLine($ar->user) }} {{ $ar->user?->staff?->department?->name ?? '—' }} {{ $ar->request_type_label }} {{ \Illuminate\Support\Str::limit($ar->subject ?: '—', 60) }} {{ ucfirst($ar->status) }} {{ $this->employeeLine($ar->currentApprover) }} {{ $ar->created_at?->format('Y-m-d H:i') ?? '—' }}
{{ __('No matching requests.') }}
@if($allRecent->hasPages())
{{ $allRecent->links() }}
@endif
@section('script') @endsection