<?
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';

if (!isset($user) && !isset($_GET['id'])){header("Location: /index.php?".SID);exit;}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
aut();


echo "<div class='p_t'>\n";
echo "<img src='/img/tabor/id.png' alt='' class='icon'/> <span class='ank_n'>ID на fibik.tk:</span> <span class='ank_d'>$ank[id]</span><br />\n";
echo "<img src='/img/tabor/top10.png' alt='' class='icon'/>\n";
echo "Рейтинг <font color='red'>$ank[rating]</font> % ";
if($ank['rating']>=100 && $ank['rating']<=200)echo " <img src='/style/stars/rank1.gif'></img><br />"; 
if($ank['rating']>=201 && $ank['rating']<=300)echo " <img src='/style/stars/rank2.gif'></img><br />";
if($ank['rating']>=301 && $ank['rating']<=400)echo " <img src='/style/stars/rank3.gif'></img><br />";
if($ank['rating']>=401 && $ank['rating']<=500)echo " <img src='/style/stars/rank4.gif'></img><br />";
if($ank['rating']>=501 && $ank['rating']<=600)echo " <img src='/style/stars/rank5.gif'></img><br />";
if($ank['rating']>=601 && $ank['rating']<=700)echo " <img src='/style/stars/rank6.gif'></img><br />";
if($ank['rating']>=701 && $ank['rating']<=800)echo " <img src='/style/stars/rank7.gif'></img><br />";
if($ank['rating']>=801 && $ank['rating']<=900)echo " <img src='/style/stars/rank8.gif'></img><br />";
if($ank['rating']>=901 && $ank['rating']<=1000)echo " <img src='/style/stars/rank9.gif'></img><br />";
if($ank['rating']>=1001 && $ank['rating']<=10000)echo " <img src='/style/stars/rank10.gif'></img><br />";

echo "<div class='row2'>\n";
echo "монеты: $ank[balls]<br />\n";
$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"),0);
echo "Тем в форуме: $k_them<br />\n";
$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"),0);
echo "Сообщ. в форуме: $k_p_forum<br />\n";
$chat_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$ank[id]'"),0);
echo "Сообщ. в чате: $chat_post<br />\n";

if (isset($access['show_all_info'])){
$guest3=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `id_user` = '$ank[id]'"),0);
echo "Гостевая: $guest3<br />\n";
$mail3=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$ank[id]'"),0);
echo "Приватные сообщения: $mail3<br />\n";
}
$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$ank[id]'"),0);
echo "Комментарии новостей: $news_komm<br />\n";
echo "</div>\n";

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


if (isset($user) && $user['id']==$ank['id'])echo "\n";


echo " <a href='/ava/?id=".$ank['id']."'>";
 avatar($ank['id']);
 echo "</a>";



if ($ank['rating']>='0' && $ank['rating']<='100'){

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='101' && $ank['rating']<='200'){

$z='100';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='201' && $ank['rating']<='300'){

$z='200';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='301' && $ank['rating']<='400'){

$z='300';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='401' && $ank['rating']<='500'){

$z='400';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='501' && $ank['rating']<='600'){

$z='500';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}

if ($ank['rating']>='601' && $ank['rating']<='10000'){

$z='10000';

$s=$ank['rating'] - $z;

echo '<div style="font-size: 10px;border-top:1px solid #eeeedd;background-color:#eeeedd;height:10px;width:150px"><div style="font-size: 10px;background-color:#ace0ff;height:10px;width:'.$s.'%;"></div><span style="position:relative;top:-12px;left:45%;right:57%;color:#555555;">'.$ank[rating].'%</span></div>';}



echo ' <img src="/style/themes/green/graph/avacom.gif" alt="avacom"/>  <a href="ava_comm.php?uid='.$ank['id'].'">Обсудить аву</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `akimitsu_com` WHERE `uid` = '$ank[id]';"),0).')';

if($ank['rating']>=100 && $ank['rating']<=200)echo " <img src='/style/stars/rank1.gif'></img><br />"; 
if($ank['rating']>=201 && $ank['rating']<=300)echo " <img src='/style/stars/rank2.gif'></img><br />";
if($ank['rating']>=301 && $ank['rating']<=400)echo " <img src='/style/stars/rank3.gif'></img><br />";
if($ank['rating']>=401 && $ank['rating']<=500)echo " <img src='/style/stars/rank4.gif'></img><br />";
if($ank['rating']>=501 && $ank['rating']<=600)echo " <img src='/style/stars/rank5.gif'></img><br />";
if($ank['rating']>=601 && $ank['rating']<=700)echo " <img src='/style/stars/rank6.gif'></img><br />";
if($ank['rating']>=701 && $ank['rating']<=800)echo " <img src='/style/stars/rank7.gif'></img><br />";
if($ank['rating']>=801 && $ank['rating']<=900)echo " <img src='/style/stars/rank8.gif'></img><br />";
if($ank['rating']>=901 && $ank['rating']<=1000)echo " <img src='/style/stars/rank9.gif'></img><br />";
if($ank['rating']>=1001 && $ank['rating']<=10000)echo " <img src='/style/stars/rank10.gif'></img><br />";

