Disable static PNG pain scale images, use dynamic HTML instead

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
This commit is contained in:
DevSoftTech Server 2026-06-06 04:07:16 +05:30
parent e0c44e79b1
commit cad5730182

View File

@ -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 = '<img src="' . esc(str_replace('\\\\', '/', $imagePath)) . '" style="width:300px;height:40px;" />';
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 = '<img src="' . esc(str_replace('\\\\', '/', $imagePath)) . '" style="width:300px;height:40px;" />';
// break;
// }
// }
// }
if ($painImageHtml === '' && $painIndex !== null) {
$labels = ['No Pain', 'Mild', 'Moderate', 'Intense', 'Worst'];