<?php
define('_IN_JOHNCMS', 1);
$headmod = 'manager';
$textl='Рейтинг клубов'; 
require_once("../incfiles/core.php");
require_once("../incfiles/head.php");
require_once("manfunc.php"); 

echo"<h2 align='center'>$textl</h2>"; 
$q=mysql_query("select * from fman_clubs where id!=131 order by fan desc limit $start,$kmess;");
$total=mysql_result(mysql_query("select count(*) from fman_clubs where id!=131;"),0);

if ($total > $kmess) 
{
	echo '<div class="topmenu">' . functions::display_pagination('rait.php?', $start, $total, $kmess) . '</div>';
}
echo"<table><tr><td></td><td class='bmenu'>Очки</td></tr>";
$n=$start;

while($a=mysql_fetch_array($q))
{
	$n=$n+1;
	echo"<tr><td class='list2'>$n. ";
	
	if($a[id]!=$club_id && $a[id]!=$id)
		echo"<a href='club.php?id=$a[id]'>$a[name]</a>"; 
	else 
		echo"<b>$a[name]</b>";
		
	echo"</td><td class='list1'>$a[fan]</td></tr>";
}

echo"</table>";

if ($total > $kmess)
{
	echo '<div class="topmenu">' . functions::display_pagination('rait.php?', $start, $total, $kmess) . '</div>' .
	'<div class="menu"><form action="rait.php?" method="post">' .
	'<input type="text" name="page" size="2"/>' .
	'<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' .
	'</form></div>';
}
echo"<div class='phdr'>";
if($id)
{
	$qtj=mysql_query("select name from fman_clubs where id=$id;");
	$tdat=mysql_fetch_array($qtj);
	echo"<a href='clubs.php?id=$id'>$tdat[name]</a><br/>";
}
echo"<a href='index.php'>Фут.менеджер</a></div>";
require_once("../incfiles/end.php");
?>