<?

/*--------------------в друзья-------------------*/
$frend_new=mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE (`user` = '$user[id]' AND `to` = '$ank[id]') OR (`user` = '$ank[id]' AND `to` = '$user[id]') LIMIT 1"),0);
$frend=mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$user[id]' AND `frend` = '$ank[id]') OR (`user` = '$ank[id]' AND `frend` = '$user[id]') LIMIT 1"),0);
$not_user=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0;
if (isset($user) && $user['id']!=$ank['id']){
if (isset($_GET['fok'])){
echo '<center>';
echo "<div class='foot'><form action='/info.php?id=".$ank['id']."' method=\"post\">";
echo "<input class=\"submit\" type=\"submit\" value=\"Закрыть\" />\n";
echo "</form></div>";
echo '</center>';
}
}
if (isset($user) && isset($_GET['frends'])  && $frend_new==0 && $frend==0 ){
if ($user['id']!=$ank['id']){
echo '<center>';
echo "<div class='err'>Пользователь должен будет подтвердить, что вы друзья.</div><div class='foot'><form action='/user/frends/create.php?add=".$ank['id']."' method=\"post\">";
echo "<input class=\"submit\" type=\"submit\" value=\"Пригласить\" />\n";
echo " <a href='/info.php?id=$ank[id]'>Отмена</a><br />\n";
echo "</form></div>";
echo '</center>';
}
}
/*---------------------------------------------------------*/


 // Должность на сайте
if ($ank['group_access']>1) { echo "<div class='err'>$ank[group_name]</div>\n"; }

?>
<table class='table_info' cellspacing="0" cellpadding="0">
<tr>

<td class='block_menu'>
<?


 // Аватар 
echo "<div class='main'>";
avatar_ank_web($ank['id']);
echo "</div>";


 // Рейтинг
echo "<div class='main'>";
if ($ank['rating']>=0 && $ank['rating']<= 100){
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$ank[rating]%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=100 && $ank['rating']<= 200){
$rat=$ank['rating']-100;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=200 && $ank['rating']<= 300){
$rat=$ank['rating']-200;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=300 && $ank['rating']<= 400){
$rat=$ank['rating']-300;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=400 && $ank['rating']<= 500){
$rat=$ank['rating']-400;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=500 && $ank['rating']<= 600){
$rat=$ank['rating']-500;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=600 && $ank['rating']<= 700){
$rat=$ank['rating']-600;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=700 && $ank['rating']<= 800){
$rat=$ank['rating']-700;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=800 && $ank['rating']<= 900){
$rat=$ank['rating']-800;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}elseif ($ank['rating']>=900 && $ank['rating']<= 1000){
$rat=$ank['rating']-900;
echo "<div style='background-color: #73a8c7; width: 200px; height: 17px;'>
<div style=' background-color: #064a91; height:17px; width:$rat%;'></div>
<span style='position:relative; top:-17px; left:45%; right:57%; color:#ffffff;'>$ank[rating]%</span>
</div>";
}
echo "</div>";

echo "<div class='main'>";
echo "<b>ID номер: $ank[id]</b>";
echo "</div>";


/*---------------анкета-------------------*/
echo "<div class='main2'>";
echo "<img src='/style/icons/anketa.gif' alt='*' /> <a href='/user/info/anketa.php?id=$ank[id]'>Анкета</a> ";
if (isset($user) && $user['id']==$ank['id']){
echo "[<img src='/style/icons/edit.gif' alt='*' /> <a href='/user/info/edit.php'>ред</a>]";
}
echo "</div>";
/*---------------------------------------*/



/*------------------------гости---------------------------*/
if (isset($user) && $user['id']==$ank['id']){
echo "<div class='main'>";
$new_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
echo "<img src='/style/icons/guests.gif' alt='*' /> ";
if($new_g!=0)
{
$color = "<font color='red'>";
$color2 = "</font>";
}
else
{
$color = null;
$color2 = null;
}
echo "<a href='/user/myguest/index.php'>".$color."Гости".$color2."</a> \n";
if($new_g!=0)echo "<font color=\"red\">+$new_g</font>\n";
echo "</div>";
}
/*-------------------------------------------------------*/

