From a5ccd71714984386ab5b5da12b9c64c92238516b Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 03:11:25 +0530 Subject: [PATCH] Enhance pain scale image with visual tick indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add checkmark (✓) above the selected pain intensity level - Use color gradient from green (No Pain) to red (Worst) for better visual clarity - Highlight selected level with colored background and white text - Thicker border on selected level for better emphasis - Bold label text for selected intensity - Makes pain scale selection immediately visible in printed/PDF prescriptions --- app/Controllers/Opd.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) 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]) . '
'; }