<?php
define('_IN_JOHNCMS', 1);
$textl = 'Fan-klub';
require_once ('../incfiles/core.php');
require_once ('../incfiles/head.php');

echo ($rights == 9 ?
    '<div class="gmenu"><a href="create_club.php"><input type="submit" value="Klub yaratish"/></a></div>' :
    '');

echo '<div class="phdr"><b>Fan klub</b></div>';
$total_soo = mysql_result(mysql_query("SELECT COUNT(*) FROM `fanclub`"), 0);
$req = mysql_query("SELECT * FROM `fanclub` ORDER BY `id`");
while ($res = mysql_fetch_array($req)) {
    echo ($i % 2) ? '<div class="list2">' : '<div class="list1">';

    echo '<table><tr><td>';
    echo '<img src="img/' . $res['id'] .
        '_small.png" width="55" height="55"  align="middle" alt=""/>';
    echo '</td><td>';
    echo '<a href="titul_club.php?id=' . $res['id'] . '"><b>' . $res['name'] .
        '</b></a>';
    echo '<br/><span class="gray">' . $res['sport'] . '/' . $res['count'] .
        '</span><br/><a href="users_club.php?id=' . $res['id'] . '&amp;sort=1">Fanat (' .
        $res['plus'] . ')</a>|<a href="users_club.php?id=' . $res['id'] .
        '&amp;sort=0">Anti fanat (' . $res['minus'] . ')</a>';
    echo '</td></tr></table>';
    echo '</div>';
    ++$i;
}

        if ($total_soo > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&amp;', $start, $total_soo, $kmess) . '</div>' .
                 '<p><form action="index.php" method="get"><input type="text" name="page" size="2"/>' .
                 '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
        }

echo '<div class="phdr" ' . $kop . '>Barcha klublar: ' . $total_soo . '</div>';

require_once ('../incfiles/end.php');
?>