From a047955c7c6784bf00bea30ed9f9b7583db56bdc Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 04:14:12 +0530 Subject: [PATCH] Add emojis to pain scale for clear black & white printing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLEM: Color coding not visible in black & white printers SOLUTION: - Added emoji indicators: 😊 😐 😣 😖 😭 for pain levels 0-4 - Changed colors to black/white/gray for B&W compatibility - Emoji shows above selected pain level (larger size) - Bold 3px border on selected box (visible in B&W) - Light gray background on selected box Now pain scale is clear even in monochrome printing! --- app/Controllers/Opd.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 4d34eef..8282395 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -3880,30 +3880,31 @@ class Opd extends BaseController if ($painImageHtml === '' && $painIndex !== null) { $labels = ['No Pain', 'Mild', 'Moderate', 'Intense', 'Worst']; - $colors = ['#22c55e', '#84cc16', '#eab308', '#f97316', '#ef4444']; // green to red gradient + $emojis = ['😊', '😐', '😣', '😖', '😭']; // Visual indicators for black & white printing // Add debug info at top showing which pain level is selected $painImageHtml = '
Pain Level: ' . $painIndex . ' - ' . esc($labels[$painIndex]) . '
'; $painImageHtml .= ''; - // Row 1: Down arrow indicator above selected level (more visible than checkmark) + // Row 1: Emoji indicators (visible in black & white printing) $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { $active = ($painIndex === $i); - $arrow = $active ? '▼' : ' '; - $painImageHtml .= ''; + $emoji = $active ? $emojis[$i] : ' '; + $fontSize = $active ? '24px' : '16px'; + $painImageHtml .= ''; } $painImageHtml .= ''; - // Row 2: Number boxes with strong color coding and border + // Row 2: Number boxes with bold border for selected (visible in B&W) $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { $active = ($painIndex === $i); - $bg = $active ? $colors[$i] : '#ffffff'; - $borderColor = $active ? '#000000' : '#d1d5db'; + $bg = $active ? '#e5e5e5' : '#ffffff'; // Light gray for selected (visible in B&W) + $borderColor = '#000000'; $borderWidth = $active ? '3px' : '1px'; - $color = $active ? '#ffffff' : '#374151'; + $color = '#000000'; $painImageHtml .= ''; } $painImageHtml .= ''; @@ -3913,9 +3914,8 @@ class Opd extends BaseController for ($i = 0; $i <= 4; $i++) { $active = ($painIndex === $i); $fontWeight = $active ? '700' : '400'; - $textColor = $active ? '#000000' : '#6b7280'; $fontSize = $active ? '9px' : '8px'; - $painImageHtml .= ''; + $painImageHtml .= ''; } $painImageHtml .= '
' . $arrow . '' . $emoji . '
' . $i . '
' . esc($labels[$i]) . '' . esc($labels[$i]) . '
'; }