@extends('layouts.app') @section('title', ($workerType ?? 'locum') === 'volunteer' ? 'Volunteers' : 'Locum Register') @section('content') @php $isVolunteersView = ($workerType ?? 'locum') === 'volunteer'; @endphp @include('locum.partials.payroll-tabs', ['active' => $isVolunteersView ? 'volunteers' : 'register']) {{-- Type tabs (Locums | Volunteers) --}}
Locums @if(isset($stats['paid_count'])) ({{ $stats['paid_count'] }}) @endif Volunteers @if(isset($stats['volunteer_count'])) ({{ $stats['volunteer_count'] }}) @endif
@if(request()->hasAny(['search','status','department_id'])) Clear @endif
@if($isVolunteersView) + Register Volunteer @else + Register Locum @endif
@if(!$isVolunteersView && Auth::user()->activeRoleName() !== 'Receptionist') @endif @forelse($locums as $locum) @php $rowIsVol = ($locum->worker_type ?? 'locum') === 'volunteer'; @endphp @if(!$isVolunteersView && Auth::user()->activeRoleName() !== 'Receptionist') @endif @empty @endforelse
{{ $isVolunteersView ? 'Volunteer No.' : 'Staff No.' }} Name Role Department License PhoneRateActions
{{ $locum->staff_number ?? '-' }} {{ $locum->full_name }} @if($rowIsVol)V@endif {{ $locum->role_designation ?? '-' }} {{ $locum->department->name ?? '-' }} @if($locum->license_no) {{ $locum->license_no }} @if($locum->license_expiry)
@if($locum->is_license_expired) Expired {{ $locum->license_expiry->format('d M Y') }} @elseif($locum->is_license_expiring_soon) Exp {{ $locum->license_expiry->format('d M Y') }} @else Exp {{ $locum->license_expiry->format('d M Y') }} @endif @endif @else — @endif
{{ $locum->phone ?? '-' }} @if($locum->rate_type==='percentage'){{ $locum->default_rate }}%@else KES {{ number_format($locum->default_rate) }}/shift @endif
View Edit
@csrf @method('PUT')
{{-- Convert buttons (locum↔volunteer, locum→staff) live on the Edit page only — keeping the table row clean. --}}
No {{ $isVolunteersView ? 'volunteers' : 'locums' }} registered yet. Click "+ Register {{ $isVolunteersView ? 'Volunteer' : 'Locum' }}" to add.
@if($locums->hasPages())
{{ $locums->links() }}
@endif
@endsection