Encounters display with alternating color

fred0 wrote on Saturday, January 12, 2008:

My office manager asked if it were possible to display the encounters list in alternating colors (a la billing and fax/scan views) to facilitate ease of view when you have associated forms and such. I came up with this modest tweak to the interface/patient_file/history/encounters.php file:

$ diff encounters.php encounters.php-orig
159d158
<     $bgcolor = ( $bgcolor===‘ddddff’ ? “ffdddd” : “ddddff”);
209,210c208,209
<    
<     echo “<tr bgcolor=’$bgcolor’>\n”;

>
>     echo “<tr>\n”;
312c311
<         echo “<tr bgcolor=’$bgcolor’>\n”;

>         echo “<tr>\n”;

As ever, if there’s a better way, I will listen to smarter people.

fred0 wrote on Saturday, January 12, 2008:

it also works with the # symbol in the expression, but it doesn’t seem to be necessary:

$bgcolor = ( $bgcolor===’#ddddff’ ? “#ffdddd” : “#ddddff”);

sunsetsystems wrote on Saturday, January 12, 2008:

The # should be included.  If it works without it, that just means your browser figured out what you really meant to do.  Other browsers may not.

Rod
www.sunsetsystems.com

fred0 wrote on Wednesday, September 24, 2008:

If anyone is interested, here’s the tweaks to  nterface/patient_file/history/encounters.php needed in 2.9.0 to get alternating colors in the encounters list:

Line 228:
Insert
$bgcolor = ( $bgcolor===’#ddddff’ ? “#ffdddd” : “#ddddff”);
after the line that says
foreach ($result as $iter ) {

Change line 292 to be:
echo “<tr bgcolor=’$bgcolor’>\n”;

Change line 490 to be:
echo “<tr bgcolor=’$bgcolor’>\n”;