query(" SELECT hlstats_Clans.tag, hlstats_Clans.name, hlstats_Clans.homepage, hlstats_Clans.game, SUM(hlstats_Players.kills) AS kills, SUM(hlstats_Players.deaths) AS deaths, SUM(hlstats_Players.connection_time) AS connection_time, COUNT(hlstats_Players.playerId) AS nummembers, ROUND(AVG(hlstats_Players.skill)) AS avgskill, TRUNCATE(AVG(activity),2) as activity FROM hlstats_Clans LEFT JOIN hlstats_Players ON hlstats_Players.clan = hlstats_Clans.clanId WHERE hlstats_Clans.clanId=$clan AND hlstats_Players.hideranking = 0 GROUP BY hlstats_Clans.clanId "); if ($db->num_rows() != 1) error("No such clan '$clan'."); $clandata = $db->fetch_array(); $db->free_result(); $cl_name = preg_replace(' ', ' ', htmlspecialchars($clandata['name'])); $cl_tag = preg_replace(' ', ' ', htmlspecialchars($clandata['tag'])); $cl_full = "$cl_tag $cl_name"; $game = $clandata['game']; $db->query("SELECT name FROM hlstats_Games WHERE code='$game'"); if ($db->num_rows() != 1) $gamename = ucfirst($game); else list($gamename) = $db->fetch_row(); ?>
: '.$clandata['name'].''; ?>
:
:
:
: 40) $bar_type = '6'; elseif ($clandata['activity'] > 30) $bar_type = '5'; elseif ($clandata['activity'] > 20) $bar_type = '4'; elseif ($clandata['activity'] > 10) $bar_type = '3'; elseif ($clandata['activity'] > 5) $bar_type = '2'; echo "\"".$clandata['activity'].'%"'; ?>
:
:
:
:
query(" SELECT playerId, lastName, country, flag, skill, connection_time, kills, deaths, IFNULL(kills/deaths, '-') AS kpd, (kills/" . $clandata["kills"] . ") * 100 AS percent, activity FROM hlstats_Players WHERE clan=$clan AND hlstats_Players.hideranking = 0 ORDER BY $tblMembers->sort $tblMembers->sortorder, $tblMembers->sort2 $tblMembers->sortorder, lastName ASC LIMIT $tblMembers->startitem,$tblMembers->numperpage "); $resultCount = $db->query(" SELECT COUNT(*) FROM hlstats_Players WHERE clan=$clan AND hlstats_Players.hideranking = 0 "); list($numitems) = $db->fetch_row($resultCount); $tblMembers->draw($result, $numitems, 100); ?>