@extends(request()->has('_sphf_partial') ? 'theme.sphf.layouts.partial' : 'theme.sphf.layouts.app') @php $rbmfNumberValue = static function ($value) { return ($value !== null && $value !== '' && is_numeric($value)) ? (float) $value : null; }; $rbmfFormatValue = static function ($value) { if ($value === null || $value === '') { return '-'; } if (! is_numeric($value)) { return $value; } $raw = trim((string) $value); $decimals = 0; if (str_contains($raw, '.')) { $fraction = rtrim(substr($raw, strpos($raw, '.') + 1), '0'); $decimals = min(strlen($fraction), 4); } return number_format((float) $value, $decimals); }; $rbmfProgress = static function ($current, $target) use ($rbmfNumberValue) { $currentNumber = $rbmfNumberValue($current); $targetNumber = $rbmfNumberValue($target); if ($currentNumber === null || $targetNumber === null || $targetNumber <= 0) { return 0; } return min(100, round(($currentNumber / $targetNumber) * 100, 1)); }; $rbmfDonorTone = static function ($name) { $name = strtolower((string) $name); if (str_contains($name, 'world')) { return '#2563eb'; } if (str_contains($name, 'adb')) { return '#10b981'; } if (str_contains($name, 'isdb') || str_contains($name, 'islamic')) { return '#f97316'; } return '#0a9a4c'; }; @endphp @section('content')

RBMS Dashboard

Filter By Donor Portfolio

@foreach($donorFilters ?? [] as $donorFilter) @endforeach
@foreach(['pdo' => $pdo ?? collect(), 'iri' => $iri ?? collect()] as $levelKey => $indicators) @forelse($indicators as $indicator) @php $pct = $rbmfProgress($indicator->computed_result, $indicator->end_target); $prefix = strtoupper($levelKey); @endphp
{{ $prefix }}-{{ str_pad((string) $loop->iteration, 2, '0', STR_PAD_LEFT) }} {{ strtoupper($indicator->donor?->name ?? 'No Donor') }}

{{ $indicator->name ?: ($indicator->definition ?: 'No title provided.') }}

Current {{ $rbmfFormatValue($indicator->computed_result) }}
Target {{ $rbmfFormatValue($indicator->end_target) }}

{{ $pct }}% achieved

@empty
No {{ strtoupper($levelKey) }} indicators found.
@endforelse @endforeach
No indicators found for the selected donor.
@endsection @section('scripts') @endsection