Hello,
Firstly, thank you for a fantastic compnent! :mrgreen:
On to business...
I am trying to accomplish the following 'simple' scenario, and yet it just doesn't want to play fair!
I have a MySQL table with a column "call_prior" (which defines call priorty) with priorities being high to low, 1-5.
My goal is trying to get the numerical value of call_prior to equal a text translation ("1" = "Emergency")..and later be represented by differing colours.
My code is this: in header -
And then I have my table column echoing $priority. - body:
The problem I have is the script runs to the "else" statement regardless of what $priority equals. I have tried changing MySQL columns to int, or varchar (default INT) with no effect. the only time I can get the desired result is if I declare the variable absolutely (i.e $priority = "1")
If I remove the if and else statements, I get the numerical values accordingly.
Any help would be appreciated.
Regards,
CJ
Firstly, thank you for a fantastic compnent! :mrgreen:
On to business...
I am trying to accomplish the following 'simple' scenario, and yet it just doesn't want to play fair!
I have a MySQL table with a column "call_prior" (which defines call priorty) with priorities being high to low, 1-5.
My goal is trying to get the numerical value of call_prior to equal a text translation ("1" = "Emergency")..and later be represented by differing colours.
My code is this: in header -
< ?php
$priority = "{call_prior}";
if ($priority == "1") {$priority = "EMERGENCY";}
elseif ($priority == "2") {$priority = "ASAP";}
elseif ($priority == "3") {$priority = "HIGH";}
elseif ($priority == "4") {$priority = "MED";}
elseif ($priority == "5") {$priority = "LOW";}
else { $priority = "I am unsure of the priority";}
?>
And then I have my table column echoing $priority. - body:
<tr align='center' style='white-space: nowrap;'>
<td style='border-right: 1px dotted #ccc;'><?php echo $priority; ?></td>
<td>{call_logg1}</td>
<td>{call_id}</td>
etc.
The problem I have is the script runs to the "else" statement regardless of what $priority equals. I have tried changing MySQL columns to int, or varchar (default INT) with no effect. the only time I can get the desired result is if I declare the variable absolutely (i.e $priority = "1")
If I remove the if and else statements, I get the numerical values accordingly.
Any help would be appreciated.
Regards,
CJ