Ok, I'm apologizing in advance for my ignorance. ;-) I got this app from somewhere else and have modified it some, but I am having one problem that I just cannot seem to fix. I think there are actually two parts to the problem. I'll try to provide all the information needed to try to figure this out. I'm assuming this will be simple but I'm still new to php and no matter what I try, I cannot get it to work.
=======css info==========
.winner {color: #006600;}
.loser {color: #990000;}
=======file info (two parts)==========
// Output TABLE tag and header cells
echo "<table>\n<tr><th>Player</th>\n";
foreach($games as $game) {
echo "<th><small>";
$class = getclass($teams[$game["visitor"]]["teamnick"], $game["winner"]);
echo "<span class=\"$class\">" . $teams[$game["visitor"]]["teamnick"] . "</span>\n";
echo "<br/>@<br/>\n";
$class = getclass($teams[$game["home"]]["teamnick"], $game["winner"]);
echo "<span class=\"$class\">" . $teams[$game["home"]]["teamnick"] . "</span></small></th>\n";
}
echo "</tr>\n";
========second part=======
function getclass($team, $winner) {
global $games;
$class = "";
if ($winner<0 && $winner==$team) {
$class = "winner";
} elseif($winner>0 || $winner!=$team) {
$class = "loser";
}
return $class;
}
The whole purpose of this is to find the winner of a particular game and define a color to that winner (green in this case), if it is not the winner it would make the teams name red. I have taken a screenshot of the page I am working with in hopes that it helps a little bit. Let me know if you need more information, I would be happy to provide it.
Here is the screenshot.

Thanks in advance for your help, I really want to learn what I'm doing wrong.
Nick