Player Summary '; $sql_players = "SELECT pi.name, pi.banned, p.playerid, p.pid, p.team, p.country, p.gametime, p.gamescore, p.frags, p.deaths, p.suicides, p.teamkills, p.eff, p.accuracy, p.ttl, p.rank, MAX(e.col2) FROM uts_pinfo AS pi, uts_player AS p LEFT JOIN uts_events AS e ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'out' AND p.gamescore = 0 WHERE p.pid = pi.id AND p.matchid = $mid GROUP BY p.playerid ORDER BY p.gamescore DESC, (0+e.col2) DESC"; $q_players = mysqli_query($GLOBALS["___mysqli_link"], $sql_players) or die(mysqli_error($GLOBALS["___mysqli_link"])); $header = true; $totals['gamescore'] = 0; if ($extra) $totals[$extra] = 0; $totals['frags'] = 0; $totals['kills'] = 0; $totals['deaths'] = 0; $totals['suicides'] = 0; $totals['teamkills'] = 0; $totals['eff'] = 0; $totals['acc'] = 0; $totals['ttl'] = 0; $num = 0; while ($r_players = zero_out(mysqli_fetch_array($q_players))) { if ($header) { $header = false; echo ' Player Time Score'; if ($extra) echo' '.htmlentities($extratitle).''; echo' F K D S'; if ($teams) echo 'TK'; echo ' Eff. Acc. Avg TTL '; } $eff = get_dp($r_players['eff']); $acc = get_dp($r_players['accuracy']); $ttl = GetMinutes($r_players['ttl']); $kills = $r_players['frags'] + $r_players['suicides']; $pname = $r_players['name']; $totals['gamescore'] += $r_players['gamescore']; if ($extra) $totals[$extra] += $r_players[$extra]; $totals['frags'] += $r_players['frags']; $totals['kills'] += $kills; $totals['deaths'] += $r_players['deaths']; $totals['suicides'] += $r_players['suicides']; $totals['teamkills'] += $r_players['teamkills']; $totals['eff'] += $r_players['eff']; $totals['acc'] += $r_players['accuracy']; $totals['ttl'] += $r_players['ttl']; $num++; if ($r_players['banned'] == 'Y') { $eff = '-'; $acc = '-'; $ttl = '-'; $kills = '-'; $r_players['gamescore'] = '-'; $r_players[$extra] = '-'; $r_players['frags'] = '-'; $r_players['deaths'] = '-'; $r_players['suicides'] = '-'; $r_players['teamkills'] = '-'; } $class = ($num % 2) ? 'grey' : 'grey2'; echo ''; if ($r_players['banned'] != 'Y') { echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; } else { echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; } echo ''.GetMinutes($r_players[gametime]).''; echo ''.$r_players[gamescore].''; echo ''.(empty($r_players['MAX(e.col2)']) ? '' : GetMinutes($r_players['MAX(e.col2)'])).''; echo ''.$r_players[frags].''; echo ''.$kills.''; echo ''.$r_players[deaths].''; echo ''.$r_players[suicides].''; echo ''.$eff.''; echo ''.$acc.''; echo ''.$ttl.''; echo ''; } if ($num == 0) $num = 1; $eff = get_dp($totals['eff'] / $num); $acc = get_dp($totals['acc'] / $num); $ttl = GetMinutes($totals['ttl'] / $num); echo ''; echo 'Totals'; echo ''; echo ''.$totals[gamescore].''; echo ''; echo ''.$totals[frags].''; echo ''.$totals[kills].''; echo ''.$totals[deaths].''; echo ''.$totals[suicides].''; if ($teams) echo ''.$totals[teamkills].''; echo ''.$eff.''; echo ''.$acc.''; echo ''.$ttl.''; echo ''; echo '
';