From 40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sat, 4 Feb 2017 16:05:45 +0100 Subject: Original UTStats beta 4.2.8 --- html/pages/home.php | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 html/pages/home.php (limited to 'html/pages/home.php') diff --git a/html/pages/home.php b/html/pages/home.php new file mode 100755 index 0000000..3cb167d --- /dev/null +++ b/html/pages/home.php @@ -0,0 +1,100 @@ + + + UTStats Summary + + + Players + Servers + Maps + Matches Logged + Player Hours + '; + +// Get Summary Info +$r_playercount = small_query("SELECT COUNT(*) AS result FROM uts_pinfo"); +$playercount = $r_playercount['result']; +$servercount = small_count("SELECT DISTINCT servername FROM uts_match"); +$mapcount = small_count("SELECT COUNT(mapfile) AS result FROM uts_match GROUP BY mapfile"); +$r_matchcount = small_query("SELECT COUNT(*) AS result FROM uts_match"); +$matchcount= $r_matchcount['result']; +$hourscount = small_query("SELECT SUM(gametime) AS result FROM uts_player"); + +$gametime = sec2hour($hourscount[result]); + +echo' + + '.$playercount.' + '.$servercount.' + '.$mapcount.' + '.$matchcount.' + '.$gametime.' + + + + + +
+
+

Welcome to UTStats.
+ Here you can look up information on UT matches and players.
+ Select a category from the column on the left.

+
+ + + + + + + + + + + + + + '; + +$sql_gamesummary = "SELECT g.id AS gid, g.name AS gamename, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC"; +$q_gamesummary = mysql_query($sql_gamesummary) or die(mysql_error()); +while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) { + + $gid = $r_gamesummary[gid]; + + $q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match WHERE gid = '$gid'"); + $gametime = sec2hour($q_gametime[gametime]); + + echo' + + + + + + '; +} + +$totalsummary = small_query("SELECT SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS gametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id"); + +$q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match"); +$gametime = sec2hour($q_gametime[gametime]); + +echo' + + + + + + + + +
Game Summary
Match TypeFragsKillsSuicidesTeam KillsMatchesGame Hours
'.$r_gamesummary[gamename].''.$r_gamesummary[frags].''.$r_gamesummary[kills].''.$r_gamesummary[suicides].''.$r_gamesummary[teamkills].''.$r_gamesummary[matchcount].''.$gametime.'
Totals for All Players'.$totalsummary[frags].''.$totalsummary[kills].''.$totalsummary[suicides].''.$totalsummary[teamkills].''.$totalsummary[matchcount].''.$gametime.'
+

'; + +// Do graph stuff +$gtitle = "Across All Servers"; +$bgwhere = "id >= 0"; +include("pages/graph_mbreakdown.php"); +?> \ No newline at end of file -- cgit