/*-----------------лента-----------------*/
if (isset($user) && $user['id']==$ank['id'])
{
echo "<div class='main'>";

/*
========================================
Уведомления
========================================
*/

	$k_notif = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_user` = '$user[id]' AND `read` = '0'"), 0); // Уведомления
		
		if($k_notif > 0)
		{
			echo "<img src='/style/icons/notif.png' alt='*' /> ";
			echo "<a href='/user/notification/index.php'><font color='red'>Уведомления</font></a> \n";
			echo "<font color=\"red\">+$k_notif</font> \n";
			echo "<br />";
		}



/*
========================================
Обсуждения
========================================
*/


	echo "<img src='/style/icons/chat.gif' alt='*' /> ";
	$new_g=mysql_result(mysql_query("SELECT COUNT(*) FROM `discussions` WHERE `id_user` = '$user[id]' AND `count` > '0'"),0);
		if($new_g!=0)
		{
			echo "<a href='/user/discussions/index.php'><font color='red'>Обсуждения</font></a> \n";
			echo "<font color=\"red\">+$new_g</font> \n";
		}else{
			echo "<a href='/user/discussions/index.php'>Обсуждения</a> \n";
		}
	echo "<br />";





$k_l=mysql_result(mysql_query("SELECT COUNT(*) FROM `tape` WHERE `id_user` = '$user[id]'  AND  `read` = '0'"),0);
if($k_l!=0)
{
$color = "<font color='red'>";
$color2 = "</font>";
}
else
{
$color = null;$color2 = null;
}
echo "<img src='/style/icons/lenta.gif' alt='*' /> <a href='/user/tape/'>".$color."Лента".$color2."</a> \n";
if($k_l!=0)echo "<font color=\"red\">+$k_l</font>\n";





echo "</div>";
}
/*---------------------------------------*/

/*---------------------------друзья-----------------------------*/
$k_f = mysql_result(mysql_query("SELECT COUNT(id) FROM `frends_new` WHERE `to` = '$ank[id]' LIMIT 1"), 0);
$k_fr = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
$res = mysql_query("select `frend` from `frends` WHERE `user` = '$ank[id]' AND `i` = '1'");
echo "<div class='main'>";
echo "<img src='/style/icons/druzya.png' alt='*' /> ";
echo '<a href="/user/frends/?id='.$ank['id'].'">Друзья</a> ('.$k_fr.'</b>/';$i =0;
while ($k_fr = mysql_fetch_array($res)){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$k_fr[frend]' && `date_last` > '".(time()-800)."'"),0) != 0) $i++;
}
echo "<span style='color:green'><a href='/user/frends/online.php?id=".$ank['id']."'>$i</a></span>)";
if ($k_f>0 && $ank['id']==$user['id'])echo " <a href='/user/frends/new.php'><font color='red'>+$k_f</font></a>";
echo "</div>";
/*--------------------------------------------------------------*/






/*------------------------фотоальбомы---------------------------*/
echo "<div class='main2'>";
echo "<img src='/style/icons/foto.png' alt='*' /> ";
echo "<a href='/foto/$ank[id]/'>Фотографии</a> ";
echo "(" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]'"),0) . ")";
echo "</div>";
/*--------------------------------------------------------------*/


/*-------------------------Личные файлы---------------------------*/
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_files` WHERE `id_user` = '$ank[id]' AND `osn` = '1'"), 0)==0)
{
mysql_query("INSERT INTO `user_files` (`id_user`, `name`,  `osn`) values('$ank[id]', 'Файлы', '1')");
}
$dir_osn = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_files` WHERE `id_user` = '$ank[id]' AND `osn` = '1' LIMIT 1"));
echo "<div class='main2'>";
echo "<img src='/style/icons/files.gif' alt='*' /> ";
echo "<a href='/user/personalfiles/$ank[id]/$dir_osn[id]/'>Файлы</a> ";
echo "(" . mysql_result(mysql_query("SELECT COUNT(*) FROM `user_files` WHERE `id_user` = '$ank[id]' AND `osn` > '1'"),0) . "/" . mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$ank[id]'"),0) . ")";
echo "</div>";
/*----------------------------------------------------------------*/



/*-------------------------Музыка---------------------------------*/
$k_music=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_music` WHERE `id_user` = '$ank[id]'"),0);
echo "<div class='main2'>";
echo "<img src='/style/icons/play.png' alt='*' width='16'/> ";
echo "<a href='/user/music/index.php?id=$ank[id]'>Музыка</a> ";
echo "(" . $k_music . ")";
echo "</div>";
/*----------------------------------------------------------------*/



/*---------------------------Дневники------------------------------*/
echo "<div class='main'>";
$kol_dnev=mysql_result(mysql_query("SELECT COUNT(*) FROM `notes` WHERE `id_user` = '".$ank['id']."'"),0);
echo "<img src='/style/icons/zametki.gif' alt='*' /> ";
echo "<a href='/plugins/notes/user.php?id=$ank[id]'>Дневники</a> ($kol_dnev)\n";
echo "</div>";
/*----------------------------------------------------------------*/



echo "<div class='main2'>";
echo "<img src='/style/my_menu/who_rating.png' alt='*' /> <a href='/user/info/who_rating.php?id=$ank[id]'><b>Отзывы</b></a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_kont` = '".$ank['id']."'"),0).")<br />\n";
echo "</div>";

