From d0102c6fd4b188b0a1c5ffd3bf9a834a64a5c709 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Mon, 8 Jan 2018 16:30:56 +0100 Subject: Match info --- html/includes/teamstats.php | 101 +++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 48 deletions(-) (limited to 'html/includes/teamstats.php') diff --git a/html/includes/teamstats.php b/html/includes/teamstats.php index fd06ead..b2116b9 100755 --- a/html/includes/teamstats.php +++ b/html/includes/teamstats.php @@ -1,8 +1,10 @@ - - '.htmlentities($title).' - '; - + + + + + '; $sql_players = "SELECT pi.name, pi.banned, 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".(($extra) ? ', p.'.$extra.' AS '.$extra : '')." - FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid - ORDER BY".(($teams) ? ' team ASC,' : '')." $order"; + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid + ORDER BY".(($teams) ? ' team ASC,' : '')." $order"; $q_players = mysql_query($sql_players) or die(mysql_error()); $header = true; teamstats_init_totals($totals, $num); + while ($r_players = zero_out(mysql_fetch_array($q_players))) { $r_players['dom_cp'] = $r_players['gamescore'] - $r_players['frags']; - $r_players['team'] = intval($r_players['team']); + if ($teams and $oldteam != $r_players['team']) { if ($r_players['team'] != 0) teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); $oldteam = $r_players['team']; @@ -46,27 +46,29 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga case 2: $teamname = 'Green'; break; case 3: $teamname = 'Gold'; break; } - echo''; + + echo''; $header = true; } + if ($header) { $header = false; echo ' - - - '; - if ($extra) echo' '; + + + '; + if ($extra) echo ''; echo' - - - - '; - if ($teams) echo ''; + + + + '; + if ($teams) echo ''; echo ' - - - + + + '; } @@ -87,7 +89,7 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga $totals['acc'] += $r_players['accuracy']; $totals['ttl'] += $r_players['ttl']; $num++; - + if ($r_players['banned'] == 'Y') { $eff = '-'; $acc = '-'; @@ -101,15 +103,16 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga $r_players['teamkills'] = '-'; } - $class = ($num % 2) ? 'grey' : 'grey2'; - echo ''; + echo ''; + if ($r_players['banned'] != 'Y') { - echo ''; + echo ''; } else { - echo ''; + echo ''; } - echo ''; + + echo ''; echo ''; if ($extra) echo ''; @@ -121,14 +124,15 @@ function teamstats($mid, $title, $extra = NULL, $extratitle = NULL, $order = 'ga if ($teams) echo ''; - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; echo ''; } + teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); - echo '
'.htmlentities($title).'
Team: '.$teamname.'
Team: '.$teamname.'
PlayerTimeScore'.htmlentities($extratitle).'PlayerTimeScore'.htmlentities($extratitle).'FKDSTKFKDSTKEff.Acc.Avg TTLEff.Acc.Avg TTL
'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.GetMinutes($r_players['gametime']/TIMERATIO).''.GetMinutes($r_players['gametime'] / TIMERATIO).''.$r_players['gamescore'].''.$r_players[$extra].''.$r_players['teamkills'].''.$eff.''.$acc.''.$ttl.''.$eff.''.$acc.''.$ttl.'

'; + echo '
'; } function teamstats_init_totals(&$totals, &$num, $extra = null) { @@ -151,27 +155,28 @@ function teamstats_team_totals(&$totals, $num, $teams, $extra, $teamscore) { $acc = get_dp($totals['acc'] / $num); $ttl = GetMinutes($totals['ttl'] / $num); - echo ''; - echo 'Totals'; - echo ''; + echo 'Totals'; + echo ''; + if ($teams) { - echo ''.$teamscore.' ('.$totals[gamescore].')'; + echo ''.$teamscore.' ('.$totals[gamescore].')'; } else { - echo ''.$totals[gamescore].''; + echo ''.$totals[gamescore].''; } - if ($extra) echo ''.$totals[$extra].''; + if ($extra) echo ''.$totals[$extra].''; - echo ''.$totals[frags].''; - echo ''.$totals[kills].''; - echo ''.$totals[deaths].''; - echo ''.$totals[suicides].''; + echo ''.$totals[frags].''; + echo ''.$totals[kills].''; + echo ''.$totals[deaths].''; + echo ''.$totals[suicides].''; - if ($teams) echo ''.$totals[teamkills].''; + if ($teams) echo ''.$totals[teamkills].''; - echo ''.$eff.''; - echo ''.$acc.''; - echo ''.$ttl.''; + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; echo ''; } + ?> -- cgit