Help with School Scoreboard

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mighty
Forum Newbie
Posts: 4
Joined: Thu Jan 29, 2009 6:09 am

Help with School Scoreboard

Post 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
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Help with School Scoreboard

Post 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";
 
 
 
Post Reply