<?php
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title']='Футбольный менеджер';
include_once '../../sys/inc/thead.php';
title();
err();
aut();

include_once 'online.php';
echo "<div class='f1'>";
echo '<center><img src="icon/wap_main.png" width="140" height="70" alt="Karson" /></center>';
//echo "<small>Онлайн: ";
//$onl = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_who`"), 0);
//if ($onl==0)echo 'Никто...';
//$sql = mysql_query("SELECT `id_user` FROM `fm_who`");
//while($us = mysql_fetch_assoc($sql))
//{
//$login=mysql_fetch_array(mysql_query("select `nick` from `user` where `id`='".$us['id_user']."' limit 1;"));
//echo "<a href='club.php?id=".$us['id_user']."'>$login[nick]</a>,\n";
//}
//echo "</small>";

echo "</div>";
$cena = mysql_fetch_array(mysql_query("SELECT * FROM `fm_admin` WHERE `id` = '1' LIMIT 1"));

$chempionat= mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_chempionat`",$db), 0); 

$chempionatnew = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_chempionat` WHERE `time` > '".(time()-86400)."'"), 0);

echo "<div class='f1'><img src='icon/m.gif'> <a href='chempionat/index.php'>Чемпионаты</a>\n";
if ($chempionatnew>0){echo "($chempionat)<span style='color:red'>+$chempionatnew</span>";}else{echo "($chempionat)";} echo'</div>';

$movlenebi = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_jurnal` WHERE `id_user` = '$user[id]'"), 0);

$axalimovlenebi =mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_jurnal` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0);

echo "<div class='f2'><img src='icon/m.gif'> <a href='jurnal.php'>События</a>\n";
if($axalimovlenebi>0){echo "($movlenebi)<span style='color:#FF0000'>+$axalimovlenebi</span><br/>";}else{echo "($movlenebi)";} echo'</div>';

$ist= mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_ist`",$db), 0);

$istnew = mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_ist` WHERE `time` > '".(time()-86400)."'"), 0);

echo "<div class='f1'><img src='icon/m.gif'> <a href='ist.php'>История</a> ";
if ($istnew>0){echo "($ist)<span style='color:red'>+$istnew</span><br />";}else{echo "($ist)";} echo'</div>';

$klubi= mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_club`",$db), 0);

echo "<div class='f2'><img src='icon/m.gif'> <a href='clubs.php'>Клубы</a> ($klubi)</div>\n";

$coaches= mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_coach`",$db), 0);

echo "<div class='f1'><img src='icon/m.gif'> <a href='coaches.php'>Тренеры</a> ($coaches)</div>\n";

$gamers= mysql_result(mysql_query("SELECT COUNT(*) FROM `fm_gamers`",$db), 0);

echo "<div class='f2'><img src='icon/m.gif'> <a href='players.php'>Игроки</a> ($gamers)</div>\n";

echo "<div class='f1'><img src='icon/m.gif'> <a href='club.php'>Мой клуб</a></div>";

echo "<div class='f2'><img src='icon/m.gif'> <a href='coach.php'>Мой Тренер</a></div>";

echo "<div class='f1'><img src='icon/m.gif'> <a href='gamers.php'>Мои Игроки</a></div>";

echo "<div class='f2'><img src='icon/m.gif'> <a href='bank.php'>Банк</a></div>";

echo "<div class='f1'><img src='icon/m.gif'> <a href='info.php'>Информация</a></div>";
if (user_access('adm_panel_show'))echo "<div class='f2'><img src='icon/m.gif'> <a href='admin/index.php'>Админка</a><br /></div>";
include_once '../../sys/inc/tfoot.php';
?>