Logo

zurück

info("clicked showAllUsersGroupRankTipps.php5"); printGroupRanks(); function getUserInfo($username){ $tableusers=dbschema::users; $sql="SELECT * from $tableusers WHERE username='$username'"; $resultUser=mysql_query($sql); $array=mysql_fetch_array($resultUser); $firstname=$array["firstname"]; $lastname=$array["lastname"]; return "$firstname $lastname"; } function printGroupRanks(){ echo "

Platzierungs-Tipps

"; $table_teams=dbschema::teams; $sql="SELECT * FROM $table_teams t ORDER BY t.group, t.shortname"; $sqlResult=mysql_query($sql); echo "
"; echo ""; echo ""; echo " "; while($array=mysql_fetch_array($sqlResult)){ $group = $array["group"]; echo ""; } echo ""; echo ""; echo ""; $sqlResult=mysql_query($sql); while($array=mysql_fetch_array($sqlResult)){ $teamName=$array["shortname"]; echo ""; } echo ""; $table_users=dbschema::users; $sql="SELECT * FROM $table_users t where username!='admin' ORDER BY lastname,firstname"; $sqlResult=mysql_query($sql); while($array=mysql_fetch_array($sqlResult)){ echo ""; printGroupRanksForUser($array["username"]); echo ""; } echo "
Gruppe $group
Team   $teamName  
"; } function printGroupRanksForUser($username){ $table_groupranktipps=dbschema::groupranktipps; $table_teams=dbschema::teams; echo ""; echo "" . getUserInfo($username) . ""; $sql="SELECT * FROM $table_teams t LEFT JOIN $table_groupranktipps grt ON grt.user='$username' AND t.shortname = grt.team ORDER BY t.group, t.shortname"; $sqlResult=mysql_query($sql); while($array=mysql_fetch_array($sqlResult)){ $group = $array["group"]; $teamName=$array["team"]; $tippRank=$array["rank"]; $points = $array["score"]; if($points == NULL){ echo "$tippRank"; } else if($points == 0){ // print white echo "
$tippRank
"; } else if($points == 2){ // print light green echo "
$tippRank
"; } } echo ""; } ?>