if ($ank['ank_name']!=NULL)echo "<span class=\"ank_n\">Имя:</span> <span class=\"ank_d\">$ank[ank_name]</span><br />\n";
else
echo "<span class=\"ank_n\">Имя:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['familiya']!=NULL)echo "<span class=\"ank_n\">Фамилия:</span> <span class=\"ank_d\">$ank[familiya]</span><br />\n";
else
echo "<span class=\"ank_n\">Фамилия:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";


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

if ($ank['ank_city']!=NULL)echo "<span class=\"ank_n\">Город:</span> <span class=\"ank_d\">$ank[ank_city]</span><br />\n";
else
echo "<span class=\"ank_n\">Город:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
if ($ank['sem_pol'] == null){ echo "<span class=\"ank_n\">Семейное положение:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
}else{
if ($ank['pol'] == 1){
if ($ank['sem_pol']==1)
echo "<span class=\"ank_n\">Семейное положение:</span> <span class=\"ank_d\">Женат</span><br />\n";
else
echo "<span class=\"ank_n\">Семейное положение:</span> <span class=\"ank_d\">Не женат</span><br />\n";
}else{

if ($ank['sem_pol']==1)
echo "<span class=\"ank_n\">Семейное положение:</span> <span class=\"ank_d\">Замужем</span><br />\n";
else
echo "<span class=\"ank_n\">Семейное положение:</span> <span class=\"ank_d\">Свободная я =)</span><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 "<span class=\"ank_n\">Дата рождения:</span> <span class=\"ank_d\">$ank[ank_d_r] $ank[mes] $ank[ank_g_r]г.</span><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> <span class=\"ank_d\">$ank[ank_age] лет</span><br />\n";
$d=$ank['ank_d_r']; 
$m=$ank['ank_m_r'];

if($m=="1" || $m=="01"){if(20<=$d){$z='Водолей';}else{$z='Козерог';}}
if($m=="2" || $m=="02"){if(19<=$d){$z='Рыба';}else{$z='Водолей';}}
if($m=="3" || $m=="03"){if(21<=$d){$z='Овен';}else{$z='Рыба';}}
if($m=="4" || $m=="04"){if(21<=$d){$z='Телец';}else{$z='Овен';}}
if($m=="5" || $m=="05"){if(21<=$d){$z='Близнецы';}else{$z='Телец';}}
if($m=="6" || $m=="06"){if(22<=$d){$z='Рак';}else{$z='Близнецы';}}
if($m=="7" || $m=="07"){if(23<=$d){$z='Лев';}else{$z='Рак';}}
if($m=="8" || $m=="08"){if(23<=$d){$z='Дева';}else{$z='Лев';}}
if($m=="9" || $m=="09"){if(23<=$d){$z='Весы';}else{$z='Дева';}}
if($m=="10"){if(23<=$d){$z='Скорпион';}else{$z='Весы';}}
if($m=="11"){if(22<=$d){$z='Стрелец';}else{$z='Скорпион';}}
if($m=="12"){if(22<=$d){$z='Козерог';}else{$z='Стрелец';}}

echo "<span class=\"ank_n\">Знак зодиака:</span>  <span class=\"ank_d\">".$z."</span><br />\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 "<span class=\"ank_n\">День рождения:</span> <span class=\"ank_d\">$ank[ank_d_r] $ank[mes]</span><br />\n";



}
else
echo "<span class=\"ank_n\">Дата рождения:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";






if ($ank['ank_o_sebe']!=NULL)echo "<span class=\"ank_n\">О себе:</span> <span class=\"ank_d\">$ank[ank_o_sebe]</span><br />\n";
else
echo "<span class=\"ank_n\">О себе:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";



echo "<div class='rowup'>";
if ($ank['mesto_raboty']!=NULL)echo "<span class=\"ank_n\">Место работы:</span> <span class=\"ank_d\">$ank[mesto_raboty]</span><br />\n";
else
echo "<span class=\"ank_n\">Место работы:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['interesy']!=NULL)echo "<span class=\"ank_n\">Интересы:</span> <span class=\"ank_d\">$ank[interesy]</span><br />\n";
else
echo "<span class=\"ank_n\">Интересы:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ucheba']!=NULL)echo "<span class=\"ank_n\">Место учебы:</span> <span class=\"ank_d\">$ank[ucheba]</span><br />\n";
else
echo "<span class=\"ank_n\">Место учебы:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
echo "</div>\n";
if ($ank['filmy']!=NULL)echo "<span class=\"ank_n\">Любимые фильмы:</span> <span class=\"ank_d\">$ank[filmy]</span><br />\n";
else
echo "<span class=\"ank_n\">Любимые фильмы:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['music']!=NULL)echo "<span class=\"ank_n\">Любимая музыка:</span> <span class=\"ank_d\">$ank[music]</span><br />\n";
else
echo "<span class=\"ank_n\">Любимая музыка:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
if ($ank['ank_rost']!=NULL)echo "<span class=\"ank_n\">Рост:</span> <span class=\"ank_d\">$ank[ank_rost]</span><br />\n";
else
echo "<span class=\"ank_n\">Рост:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_ves']!=NULL)echo "<span class=\"ank_n\">Вес:</span> <span class=\"ank_d\">$ank[ank_ves]</span><br />\n";
else
echo "<span class=\"ank_n\">Вес:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_c_g']!=NULL)echo "<span class=\"ank_n\">Цвет глаз:</span> <span class=\"ank_d\">$ank[ank_c_g]</span><br />\n";
else
echo "<span class=\"ank_n\">Цвет глаз:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_telo']!=NULL)echo "<span class=\"ank_n\">Телосложение:</span> <span class=\"ank_d\">$ank[ank_telo]</span><br />\n";
else
echo "<span class=\"ank_n\">Телосложение:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_na_tele']!=NULL)echo "<span class=\"ank_n\">А у меня на теле есть:</span> <span class=\"ank_d\">$ank[ank_na_tele]</span><br />\n";
else
echo "<span class=\"ank_n\">А у меня на теле есть:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_mobila']!=NULL)echo "<span class=\"ank_n\">Модель телефона:</span> <span class=\"ank_d\">$ank[ank_mobila]</span><br />\n";
else
echo "<span class=\"ank_n\">Модель телефона:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";

if ($ank['ank_cel']!=NULL)echo "<span class=\"ank_n\">Цель знакомства:</span> <span class=\"ank_d\">$ank[ank_cel]</span><br />\n";
else
echo "<span class=\"ank_n\">Цель знакомства:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
echo "<div class='rowup'>";
if ($ank['ank_icq']!=NULL && $ank['ank_icq']!=0)
echo "<span class=\"ank_n\">ICQ:</span> <img src='http://wwp.icq.com/scripts/online.dll?icq=$ank[ank_icq]&img=5' /><span class=\"ank_d\">$ank[ank_icq]</span><br />\n";
else
echo "<span class=\"ank_n\">ICQ:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";


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;
echo "<span class=\"ank_n\">E-mail:</span> <img src='http://status.mail.ru/?$ank[ank_mail]' width='13' height='13' alt='Агент@mail.ru' border='0'><a href=\"mailto:$ank[ank_mail]\" title=\"Написать письмо\" class=\"ank_d\">$ank[ank_mail]</a>$hide_mail<br />\n";
}
else
echo "<span class=\"ank_n\">E-mail:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";


