Logo

zurück

info("clicked showAllUsersFinalmatchTipps.php5"); printFinalMatches(); 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 printFinalMatches(){ echo "

Endrunden-Tipps

"; echo "
"; $table_matches=dbschema::matches; $sql="SELECT * FROM $table_matches m WHERE m.matchtype!='Gruppenspiel'"; $sqlResult=mysql_query($sql); echo ""; echo ""; echo " "; while($array=mysql_fetch_array($sqlResult)){ $matchnr = $array["matchnr"]; 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 ""; printFinalMatchesForUser($array["username"]); echo ""; } echo "
Spiel $matchnr
"; } function printFinalMatchesForUser($username){ $table_matches=dbschema::matches; $table_users=dbschema::users; $table_tipps=dbschema::finalmatchtipps; echo ""; echo "" . getUserInfo($username) . ""; $sql="SELECT * FROM $table_matches m LEFT JOIN $table_tipps t ON m.matchnr=t.matchnr AND t.user='$username' WHERE m.matchtype!='Gruppenspiel' "; $sqlResult=mysql_query($sql); while($array=mysql_fetch_array($sqlResult)){ $matchnr=$array["matchnr"]; $teamName1=$array["teamX"]; $teamName2=$array["teamY"]; $tippGoalsTeam1=$array["goalsX"]; if (strlen($tippGoalsTeam1)==0) $tippGoalsTeam1='  '; $tippGoalsTeam2=$array["goalsY"]; if (strlen($tippGoalsTeam2)==0) $tippGoalsTeam2='  '; $points = $array["score"]; $evaluationDone=$array["evaluationDone"]; $result = "$teamName1-$teamName2
$tippGoalsTeam1 : $tippGoalsTeam2"; if($evaluationDone === "T"){ if($points == NULL){ // for the user 'real' echo "$result"; } else if($points == 0){ // print white echo "
$result
"; } else if($points == 2){ // print light blue echo "
$result
"; } else if($points == 3){ // print light blue (a bit darker) echo "
$result
"; } else if($points == 4){ // print light green echo "
$result
"; } else if($points == 5){ // print light green (a bit darker) echo "
$result
"; } else if($points == 6){ // print light green (even a bit more shade) echo "
$result
"; } else if($points == 8){ // print green echo "
$result
"; } } else { echo "$result"; } } echo ""; } ?>