/*-----------------------------в друзья-------------------------*/
if (isset($user) && $user['id']!=$ank['id']){
echo "<div class='main'>";
if ($frend_new==0 && $frend==0){
echo "<img src='/style/icons/druzya.png' alt='*'/> <a href='/info.php?id=$ank[id]&amp;frends'>Добавить в друзья</a><br />\n";
}elseif ($frend_new==1){
echo "<img src='/style/icons/druzya.png' alt='*'/> <a href='/user/frends/create.php?otm=$ank[id]'>Отклонить заявку</a><br />\n";
}elseif ($frend==2){
echo "<img src='/style/icons/druzya.png' alt='*'/> <a href='/user/frends/create.php?del=$ank[id]'>Удалить из друзей</a><br />\n";
}
echo "</div>";

/*-------------------------------------------------------------*/


/*--------------------Сообщение-----------------------------------*/

	echo "<div class='main'>";
	echo " <a href=\"/mail.php?id=$ank[id]\"><img src='/style/icons/pochta.gif' alt='*' /> Сообщение</a> \n";
	echo "</div>";

/*----------------------------------------------------------------*/

/*
========================================
Монеты перевод
========================================
*/
echo "<div class='main2'>";
echo "<img src='/style/icons/many.gif' alt='*' /> <a href=\"/user/money/translate.php?id=$ank[id]\">Перевести $sMonet[0]</a> \n";
echo "</div>";
}


/*-----------------------------настройки-----------------------*/
if (isset($user) && $ank['id']==$user['id']){
echo "<div class='main2'>";
echo "<img src='/style/icons/uslugi.gif' alt='*' /> <a href=\"/user/money/index.php\">Дополнительные услуги</a><br /> \n";

echo "<img src='/style/icons/settings.png' alt='*' /> <a href=\"/user/info/settings.php\">Мои настройки</a> | <a href=\"/umenu.php\">Меню</a>\n";
echo "</div>";
}
/*-------------------------------------------------------------*/


/*--------------------------друзья онлайн----------------------*/
$set['p_str']=20;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` INNER JOIN `user` ON `frends`.`frend`=`user`.`id` WHERE `frends`.`user` = '$ank[id]' AND `frends`.`i` = '1' AND `user`.`date_last`>'".(time()-600)."'"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

$q = mysql_query("SELECT * FROM `frends` INNER JOIN `user` ON `frends`.`frend`=`user`.`id` WHERE `frends`.`user` = '$ank[id]' AND `frends`.`i` = '1' AND `user`.`date_last`>'".(time()-600)."' ORDER BY `user`.`date_last` DESC LIMIT $start, $set[p_str]");

if ($k_post>0)
{
echo "<div class='foot'>Друзья онлайн ($k_post)</div>";
}
while ($post3 = mysql_fetch_assoc($q))
{
$ank3=get_user($post3['frend']);
/*---------зебра---------*/
if ($num==0)
{
echo "  <div class='nav1'>\n";
$num=1;
}
elseif ($num==1)
{
echo "  <div class='nav2'>\n";
$num=0;
}
/*-----------------------*/
echo avatar($ank3['id']);
echo ' <a href="/info.php?id='.$ank3['id'].'">'.$ank3['nick'].'</a>'.medal($ank3['id']).' '.online($ank3['id']).' ('.(($ank3['pol']==1)?'М':'Ж').')<br />';

echo '<a href="/mail.php?id='.$ank3['id'].'"><img src="/style/icons/pochta.gif" alt="*" /> Сообщение</a> ';

echo "</div>";
}


/*---------------------the end--------------------------*/
?>
</td>
<td class='block_info'>
<?
/*
 Вывод анкеты, фото, и стены
*/
echo "<div class='main2'>";
echo " ".group($ank['id'])." $ank[nick]";
echo " ".medal($ank['id'])." ".online($ank['id'])." <font size='small'>".vremja($ank['date_last'])."</font> ";
if ((user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset')) && $ank['id']!=$user['id'])
echo "<a href='/adm_panel/ban.php?id=$ank[id]'><font color=red>[Бан]</font></a>\n";
echo "</div>";


//-------------статус вывод------------//



if ($status['id'] || $ank['id'] == $user['id'])
{
echo '<div class="st_1"></div>';

echo '<div class="st_2">';
if (isset($user) && $user['id']==$ank['id']){

echo "<form style='border:none;' action='?id=".$ank['id']."' method=\"post\">";
echo "<input type=\"text\" style='width:80%;' name=\"status\" value=\"\"/> \n";
echo "<input class=\"submit\" style=' width:15%;' type=\"submit\" value=\"+\" />\n";
echo "</form>";

}

if ($status['id'])echo output_text($status['msg']) . ' <font style="font-size:10px; color:gray;">' . vremja($status['time']) . '</font>';
echo "</div>"; 
if ($status['id'])
{
	echo " <a href='/user/status/komm.php?id=$status[id]'><img src='/style/icons/bbl4.png' alt=''/> " . mysql_result(mysql_query("SELECT COUNT(*) FROM `status_komm` WHERE `id_status` = '$status[id]'"),0) . " </a> ";
	$l=mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id_status` = '$status[id]'"),0);


