select_db('characters'); require_once("minimanager/lang/czech.php"); require_once("minimanager/scripts/defines.php"); require_once("minimanager/scripts/id_tab.php"); echo('

Arénové týmy:

'); if(!array_key_exists('order_by2', $_SESSION)) $_SESSION['order_by2'] = 'rating'; if(array_key_exists('order_by', $_GET)) $_SESSION['order_by2'] = $Database->real_escape_string($_GET['order_by']); $order_by = $_SESSION['order_by2']; if(!array_key_exists('dir2', $_SESSION)) $_SESSION['dir2'] = 1; if(array_key_exists('dir', $_GET)) $_SESSION['dir2'] = $Database->real_escape_string($_GET['dir']); $dir = $_SESSION['dir2']; $dir = ($dir) ? 0 : 1; $order_dir = ($dir) ? "ASC" : "DESC"; $PerPage = 20; if(array_key_exists('page', $_GET)) $_SESSION['page2'] = $Database->real_escape_string($_GET['page']); if(array_key_exists('page', $_SESSION)) $Page = $_SESSION['page2']; else $Page = 0; $itemperpage = 30; $DbResult = $Database->query("SELECT count(*) FROM arena_team"); $Row = $DbResult->fetch_array(); $all_record = $Row[0]; $query = $Database->query("SELECT arena_team.arenateamid AS atid, arena_team.name AS atname, arena_team.captainguid AS lguid, arena_team.type AS attype, (SELECT name FROM `characters` WHERE guid = lguid) AS l_name,(SELECT COUNT(*) FROM arena_team_member WHERE arenateamid = atid) AS tot_chars, rating AS atrating, games as atgames, wins as atwins FROM arena_team, arena_team_stats WHERE arena_team.arenateamid = arena_team_stats.arenateamid ORDER BY $order_by $order_dir LIMIT ".($Page * $PerPage).",".$PerPage); echo($Database->error); $this_page = $query->num_rows; $output = "Celkem týmů: $all_record
"; $output .= ""; while ($data = $query->fetch_assoc()) { $output .= ""; } $output .= "
".($order_by=='atname' ? " " : "")."{$lang_arenateam['arenateam_name']} ".($order_by=='tot_chars' ? " " : "")."{$lang_arenateam['captain']} ".($order_by=='attype' ? " " : "")."{$lang_arenateam['type']} ".($order_by=='members' ? " " : "")."{$lang_arenateam['members']} ".($order_by=='rating' ? " " : "")."{$lang_arenateam['rating']} ".($order_by=='games' ? " " : "")."{$lang_arenateam['games']} ".($order_by=='wins' ? " " : "")."{$lang_arenateam['wins']}
".$data['atname']." ".$data['l_name']." ".$lang_arenateam[$data['attype']]." ".$data['tot_chars']." ".$data['atrating']." ".$data['atgames']." ".$data['atwins']."
".PagesList('?page=', $Page, $all_record, $PerPage).""; echo($output); ShowFooter(); ?>