Re: control panel--graphic question
| From: | Don Read | Date: | Fri, 02 Apr 2004 21:26:39 +0000 |
| Subject: | Re: control panel--graphic question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182189@lists.php.net to get a copy of this message | ||
On 02-Apr-2004 Leonard B Burton wrote:
> Greetings,
>
> This is more of a graphic question
>
> For a program I am writting I need to have a control panel to display
> anything that may be wrong. I would like to use something like a
> stoplight so that it would be easily understood by a lay person.
> Does anyone have any comments as to what they have used? Also does
> anyone have a function/graphic that would be a stop light and
> changing the var would make it either show red, green, or yellow?
>
function stoplight($val) {
$light = array(
'ok' => 'images/green.jpg',
'iffy' => 'images/yellow.jpg',
'bad' => 'images/red.jpg'
);
echo '<img src="' .$light[$val] .'" height="xxx"
width="xxx">';
}
...
stoplight( $foo < 10 ? 'ok' : $foo > 25 ? 'bad' : 'iffy' );
Regards,
--
Don Read dread@ispwest.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.