diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 432044c..f852de0 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -3876,17 +3876,36 @@ class Opd extends BaseController if ($painImageHtml === '' && $painIndex !== null) { $labels = ['No Pain', 'Mild', 'Moderate', 'Intense', 'Worst']; - $painImageHtml = '' - . ''; + $colors = ['#22c55e', '#84cc16', '#eab308', '#f97316', '#ef4444']; // green to red gradient + + $painImageHtml = '
'; + + // Row 1: Tick/checkmark indicator above selected level + $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { $active = $painIndex === $i; - $bg = $active ? '#f59e0b' : '#e5e7eb'; - $color = $active ? '#111' : '#4b5563'; - $painImageHtml .= ''; + $tick = $active ? '✓' : ''; + $painImageHtml .= ''; } - $painImageHtml .= ''; + $painImageHtml .= ''; + + // Row 2: Number boxes with color coding + $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { - $painImageHtml .= ''; + $active = $painIndex === $i; + $bg = $active ? $colors[$i] : '#f3f4f6'; + $borderColor = $active ? $colors[$i] : '#d1d5db'; + $color = $active ? '#fff' : '#6b7280'; + $painImageHtml .= ''; + } + $painImageHtml .= ''; + + // Row 3: Labels + $painImageHtml .= ''; + for ($i = 0; $i <= 4; $i++) { + $active = $painIndex === $i; + $fontWeight = $active ? '700' : '400'; + $painImageHtml .= ''; } $painImageHtml .= '
' . $i . '' . $tick . '
' . esc($labels[$i]) . '' . $i . '
' . esc($labels[$i]) . '
'; }