";
while (list($num_goals,$player_id,$gfname,$glname) = mysql_fetch_array($result2)) {
if (!empty($player_id)) {
$result1=mysql_query("SELECT fname,lname FROM player WHERE site_id=$player_id");
while (list($fname,$lname) = mysql_fetch_array($result1)) {
$team1_score=$team1_score+$num_goals;
$block .= "$lname, $fname - $num_goals \n"; } } else { $team1_score=$team1_score+$num_goals; $block .= "$glname, $gfname - $num_goals \n"; } } $block .= " | \n\n"; } else { $block .= " | \n | \n"; } // CARDS $block1 .= " |
";
$result2=mysql_query("SELECT a.type,a.player_id,b.definition FROM card AS a JOIN card_def AS b ON a.infraction=b.infraction WHERE match_id=$match_id AND team_id=$team1");
if (mysql_num_rows($result2) > 0) {
while (list($type,$player_id,$def) = mysql_fetch_array($result2)) {
$result1=mysql_query("SELECT fname,lname FROM player WHERE site_id=$player_id");
while (list($fname,$lname) = mysql_fetch_array($result1)) {
if ($type=='yellow') {
$font='';
}
if ($type=='red') {
$font='';
}
$team1_score=$team1_score+$num_goals;
$block1 .= "$lname, $fname - $font$def \n"; } } $block1 .= " | \n\n"; } else { $block1 .= " \n | \n"; } // GOALS $result2=mysql_query("SELECT num_goals,player_id FROM goal WHERE match_id=$match_id AND team_id=$team2"); if (mysql_num_rows($result2) > 0) { $block .= " | ";
while (list($num_goals,$player_id) = mysql_fetch_array($result2)) {
$result1=mysql_query("SELECT fname,lname FROM player WHERE site_id=$player_id");
while (list($fname,$lname) = mysql_fetch_array($result1)) {
$team2_score=$team2_score+$num_goals;
$block .= "$lname, $fname - $num_goals \n"; } } $block .= " | \n\n\n"; } // CARDS $result2=mysql_query("SELECT a.type,a.player_id,b.definition FROM card AS a JOIN card_def AS b ON a.infraction=b.infraction WHERE match_id=$match_id AND team_id=$team2"); if (mysql_num_rows($result2) > 0) { $block1 .= " | ";
while (list($type,$player_id,$def) = mysql_fetch_array($result2)) {
$result1=mysql_query("SELECT fname,lname FROM player WHERE site_id=$player_id");
while (list($fname,$lname) = mysql_fetch_array($result1)) {
if ($type=='yellow') {
$font='';
}
if ($type=='red') {
$font='';
}
$team1_score=$team1_score+$num_goals;
$block1 .= "$lname, $fname - $font$def \n"; } } $block1 .= " | \n";
}
else {
$block1 .= "\n"; } $block1 .= "\n"; } if ($resched=='true') { $bgcolor='#ffdd40'; } else { $bgcolor='#efefef'; } $result1 = mysql_query("SELECT name FROM team WHERE team_id = $team1"); while (list($name1) = mysql_fetch_array($result1)) { $pteam1 .= " |
$name1 ($team1_score) | "; } $pteam1 .= "$date - $time | \n"; $result1 = mysql_query("SELECT name FROM team WHERE team_id = $team2"); while (list($name2) = mysql_fetch_array($result1)) { $pteam2 .= "$name2 ($team2_score) | \n"; } $pteam2 .= "Field: $field | \n
Player | Goals | Yellows | Reds | |||||
'.$lname.' | '.$fname.' | '.$player_id.' ('.$pID.') | '; $result1 = mysql_query("SELECT SUM(num_goals) FROM goal WHERE player_id = $pID AND team_id=$team GROUP BY player_id"); if (mysql_num_rows($result1) > 0) { while (list($goals) = mysql_fetch_array($result1)) { echo''.$goals.' | '; } } else { echo''; } $card_count=0; $result2 = mysql_query("SELECT card_id FROM card WHERE player_id = $pID AND team_id=$team AND type='yellow'"); if (mysql_num_rows($result2) > 0) { while (list($yellow) = mysql_fetch_array($result2)) { $card_count++; } echo' | '.$card_count.' | '; } else { echo''; } $card_count1=0; $result3 = mysql_query("SELECT card_id FROM card WHERE player_id = $pID AND team_id=$team AND type='red'"); if (mysql_num_rows($result3) > 0) { while (list($yellow) = mysql_fetch_array($result3)) { $card_count1++; } echo' | '.$card_count1.' | '; } else { echo''; } } echo' |