Sessions & Skill change $player = valid_request(intval($_GET["player"]), 1) or error("No player ID specified."); $db->query (" SELECT hlstats_Players.lastName, hlstats_Players.game FROM hlstats_Players WHERE playerId = $player "); if ($db->num_rows() != 1) { error("No such player '$player'."); } $playerdata = $db->fetch_array(); $pl_name = $playerdata['lastName']; if (strlen($pl_name) > 10) { $pl_shortname = substr($pl_name, 0, 8) . '...'; } else { $pl_shortname = $pl_name; } $pl_name = htmlspecialchars($pl_name, ENT_COMPAT); $pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT); $game = $playerdata['game']; $db->query (" SELECT hlstats_Games.name FROM hlstats_Games WHERE hlstats_Games.code = '$game' "); if ($db->num_rows() != 1) { $gamename = ucfirst($game); } else { list($gamename) = $db->fetch_row(); } pageHeader ( array ($gamename, 'Session History', $pl_name), array ( $gamename => $g_options['scripturl']."?game=$game", 'Player Rankings' => $g_options['scripturl']."?mode=players&game=$game", 'Player Details' => $g_options['scripturl']."?mode=playerinfo&player=$player", 'Session History' => '' ), $playername ); flush(); $table = new Table ( array ( new TableColumn ( 'eventTime', 'Date', 'width=11' ), new TableColumn ( 'skill_change', 'Skill Change', 'width=10&align=right&skill_change=1' ), new TableColumn ( 'skill', 'Points', 'width=10&align=right' ), new TableColumn ( 'connection_time', 'Time', 'width=13&align=right&type=timestamp' ), new TableColumn ( 'kills', 'Kills', 'width=7&align=right' ), new TableColumn ( 'deaths', 'Deaths', 'width=7&align=right' ), new TableColumn ( 'kpd', 'K:D', 'width=7&align=right' ), new TableColumn ( 'headshots', 'HS', 'width=7&align=right' ), new TableColumn ( 'hpk', 'HS:K', 'width=7&align=right' ), new TableColumn ( 'suicides', 'Suicides', 'width=7&align=right' ), new TableColumn ( 'teamkills', 'TKs', 'width=7&align=right' ), new TableColumn ( 'kill_streak', 'Kill Strk', 'width=7&align=right' ), ), 'eventTime', 'eventTime', 'skill_change', false, 50, 'page', 'sort', 'sortorder' ); $surl = $g_options['scripturl']; $result = $db->query (" SELECT hlstats_Players_History.eventTime, hlstats_Players_History.skill_change, hlstats_Players_History.skill, hlstats_Players_History.kills, hlstats_Players_History.deaths, hlstats_Players_History.headshots, hlstats_Players_History.suicides, hlstats_Players_History.connection_time, ROUND(hlstats_Players_History.kills/(IF(hlstats_Players_History.deaths = 0, 1, hlstats_Players_History.deaths)), 2) AS kpd, ROUND(hlstats_Players_History.headshots/(IF(hlstats_Players_History.kills = 0, 1, hlstats_Players_History.kills)), 2) AS hpk, hlstats_Players_History.teamkills, hlstats_Players_History.kill_streak, hlstats_Players_History.death_streak, hlstats_Players_History.skill_change AS last_skill_change FROM hlstats_Players_History WHERE hlstats_Players_History.playerId = $player ORDER BY $table->sort $table->sortorder, $table->sort2 $table->sortorder LIMIT $table->startitem, $table->numperpage "); $resultCount = $db->query (" SELECT COUNT(*) FROM hlstats_Players_History WHERE hlstats_Players_History.playerId = $player "); list($numitems) = $db->fetch_row($resultCount); ?>