Forums

PHP

This topic is locked

Setting dynamic links to a speciffic colour

Posted 15 Sep 2009 18:28:59
1
has voted
15 Sep 2009 18:28:59 john henderson posted:
Hi,

I wonder if any one can help me? [:I]

I have a php/mysql page that displays a list of house numbers, for example 1 to 10 that require work completing;

There is a case where some of these house numbers have already had the work completed, but will require inspection of the completed work.

Its been suggested to me that I should set the house numbers (font colour) to red or purple if they require inspection. This simple effect will visually inform the workers that they don’t need to look at that record because the work has been completed. But, will inform the inspectors to look at the record and fill in the relevant details.

I am able to perform the search for property numbers, but depending on the sql code (inspect_property=1) set the property number to the correct colour otherwise leave it at the default colour.

Hope that helps, but if you need more information I am happy to oblige

thanks

John


Replies

Replied 16 Sep 2009 18:07:41
16 Sep 2009 18:07:41 Patrick Julicher replied:
Hi John,

I'm not familiar with PHP, only ASP but what you could do is use an If.....Then....Else statement somewhat like this:

If inspect_property=1 Then show show housenumber with specific style1
Else If inspect_property=2 Then show show housenumber with specific style2
Else If inspect_property=3 Then show show housenumber with specific style3
Else show show housenumber with default style
End

Hope this makes any sense!

Kind regards, Patrick
Replied 14 Oct 2009 12:43:56
14 Oct 2009 12:43:56 Alan C replied:
try applying a span class to the appropriate house numbers as you generate them, the css should then make those links a different colour.

you would do something like . . .

in the css set up a class .alreadyDone{ . . . .}

then in the php . . .

if done, echo a span tag with that class, then close the tag after the link

Reply to this topic