@extends('layouts.portal') @section('title', 'Intern Dashboard') @use('App\Models\InternEvaluation', 'E') @use('App\Models\InternHospitalAllocation', 'Allocation') @php /** @var \App\Support\Internship $internship */ $assigned = $current?->hasConsultant(); $progress = $internship->progressPercent(); $locked = $internship->lockedCount(); $next = $internship->nextStep(); $first = $internship->first(); // Tailwind needs full class names. $tones = [ 'blue' => ['icon' => 'bg-blue-600 text-white shadow-blue-600/30', 'bar' => 'from-blue-600 to-sky-400', 'text' => 'text-blue-700'], 'orange' => ['icon' => 'bg-orange-500 text-white shadow-orange-500/30', 'bar' => 'from-orange-500 to-amber-400', 'text' => 'text-orange-700'], 'indigo' => ['icon' => 'bg-indigo-600 text-white shadow-indigo-600/30', 'bar' => 'from-indigo-600 to-blue-400', 'text' => 'text-indigo-700'], 'amber' => ['icon' => 'bg-amber-500 text-white shadow-amber-500/30', 'bar' => 'from-amber-500 to-yellow-300', 'text' => 'text-amber-700'], 'emerald' => ['icon' => 'bg-emerald-500 text-white shadow-emerald-500/30','bar' => 'from-emerald-500 to-teal-400', 'text' => 'text-emerald-700'], 'slate' => ['icon' => 'bg-slmc text-white shadow-slmc/30', 'bar' => 'from-slate-400 to-slate-200', 'text' => 'text-slate-600'], ]; $tone = $tones[$next['tone']]; $milestone = function (array $slot): string { $s = $slot['evaluation']?->status; return match (true) { $s === E::LOCKED => 'border-emerald-500 bg-emerald-500 text-white', $s === E::RETURNED_TO_INTERN => 'border-orange-500 bg-orange-500 text-white', in_array($s, [E::WITH_CONSULTANT, E::RETURNED_TO_CONSULTANT, E::WITH_DIRECTOR], true) => 'border-indigo-600 bg-indigo-600 text-white', $slot['open'] => 'border-blue-500 bg-white text-blue-700', default => 'border-slate-300 bg-white text-slate-400', }; }; $ring = 2 * M_PI * 44; @endphp {{-- ═════════════ HERO (inside the navy banner) ═════════════ --}} @section('hero')
{{ $user->initials() }} $assigned, 'bg-amber-400' => ! $assigned])>
Intern Medical Officer

{{ $user->name }}

@if($user->registration_no) SLMC Reg. {{ $user->registration_no }} @endif @if($current) {{ $current->hospital->name }} @endif @if(! $current) Awaiting hospital allocation @elseif(! $assigned) Awaiting consultant @else {{ $current->periodLabel() }} in progress @endif
@if($current)
{{ $progress }}% of year
Submitted to SLMC
{{ $locked }} / 4 evaluations
Days remaining
{{ number_format($internship->daysRemaining()) }}
Completes on
{{ $internship->endsOn()->format('j M Y') }}
@endif
@endsection @section('content') {{-- ═════════════ YOUR NEXT STEP ═════════════ --}}

Your next step · {{ $next['eyebrow'] }}

{{ $next['title'] }}

{{ $next['text'] }}

@if($next['cta']) {{ $next['cta'] }} @endif
@if($next['evaluation'] && $next['evaluation']->status !== E::DRAFT)
@include('partials.evaluation.stepper', ['evaluation' => $next['evaluation']])
@endif
@if(! $current) {{-- ═════════════ NOT YET ALLOCATED ═════════════ --}}

What happens next

Your one-year internship journey

    @foreach([ ['ri-government-line', 'Ministry of Health', 'Allocates your first six-month internship hospital following your appointment to the SLMC.'], ['ri-user-shared-line', 'Hospital Director', 'Assigns your Supervisory Consultant, unit and later your second six-month placement.'], ['ri-file-list-3-line', 'Evaluations', 'Four quarterly evaluations — two in each six-month period — submitted to SLMC.'], ] as [$icon, $title, $text])
  1. {{ $loop->iteration }}

    {{ $title }}

    {{ $text }}

  2. @endforeach
@else {{-- ═════════════ INTERNSHIP JOURNEY TIMELINE ═════════════ --}}

Internship journey

One year · two six-month periods · four evaluations

With SLMC Under review Open Upcoming
{{-- Period labels --}}
@foreach([1, 2] as $p) @php $a = $internship->periods[$p]; @endphp

