<?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();

echo "<img src='search.png' alt=''/> <a href='search.php'>Поиск анкет</a><br/>\n";

echo "<img src='male.png' alt=''/> <a href='man.php'>Парни</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '1'"),0).")<br/>\n";

echo "<img src='female.png' alt=''/> <a href='woman.php'>Девушки</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '0'"),0).")<br/>\n";

$inban=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `time` > '$time'"))OR die('db error');
echo "<img src='ban.png' alt=''/> <a href='banlist.php'>Нарушители</a> ($inban[0])<br/>\n";

echo "<img src='admin.png' alt=''/> <a href='admin.php'>Администрация</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `group_access` > '1'"),0).")<br/>\n";


echo '<div class="menu_razd">Лучшая девушка:</div>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"), 0) == 0) {
echo '<div class="main_menu">Пользователей нет</div>';
} else {
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '0'"), 0) == 0) {
echo 'Девушки нет';
} else {

		
$female = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `pol` = '0' ORDER BY `rating` DESC LIMIT 1"));
		
avatar($female['id']);
echo '<br />';
echo "".online($female['id'])." ";		
echo '<a href="/info.php?id='. $female['id'] .'">'. $female['nick'] .'</a><br />
<img src="bal.png" alt=""/> Баллы: '. $female['balls'] .'<br />
<img src="rat.png" alt=""/> Рейтинг: '. $female['rating'] .'<br />';
}
echo '<div class="menu_razd">Лучший парень:</div>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `pol` = '1'"), 0) == 0) {
echo 'Парня нет';
}else{
		

		$male = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `pol` = '1' ORDER BY `rating` DESC LIMIT 1"));

		avatar($male['id']);
echo '<br />';
echo "".online($male['id'])." ";
echo '<a href="/info.php?id='. $male['id'] .'">'. $male['nick'] .'</a><br />
<img src="bal.png" alt=""/> Баллы: '. $male['balls'] .'<br />
<img src="rat.png" alt=""/> Рейтинг: '. $male['rating'] .'<br />';
}
}

include_once '../sys/inc/tfoot.php';
?>