@extends('layouts.app') @section('page-title', 'Requisitions') @section('content')

Requisitions

Manage and track your coach employment and engagement requests.

New Requisition
@if(session('success')) @endif @if(session('error')) @endif
@if(request('search') || request('filtered')) @endif
@forelse($requisitions as $req) @php $authUser = auth()->user(); $authRole = $authUser->role ? $authUser->role->name : null; $isOwnReq = $authUser->id === $req->requested_by; $myPendingApproval = null; if (!$isOwnReq) { $myPendingApproval = $req->pendingApprovalForRole($authRole); } $statusBg = match($req->status) { 'approved' => 'status-approved', 'not_approved' => 'status-rejected', 'in_review' => 'status-review', 'pending' => 'status-pending', default => 'status-default', }; $rateLabel = null; if ($req->engagement_rate) { $unit = match($req->engagement_type) { 'daily' => '/day', 'hourly' => '/hr', 'fixed' => ' total', default => '', }; $rateLabel = 'KES ' . number_format($req->engagement_rate, 2) . $unit; } @endphp @empty @endforelse
Date Created Requisition Details Requested By Proposed Coaches Status Actions
{{ $req->created_at->format('d M Y') }}
{{ $req->created_at->format('h:i A') }}
{{ $req->title }}
@if($req->start_date && $req->end_date) {{ \Carbon\Carbon::parse($req->start_date)->format('d M') }} – {{ \Carbon\Carbon::parse($req->end_date)->format('d M Y') }} @endif @if($req->engagement_type || $rateLabel) | @endif @if($req->engagement_type) {{ $req->engagement_type }} @endif @if($rateLabel) ({{ $rateLabel }}) @endif
{{ optional($req->user)->name ?? '—' }}
@forelse($req->proposedCoaches as $coach) {{ $coach->full_name }} @empty @endforelse
{{ str_replace('_', ' ', $req->status) }}
@if(($req->status === 'pending' || $authRole === 'Admin') && ($isOwnReq || in_array($authRole, ['Admin', 'Manager']))) @endif @if(!$isOwnReq && $myPendingApproval && in_array($req->status, ['pending', 'in_review'])) Review @endif
No requisitions found matching your criteria.
@if($requisitions->hasPages())
Showing {{ $requisitions->firstItem() }} to {{ $requisitions->lastItem() }} of {{ $requisitions->total() }} entries
{!! $requisitions->appends(request()->query())->links() !!}
@endif
@endsection