P{{ $p }} · {{ Allocation::PERIOD_LABELS[$p] }}

{{ $a?->hospital->name ?? 'Placement not assigned yet' }}

@endforeach
{{-- Track --}}
@unless($internship->second())
@endunless {{-- Today --}} Today {{-- Evaluation milestones at the end of each quarter --}}
@foreach($schedule as $slot)
@if($slot['evaluation']?->isLocked())@else Q{{ $slot['quarter'] }}@endif
@endforeach
{{-- Milestone labels --}}
@foreach($schedule as $slot)

Evaluation {{ $slot['quarter'] }}

{{ $slot['evaluation']?->statusLabel() ?? ($slot['open'] ? 'Ready to start' : 'Upcoming') }}

@endforeach
{{-- ═════════════ PLACEMENTS ═════════════ --}}
@foreach([1, 2] as $p) @php $a = $internship->periods[$p]; $isCurrent = $a && $current->is($a); $director = $a?->hospital->currentDirectors->first(); $transferred = $p === 2 && $a && $first && $a->hospital_id !== $first->hospital_id; @endphp
$isCurrent])> {{-- Header --}}
$a, 'bg-slate-200 text-slate-500' => ! $a])>P{{ $p }} {{ Allocation::PERIOD_LABELS[$p] }} @if($isCurrent) Current @elseif($a && $a->endsOn()->isPast()) Completed @elseif($a) Upcoming @endif
@if($a)

{{ $a->hospital->name }}

@if($a->hospital->district) {{ $a->hospital->district }}@endif {{ $a->starts_on->format('j M Y') }} – {{ $a->endsOn()->format('j M Y') }}
@if($transferred)

Transferred from {{ $first->hospital->name }}

@endif @else

Not assigned yet

Evaluations 3 and 4

@endif
@if($a) {{-- Unit & specialty --}}
@foreach([['ri-layout-grid-line', 'Unit', $a->unit], ['ri-heart-pulse-line', 'Specialty', $a->specialty]] as [$icon, $label, $value])

{{ $label }}

{{ $value ?: 'To be assigned' }}

@endforeach
{{-- People --}}
@if($a->consultant)
{{ $a->consultant->initials() }}

{{ $a->consultant->name }}

Supervisory Consultant

@else

Consultant not assigned

Awaiting Hospital Director

@endif
{{ $director?->initials() ?: '—' }}

{{ $director?->name ?? 'Not recorded' }}

Hospital Director

@else

Placement to be confirmed

Your second six-month placement will be assigned by your current Hospital Director. Most interns continue at the same hospital; if you move, the new hospital's Director assigns your consultant.

@endif {{-- Evaluations in this period --}}
@foreach(array_filter($schedule, fn ($s) => $s['period'] === $p) as $slot) @php $e = $slot['evaluation']; @endphp
$slot['open'], 'border-dashed border-slate-200 bg-slate-50/70' => ! $slot['open']])> Q{{ $slot['quarter'] }}
@if($e?->isLocked())@elseif(! $slot['open'])@else Q{{ $slot['quarter'] }}@endif

Evaluation {{ $slot['quarter'] }}

{{ $slot['starts'] ? $slot['starts']->format('j M').' – '.$slot['ends']->format('j M Y') : 'Dates pending' }}

@if($e) @include('partials.evaluation.status-badge', ['evaluation' => $e]) @elseif($slot['open']) Ready to start @else {{ $slot['reason'] }} @endif
@if($slot['open']) {{ ! $e ? 'Start evaluation' : ($e->editableByIntern() ? ($e->status === E::RETURNED_TO_INTERN ? 'Make changes' : 'Continue draft') : 'View evaluation') }} @endif
@endforeach
@endforeach
{{-- ═════════════ HOW IT WORKS ═════════════ --}}

Approval process

How each evaluation reaches SLMC

    @foreach([ ['ri-user-heart-line', 'You submit', 'Complete your progress report and submit it to your consultant.', 'bg-blue-600'], ['ri-stethoscope-line', 'Consultant reviews', 'Edits and approves, or returns it to you for changes.', 'bg-indigo-600'], ['ri-hospital-line', 'Director verifies', 'Edits and approves, or returns it to the consultant.', 'bg-slmc'], ['ri-lock-2-line', 'Submitted to SLMC', 'Once the Director approves, it is sent to SLMC and locked.', 'bg-emerald-500'], ] as [$icon, $title, $text, $bg])
  1. {{ $loop->iteration }}. {{ $title }}

    {{ $text }}

  2. @endforeach
@endif @endsection