<?
echo "<div class='block'><center><font color=white>Статистика сайта</font></center></div>";
$man = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_user WHERE pol='1'"), 0);
$girl = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_user WHERE pol='0'"), 0);
$gift = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_gifts"), 0);
$kartel = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_collective"), 0);
$smilestat = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_smiles"), 0);
$mailstat = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_mail"), 0);
$vip = mysql_result(mysql_query("SELECT COUNT(*) FROM kolhoz_user WHERE vip"), 0);
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Парней: $man</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Девушек: $girl</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Подарено подарков: $gift</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Картелей: $kartel</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Смайликов: $smilestat</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />Отправлено сообщений: $mailstat</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='' />VIP аккаунтов: $vip</div>";
echo "<div class='block'><img src='/images/toch.png' alt='o'/>Онлайн: <span class='white'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."'"), 0)."</span></div>";
echo "<div class='block'><img src='/images/toch.png' alt='o'/>Посетили сайт за 2 дня: <span class='white'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-172800)."'"), 0)."</span></div>";
echo "<div class='block'><img src='/images/toch.png' alt='o'/>Регистраций:  <span class='white'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"), 0)."</span></div>";
echo '<div class="block"><img width="16" height="16" src="images/toch.png" alt="o">Форум: ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'tema'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'razdel'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'komm'"),0).')</li></div>';
echo '<div class="block"><img alt="" width="16" height="16" src="/images/toch.png">Новостей</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `mother` = '1'"),0).')</div>';
echo '<div class="block"><img width="16" height="16" src="images/toch.png" alt="o">Чат: </a>('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_chat` WHERE `id` >= '1' AND `type` = 'komm'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_chat` WHERE `id` >= '1' AND `type` = 'room'"),0).')</span><br></div>';
 
 
echo "</div>";
echo "<div class='block'><font color=white><center>Моя статистика</center></font></div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='o'>Активных Грядок: </a> ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0)!=0?"(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0).")</span>":null)."</div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='o'>Смс в Почте</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]'"),0)."".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0?"/<font color='red'>+".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)."":null)."</font>)</span></li></div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='o'>Монеты:  <span>$ku[money]</span></div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='o'>Золото:  <span>$ku[rubies]</span></div>";
echo "<div class='block'><img width='16' height='16' src='images/toch.png' alt='o'>Опыт: <span> ".($ku['level']<$bigl?"".rating($kr)."/".rating($level['rating'])."":"".rating($ku['rating'])."")." </span> опыта<br></div>";
include_once 'inc/foot.php';
?>