{{ $indicator->name ?: ($indicator->definition ?: 'No title provided.') }}
{{ $pct }}% achieved
@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')
Filter By Donor PortfolioRBMS Dashboard