Page 1 of 1

Help with School Scoreboard

Posted: Tue Apr 21, 2009 5:18 am
by mighty
Hi PHP Masters

I'm trying to get a scoreboard set up. I seem to have got the scoreboard working and the registering of scores setup. BUT I want some automated css styles applied to all rows in the table depending on what score they achieve, so it would be a bronze silver and gold awards.

so if they did more than 100 press-ups they receive a gold colour above 50 and below 99 would be a silver colour and so on.

I hope everyone understands this.

here is a link to the existing board

http://www.igloo-design.org/08/view_users.php

Re: Help with School Scoreboard

Posted: Tue Apr 21, 2009 5:44 am
by papa
Simple example

Code: Select all

 
 
switch($td) {
 case $tota_score>100:
$td = "gold";
break;
case $total_score>50:
$td = "silver";
break;
default:
$td = "white";
}
 
//loop
echo "<td class=\"$td\">$score</td>\n";