if (isset($user) && $user['id']!=$ank['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `status_like` WHERE `id_status` = '$status[id]' AND `id_user` = '$user[id]' LIMIT 1"),0)==0)
{	

	echo " <a href='/info.php?id=$ank[id]&amp;like'><img src='/style/icons/like.gif' alt='*'/> Класс!</a> • ";
	$like = $l;
}
else if(isset($user) && $user['id']!=$ank['id'])
{
	echo " <img src='/style/icons/like.gif' alt=''/> Вы и ";
	$like = $l-1;
}
else
{
	echo " <img src='/style/icons/like.gif' alt=''/> ";
	$like = $l;
} 


	echo "<a href='/user/status/like.php?id=$status[id]'> $like чел. </a>";
	echo '</div>';



}

 /* Общее колличество статусов */
$st = mysql_result(mysql_query("SELECT COUNT(*) FROM `status` WHERE `id_user` = '$ank[id]'"),0);

if ($st > 0)
{
	echo "<div class='main2'>"; // пишем свой див
	echo " &rarr; <a href='/user/status/index.php?id=$ank[id]'>Все статусы</a> (" . $st . ")\n";
	echo "</div>";
}
}





/*
=====================================
Анкета пользователя, если автор
то выводим ссылки на редактирование
полей, если нет то нет =)
=====================================
*/
if (isset($user) && $ank['id']==$user['id'])
{
$name = "<a href='/user/info/edit.php?act=ank_web&amp;set=name'>";
$date = "<a href='/user/info/edit.php?act=ank_web&amp;set=date'>";
$gorod = "<a href='/user/info/edit.php?act=ank_web&amp;set=gorod'>";

$orien = "<a href='/user/info/edit.php?act=ank_web&amp;set=orien'>";
$loves = "<a href='/user/info/edit.php?act=ank_web&amp;set=loves'>";
$opar = "<a href='/user/info/edit.php?act=ank_web&amp;set=opar'>";

$volos = "<a href='/user/info/edit.php?act=ank_web&amp;set=volos'>";
$ves = "<a href='/user/info/edit.php?act=ank_web&amp;set=ves'>";
$glaza = "<a href='/user/info/edit.php?act=ank_web&amp;set=glaza'>";
$rost = "<a href='/user/info/edit.php?act=ank_web&amp;set=rost'>";
$osebe = "<a href='/user/info/edit.php?act=ank_web&amp;set=osebe'>";
$pol = "<a href='/user/info/edit.php?act=ank_web&amp;set=pol'>";
$telo = "<a href='/user/info/edit.php?act=ank_web&amp;set=telo'>";

$avto = "<a href='/user/info/edit.php?act=ank_web&amp;set=avto'>";
$baby = "<a href='/user/info/edit.php?act=ank_web&amp;set=baby'>";
$proj = "<a href='/user/info/edit.php?act=ank_web&amp;set=proj'>";
$zan = "<a href='/user/info/edit.php?act=ank_web&amp;set=zan'>";
$smok = "<a href='/user/info/edit.php?act=ank_web&amp;set=smok'>";
$mat_pol = "<a href='/user/info/edit.php?act=ank_web&amp;set=mat_pol'>";

$mail = "<a href='/user/info/edit.php?act=ank_web&amp;set=mail'>";
$icq = "<a href='/user/info/edit.php?act=ank_web&amp;set=icq'>";
$skype = "<a href='/user/info/edit.php?act=ank_web&amp;set=skype'>";
$mobile = "<a href='/user/info/edit.php?act=ank_web&amp;set=mobile'>";

$a = "</a>";

}else{
$name = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$date =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$gorod =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";

$orien = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$loves = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$opar = "<font style='padding:1px; color : #005ba8; padding:1px;'>";

$avto = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$baby =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$zan = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$smok = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$mat_pol =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$proj =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";

$telo =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$volos = "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$ves =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$glaza =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$rost =  "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$osebe =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$pol =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";

$mail =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$icq =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$skype =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$mobile =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";


$alko =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$nark =   "<font style='padding:1px; color : #005ba8; padding:1px;'>";
$a = "</font>";

}

