This topic is locked

Conditional Statements

2/25/2013 7:45:18 PM
PHPRunner General questions
L
lkh11lkh author

hi admin

if ($data["Status"]=='Deceased')

$record["Status_style"].='style="background:yellow"';


i have this problem in conditional statements
status consists of deceased, uncontactable, present
i want to be as follow

if deceased, it will be in yellow colour

if uncontactable, it will be in green colour

if present, it will be in pink colour
my question is how do i code using

if ($data["Status"]=='Deceased')

$record["Status_style"].='style="background:yellow"';
please advise with thanks

Sergey Kornilov admin 2/26/2013

There is an example in the comments section at http://xlinesoft.com/blog/2011/01/03/tutorial_conditional_formatting/ that shows the similar technique:

if ($data["pt42"] == "R/-197")

{

$record["pt42_style"].='style="background:yellow"';

}

elseif ($data["pt42"] == "S10/258")

{

$record["pt42_style"].='style="background:white"';

}