if ($ank['ank_n_tel']!=NULL)echo "<span class=\"ank_n\">Телефон:</span> <span class=\"ank_d\">$ank[ank_n_tel]</span><br />\n";
else
echo "<span class=\"ank_n\">Телефон:</span> <span class=\"ank_no\">Не заполнено</span><br />\n";
echo "</div>\n";


echo "<div class='foot'>\n";



if (isset($user) && $user['id']==$ank['id'])echo "&raquo;<a href=\"/anketa.php\">Изменить анкету</a><br />\n";

if (isset($user) && ($user['level']>$ank['level'] || $user['level'] > 0))
{


echo "&raquo;<a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />\n";

if ($user['id']!=$ank['id']){
if ($ank['ban']>$time)
{
if (isset($access['ban_unset']))
echo "&raquo;<a href='/adm_panel/ban.php?id=$ank[id]&amp;act=del'>Снять бан</a><br />\n";
}
else 
{
if (isset($access['ban_set']))
echo "&raquo;<a href='/adm_panel/ban.php?id=$ank[id]'>Забанить пользователя</a><br />\n";
}
if (isset($user) && ($user['id'] == 1 or $user['id'] == 20)){
echo "<span class=\"ank_n\">IP:</span> <span class=\"ank_d\">".long2ip($ank['ip'])."</span>";
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip]'>Бан</a>] <br/>";
echo "&raquo;<a href='/adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a>";
if (count(user_collision(@$mass,1))>1)
echo " (<a href='/adm_panel/delete_user.php?id=$ank[id]&amp;all'>Все ники</a>)";
echo "<br />\n";}}}
echo "&laquo;<a href='info.php?id=$ank[id]'>Назад ($ank[nick])</a><br />\n";
echo "</div>\n";
include_once 'sys/inc/tfoot.php';
?>ank_n\ /span/aank_d\/spanspan class=\