/*
=====================================
Основное
=====================================
*/
echo "<div class='nav1'>";
if ($ank['ank_name']!=NULL)
echo "$name<span class=\"ank_n\">Имя:</span>$a <span class=\"ank_d\">$ank[ank_name]</span><br />\n";
else
echo "$name<span class=\"ank_n\">Имя:</span>$a<br />\n";

echo "$pol<span class=\"ank_n\">Пол:</span>$a <span class=\"ank_d\">".(($ank['pol']==1)?'Мужской':'Женский')."</span><br />\n";

if ($ank['ank_city']!=NULL)
echo "$gorod<span class=\"ank_n\">Город:</span>$a <span class=\"ank_d\">".output_text($ank['ank_city'])."</span><br />\n";
else
echo "$gorod<span class=\"ank_n\">Город:</span>$a<br />\n";

if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "$date<span class=\"ank_n\">Дата рождения:</span>$a $ank[ank_d_r] $ank[mes] $ank[ank_g_r]г. <br />\n";
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo "<span class=\"ank_n\">Возраст:</span> $ank[ank_age] \n";
}
elseif($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL)
{
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "$date<span class=\"ank_n\">День рождения:</span>$a $ank[ank_d_r] $ank[mes] \n";
}

if ($ank['ank_d_r']>=19 && $ank['ank_m_r']==1){echo "| Водолей<br />";}
elseif ($ank['ank_d_r']<=19 && $ank['ank_m_r']==2){echo "| Водолей<br />";}
elseif ($ank['ank_d_r']>=18 && $ank['ank_m_r']==2){echo "| Рыбы<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==3){echo "| Рыбы<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==3){echo "| Овен<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==4){echo "| Овен<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==4){echo "| Телец<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==5){echo "| Телец<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==5){echo "| Близнецы<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==6){echo "| Близнецы<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==6){echo "| Рак<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==7){echo "| Рак<br />";}
elseif ($ank['ank_d_r']>=23 && $ank['ank_m_r']==7){echo "| Лев<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==8){echo "| Лев<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==8){echo "| Дева<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==9){echo "| Дева<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==9){echo "| Весы<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==10){echo "| Весы<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==10){echo "| Скорпион<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==11){echo "| Скорпион<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==11){echo "| Стрелец<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==12){echo "| Стрелец<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==12){echo "| Козерог<br />";}
elseif ($ank['ank_d_r']<=20 && $ank['ank_m_r']==1){echo "| Козерог<br />";}

echo "</div>\n";



/*
=====================================
Внешность
=====================================
*/
echo "<div class='nav2'>";
if ($ank['ank_rost']!=NULL)
echo "$rost<span class=\"ank_n\">Рост:</span>$a <span class=\"ank_d\">$ank[ank_rost]</span><br />\n";
else
echo "$rost<span class=\"ank_n\">Рост:</span>$a<br />\n";


if ($ank['ank_ves']!=NULL)
echo "$ves<span class=\"ank_n\">Вес:</span>$a <span class=\"ank_d\">$ank[ank_ves]</span><br />\n";
else
echo "$ves<span class=\"ank_n\">Вес:</span>$a<br />\n";

if ($ank['ank_cvet_glas']!=NULL)
echo "$glaza<span class=\"ank_n\">Цвет глаз:</span>$a <span class=\"ank_d\">$ank[ank_cvet_glas]</span><br />\n";
else
echo "$glaza<span class=\"ank_n\">Цвет глаз:</span>$a<br />\n";


if ($ank['ank_volos']!=NULL)
echo "$volos<span class=\"ank_n\">Волосы:</span>$a <span class=\"ank_d\">$ank[ank_volos]</span><br />\n";
else
echo "$volos<span class=\"ank_n\">Волосы:</span>$a<br />\n";

echo "$telo<span class=\"ank_n\">Телосложение:</span>$a";
if ($ank['ank_telosl']==1)
echo " <span class=\"ank_d\">Нет ответа</span><br />\n";
if ($ank['ank_telosl']==2)
echo " <span class=\"ank_d\">Худощавое</span><br />\n";
if ($ank['ank_telosl']==3)
echo " <span class=\"ank_d\">Обычное</span><br />\n";
if ($ank['ank_telosl']==4)
echo " <span class=\"ank_d\">Спортивное</span><br />\n";
if ($ank['ank_telosl']==5)
echo " <span class=\"ank_d\">Мускулистое</span><br />\n";
if ($ank['ank_telosl']==6)
echo " <span class=\"ank_d\">Плотное</span><br />\n";
if ($ank['ank_telosl']==7)
echo " <span class=\"ank_d\">Полное</span><br />\n";
if ($ank['ank_telosl']==0)
echo "<br />\n";
echo "</div>\n";




/*
=====================================
Для знакомств
=====================================
*/
echo "<div class='nav1'>";

echo "$orien<span class=\"ank_n\">Ориентация:</span>$a";
if ($ank['ank_orien']==0)
echo "<br />\n";
if ($ank['ank_orien']==1)
echo " <span class=\"ank_d\">Гетеро</span><br />\n";
if ($ank['ank_orien']==2)
echo " <span class=\"ank_d\">Би</span><br />\n";
if ($ank['ank_orien']==3)
echo " <span class=\"ank_d\">Гей/Лесби</span><br />\n";

echo "$loves<span class=\"ank_n\">Цели знакомства:</span>$a<br />";

if ($ank['ank_lov_1']==1)echo "&raquo; Дружба и общение<br />";
if ($ank['ank_lov_2']==1)echo "&raquo; Переписка<br />";
if ($ank['ank_lov_3']==1)echo "&raquo; Любовь, отношения<br />";
if ($ank['ank_lov_4']==1)echo "&raquo; Регулярный секс вдвоем<br />";
if ($ank['ank_lov_5']==1)echo "&raquo; Секс на один-два раза<br />";
if ($ank['ank_lov_6']==1)echo "&raquo; Групповой секс<br />";
if ($ank['ank_lov_7']==1)echo "&raquo; Виртуальный секс<br />";
if ($ank['ank_lov_8']==1)echo "&raquo; Предлагаю интим за деньги<br />";
if ($ank['ank_lov_9']==1)echo "&raquo; Ищу интим за деньги<br />";
if ($ank['ank_lov_10']==1)echo "&raquo; Брак, создание семьи<br />";
if ($ank['ank_lov_11']==1)echo "&raquo; Рождение, воспитание ребенка<br />";
if ($ank['ank_lov_12']==1)echo "&raquo; Брак для вида<br />";
if ($ank['ank_lov_13']==1)echo "&raquo; Совместная аренда жилья<br />";
if ($ank['ank_lov_14']==1)echo "&raquo; Занятия спортом<br />";


if ($ank['ank_o_par']!=NULL)
echo "$opar<span class=\"ank_n\">О партнере:</span>$a <span class=\"ank_d\">".output_text($ank['ank_o_par'])."</span><br />\n";
else
echo "$opar<span class=\"ank_n\">О партнере:</span>$a<br />\n";

if ($ank['ank_o_sebe']!=NULL)
echo "$osebe<span class=\"ank_n\">О себе:</span>$a <span class=\"ank_d\">".output_text($ank['ank_o_sebe'])."</span><br />\n";
else
echo "$osebe<span class=\"ank_n\">О себе:</span>$a<br />\n";
echo "</div>\n";



/*
=====================================
О себе
=====================================
*/
echo "<div class='nav2'>";
if ($ank['ank_zan']!=NULL)
echo "$zan<span class=\"ank_n\">Чем занимаюсь:</span>$a <span class=\"ank_d\">".output_text($ank['ank_zan'])."</span><br />\n";
else
echo "$zan<span class=\"ank_n\">Чем занимаюсь:</span>$a<br />\n";

echo "$smok<span class=\"ank_n\">Курение:</span>$a";
if ($ank['ank_smok']==1)
echo " <span class=\"ank_d\">Не курю</span><br />\n";
if ($ank['ank_smok']==2)
echo " <span class=\"ank_d\">Курю</span><br />\n";
if ($ank['ank_smok']==3)
echo " <span class=\"ank_d\">Редко</span><br />\n";
if ($ank['ank_smok']==4)
echo " <span class=\"ank_d\">Бросаю</span><br />\n";
if ($ank['ank_smok']==5)
echo " <span class=\"ank_d\">Успешно бросил</span><br />\n";
if ($ank['ank_smok']==0)
echo "<br />\n";


echo "$mat_pol<span class=\"ank_n\">Материальное положение:</span>$a";
if ($ank['ank_mat_pol']==1)
echo " <span class=\"ank_d\">Непостоянные заработки</span><br />\n";
if ($ank['ank_mat_pol']==2)
echo " <span class=\"ank_d\">Постоянный небольшой доход</span><br />\n";
if ($ank['ank_mat_pol']==3)
echo " <span class=\"ank_d\">Стабильный средний доход</span><br />\n";
if ($ank['ank_mat_pol']==4)
echo " <span class=\"ank_d\">Хорошо зарабатываю / обеспечен</span><br />\n";
if ($ank['ank_mat_pol']==5)
echo " <span class=\"ank_d\">Не зарабатываю</span><br />\n";
if ($ank['ank_mat_pol']==0)
echo "<br />\n";

echo "$avto<span class=\"ank_n\">Наличие автомобиля:</span>$a";
if ($ank['ank_avto_n']==1)
echo " <span class=\"ank_d\">Есть</span><br />\n";
if ($ank['ank_avto_n']==2)
echo " <span class=\"ank_d\">Нет</span><br />\n";
if ($ank['ank_avto_n']==3)
echo " <span class=\"ank_d\">Хочу купить</span><br />\n";
if ($ank['ank_avto_n']==0)
echo "<br />\n";
if ($ank['ank_avto'] && $ank['ank_avto_n']!=2 && $ank['ank_avto_n']!=0)echo "&raquo; <span class=\"ank_d\">".output_text($ank['ank_avto'])."</span><br />";



echo "$proj<span class=\"ank_n\">Проживание:</span>$a";
if ($ank['ank_proj']==1)
echo " <span class=\"ank_d\">Отдельная квартира (снимаю или своя)</span><br />\n";
if ($ank['ank_proj']==2)
echo " <span class=\"ank_d\">Комната в общежитии, коммуналка</span><br />\n";
if ($ank['ank_proj']==3)
echo " <span class=\"ank_d\">Живу с родителями</span><br />\n";
if ($ank['ank_proj']==4)
echo " <span class=\"ank_d\">Живу с приятелем / с подругой</span><br />\n";
if ($ank['ank_proj']==5)
echo " <span class=\"ank_d\">Живу с партнером или супругом (-ой)</span><br />\n";
if ($ank['ank_proj']==6)
echo " <span class=\"ank_d\">Нет постоянного жилья</span><br />\n";
if ($ank['ank_proj']==0)
echo "<br />\n";


echo "$baby<span class=\"ank_n\">Есть ли дети:</span>$a";
if ($ank['ank_baby']==1)
echo " <span class=\"ank_d\">Нет</span><br />\n";
if ($ank['ank_baby']==2)
echo " <span class=\"ank_d\">Нет, но хотелось бы</span><br />\n";
if ($ank['ank_baby']==3)
echo " <span class=\"ank_d\">Есть, живем вместе</span><br />\n";
if ($ank['ank_baby']==4)
echo " <span class=\"ank_d\">Есть, живем порознь</span><br />\n";
if ($ank['ank_proj']==0)
echo "<br />\n";


echo "</div>\n";


if (isset($user) && $ank['id']==$user['id'])
{
$alko = "<a href='/user/info/edit.php?act=ank_web&amp;set=alko'>";
$nark = "<a href='/user/info/edit.php?act=ank_web&amp;set=nark'>";

}

/*
=====================================
Дополнительно
=====================================
*/

echo "<div class='nav1'>";

echo "$alko<span class=\"ank_n\">Алкоголь:</span>$a";
if ($ank['ank_alko_n']==1)
echo " <span class=\"ank_d\">Да, выпиваю</span><br />\n";
if ($ank['ank_alko_n']==2)
echo " <span class=\"ank_d\">Редко, по праздникам</span><br />\n";
if ($ank['ank_alko_n']==3)
echo " <span class=\"ank_d\">Нет, категорически не приемлю</span><br />\n";
if ($ank['ank_alko_n']==0)
echo "<br />\n";
if ($ank['ank_alko'] && $ank['ank_alko_n']!=3 && $ank['ank_alko_n']!=0)echo "&raquo; <span class=\"ank_d\">".output_text($ank['ank_alko'])."</span><br />";



echo "$nark<span class=\"ank_n\">Наркотики:</span>$a";
if ($ank['ank_nark']==1)
echo " <span class=\"ank_d\">Да, курю травку</span><br />\n";
if ($ank['ank_nark']==2)
echo " <span class=\"ank_d\">Да, люблю любой вид наркотических средств</span><br />\n";
if ($ank['ank_nark']==3)
echo " <span class=\"ank_d\">Бросаю, прохожу реабилитацию</span><br />\n";
if ($ank['ank_nark']==4)
echo " <span class=\"ank_d\">Нет, категорически не приемлю</span><br />\n";
if ($ank['ank_nark']==0)
echo "<br />\n";

echo "</div>\n";



/*
=====================================
Контакты
=====================================
*/
echo "<div class='nav2'>";
if ($ank['ank_icq']!=NULL && $ank['ank_icq']!=0)
echo "$icq<span class=\"ank_n\">ICQ:</span>$a <span class=\"ank_d\">$ank[ank_icq]</span><br />\n";
else
echo "$icq<span class=\"ank_n\">ICQ:</span>$a<br />\n";

echo "$mail E-Mail:$a";
if ($ank['ank_mail']!=NULL && ($ank['set_show_mail']==1 || isset($user) && ($user['level']>$ank['level'] || $user['level']==4))){
if ($ank['set_show_mail']==0)$hide_mail=' (скрыт)';else $hide_mail=NULL;
if (preg_match("#(@mail\.ru$)|(@bk\.ru$)|(@inbox\.ru$)|(@list\.ru$)#", $ank['ank_mail']))
echo " <a href=\"mailto:$ank[ank_mail]\" title=\"Написать письмо\" class=\"ank_d\">$ank[ank_mail]</a>$hide_mail<br />\n";
else 
echo " <a href=\"mailto:$ank[ank_mail]\" title=\"Написать письмо\" class=\"ank_d\">$ank[ank_mail]</a>$hide_mail<br />\n";
}
else
{
echo "<br />";
}
if ($ank['ank_n_tel']!=NULL)
echo "$mobile<span class=\"ank_n\">Телефон:</span>$a <span class=\"ank_d\">$ank[ank_n_tel]</span><br />\n";
else
echo "$mobile<span class=\"ank_n\">Телефон:</span>$a<br />\n";
if ($ank['ank_skype']!=NULL)
echo "$skype<span class=\"ank_n\">Skype:</span>$a <span class=\"ank_d\">$ank[ank_skype]</span><br />\n";
else
echo "$skype<span class=\"ank_n\">Skype:</span>$a<br />\n";
echo "</div>\n";

echo "</div>";



/*
===============================
Последние добавленные фото
===============================
*/

$sql = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT 8");
$coll=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC"),0);

if ($coll>0){
	echo "<div class='foot'>";
	echo "<img src='/style/icons/pht2.png' alt='*' /> ";
	echo "<a href='/foto/$ank[id]/'>Фотографии</a> ";
	echo "(" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]'"),0) . ")";
	echo "</div>";
	echo "<div class='nav2'>";
	
	while ($photo = mysql_fetch_assoc($sql)){
		echo "<a href='/foto/$ank[id]/$photo[id_gallery]/$photo[id]/'><img style='padding:1px;  padding: 0px; margin:2px; height: 53px; width:53px; border: 1px #4fdafd solid; vertical-align:top;  background-image: url(); background-position: center top;' src='/foto/foto50/$photo[id].$photo[ras]' alt=''/></a>";
	}
	echo "</div>";
}


/*
=====================================
Стена юзвера
=====================================
*/
echo "<div class='foot'>";
if (isset($user))
{
echo "<img src='/style/icons/stena.gif' alt='*' /> ";

	if ($user['wall']==0)
	echo "<a href='/info.php?id=$ank[id]&amp;wall=1'>Стена</a>\n";
	else
	echo "<a href='/info.php?id=$ank[id]&amp;wall=0'>Стена</a>\n";
	}else{
	echo "<img src='/style/icons/stena.gif' alt='*' /> Стена";
	}
echo "</div>";

if ($user['wall']==0){
include_once 'user/stena/index.php';
}
/*--------------------------------------------------------------*/

?>
</td>
</tr>
</table>
