From cad573018271212a6eaa5e9cf1652fba44e3c48c Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 04:07:16 +0530 Subject: [PATCH] Disable static PNG pain scale images, use dynamic HTML instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLEM: Static pains_scale_0-4.png files all look identical (just gradient) so users can't tell which pain level is selected. SOLUTION: Comment out PNG file checking code to force use of dynamic HTML with arrow indicator, colored backgrounds, and bold borders. Now {{painscale_img}} will show: - Debug line: 'Pain Level: X - Label' - Down arrow (▼) above selected level - Colored background (green to red) on selected box - Bold 3px border on selected box - Different pain values will have visibly different displays --- app/Controllers/Opd.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 9e2692f..4d34eef 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -3862,20 +3862,21 @@ class Opd extends BaseController $painIndex = ($painValue !== null && $painValue >= 0 && $painValue <= 4) ? $painValue : null; $painImageHtml = ''; + // DISABLED: Static PNG images don't show which level is selected - use dynamic HTML instead // Only generate image if pain_value is actually set - if ($painIndex !== null) { - $imageCandidates = [ - FCPATH . 'assets/images/pains_scale_' . $painIndex . '.png', - FCPATH . 'assets/images/pains_scale.png', - ]; - - foreach ($imageCandidates as $imagePath) { - if (is_file($imagePath)) { - $painImageHtml = ''; - break; - } - } - } + // if ($painIndex !== null) { + // $imageCandidates = [ + // FCPATH . 'assets/images/pains_scale_' . $painIndex . '.png', + // FCPATH . 'assets/images/pains_scale.png', + // ]; + // + // foreach ($imageCandidates as $imagePath) { + // if (is_file($imagePath)) { + // $painImageHtml = ''; + // break; + // } + // } + // } if ($painImageHtml === '' && $painIndex !== null) { $labels = ['No Pain', 'Mild', 'Moderate', 'Intense', 'Worst'];