<?
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))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);


if ($ank['id']==0)
{
$ank=get_user($ank['id']);
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
aut();






if (isset($user) && $user['id']!=$ank['id'])
{mysql_query("UPDATE `user` SET `prosm` = '".($ank['prosm']+1)."' WHERE `id` = '$ank[id]' LIMIT 1");}




echo "<span class=\"status\">$ank[group_name]</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";




if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "<div class='foot'>f<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />\n</div>\n";

include_once 'sys/inc/tfoot.php';
exit;
}

$ank=get_user($ank['id']);
if(!$ank){header("Location: /index.php?".SID);exit;}








$ank['rating']=intval(@mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
include_once 'sys/inc/thead.php';
title();


if ((!isset($_SESSION['refer']) || $_SESSION['refer']==NULL)
&& isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL &&
!ereg('info\.php',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&',ereg_replace('^http://[^/]*/','/', $_SERVER['HTTP_REFERER']));


if (isset($_POST['rating']) && isset($user)  && $user['id']!=$ank['id'] && $user['balls']>=50 && mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$user[id]'"),0)>=0)
{
$new_r=min(max(@intval($_POST['rating']),-2),2);
mysql_query("DELETE FROM `user_voice2` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]' LIMIT 1");

if ($new_r)
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('$new_r','$user[id]','$ank[id]')");
$ank['rating']=intval(mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
mysql_query("UPDATE `user` SET `rating` = '$ank[rating]' WHERE `id` = '$ank[id]' LIMIT 1");

if ($new_r>0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил положительный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");
if ($new_r<0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил негативный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");
if ($new_r==0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил нейтральный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");



msg('Ваше мнение о пользователе успешно изменено');
}
aut();
$timediff=mysql_result(mysql_query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);

$oneMinute=60; 
$oneHour=60*60; 
$oneDay=60*60*24; 
$dayfield=floor($timediff/$oneDay); 
$hourfield=floor(($timediff-$dayfield*$oneDay)/$oneHour); 
$minutefield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour)/$oneMinute); 
$secondfield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour-$minutefield*$oneMinute)); 

$sDaysLeft=$dayfield; 
$sDaysText = "дн."; 
$nDaysLeftLength =strlen($sDaysLeft); 
$d_1=substr($sDaysLeft,-1,1); 

if (substr($sDaysLeft,-2,1) != 1 && $nDaysLeftLength>1) 
{ 
    if ($d_1 == 2 || $d_1== 3 || $d_1== 4) 
    { 
        $sDaysText = "дн."; 
    } 
    elseif ($d_1== 1) 
    { 
        $sDaysText = "дн."; 
    } 
} 
if ($nDaysLeftLength==1) 
{ 
    if ($d_1==2 || $d_1== 3 || $d_1== 4) 
    { 
        $sDaysText = "дн."; 
    } 
    elseif ($d_1== 1) 
    { 
        $sDaysText = "дн."; 
    } 
} 

$sHoursLeft=$hourfield; 
$sHoursText = "ч."; 
$nHoursLeftLength = strlen($sHoursLeft); 
$h_1=substr($sHoursLeft,-1,1); 
if (substr($sHoursLeft,-2,1) != 1 && $nHoursLeftLength>1) 
{ 
    if ($h_1== 2 || $h_1== 3 || $h_1== 4) 
    { 
        $sHoursText = "ч."; 
    } 
    elseif ($h_1== 1) 
    { 
        $sHoursText = "ч."; 
    } 
} 

if ($nHoursLeftLength==1) 
{ 
    if ($h_1== 2 || $h_1== 3 || $h_1== 4) 
    { 
        $sHoursText = "ч."; 
    } 
    elseif ($h_1== 1) 
    { 
        $sHoursText = "ч."; 
    } 
} 

$sMinsLeft =$minutefield; 
$sMinsText = "мин."; 
$nMinsLeftLength = strlen($sMinsLeft); 
$m_1=substr($sMinsLeft,-1,1); 

if ($nMinsLeftLength>1 && substr($sMinsLeft,-2,1) != 1) 
{ 
    if ($m_1== 2 || $m_1== 3 || $m_1== 4) 
    { 
        $sMinsText = "мин."; 
    } 
    else if ($m_1== 1) 
    { 
        $sMinsText = "мин."; 
    } 
} 

if ($nMinsLeftLength==1) 
{ 
    if ($m_1== 2 || $m_1==3 || $m_1== 4) 
    { 
        $sMinsText = "мин."; 
    } 
    elseif ($m_1== "1") 
    { 
        $sMinsText = "мин."; 
    } 
} 

$sSecsLeft = $secondfield; 
$sSecsText = "сек."; 
$s_1=substr($sSecsLeft,-1,1); 
$nSecsLeftLength = strlen($sSecsLeft); 
if (substr($sSecsLeft,-2,1)!= 1 && $nSecsLeftLength>1) 
{ 
    if ($s_1== 2 || $s_1== 3 || $s_1== 4) 
    { 
        $sSecsText = "сек."; 
    } 
    elseif ($s_1== 1) 
    { 
        $sSecsText = "сек."; 
    } 
} 

if ($nSecsLeftLength==1) 
{ 
    if ($s_1== 2 || $s_1== 3 || $s_1== 4) 
    { 
        $sSecsText = "сек."; 
    } 
    elseif ($sSecsLeft== "1") 
    { 
        $sSecsText = "сек."; 
    } 
} 

$displaystring="". 
$sDaysLeft." ". 
$sDaysText." ". 
$sHoursLeft." ". 
$sHoursText." ". 
$sMinsLeft." ". 
$sMinsText." ". 
$sSecsLeft." ". 
$sSecsText; 

if ($timediff<0) $displaystring='дата уже наступила'; 











if ($ank['ank_enter'] == '3' && !isset($user) && $user['level']==10)
{
echo' <div class="gend">Пользователь ограничил доступ всем к страничке!</div>';
if (isset($user) && $user['id']!=$ank['id'])echo "f<a href=\"/mail.php?id=$ank[id]\">Написать в приват</a><br />\n";
if (isset($user) && $user['id']==$ank['id'])echo "f<a href=\"/anketa.php\">Изменить анкету</a><br />\n";


if ($user['level']>$ank['level']){


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



if ($user['id']!=$ank['id']){



if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "f<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

echo "f<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]&all'>Все ники</a>)";
echo "<br />\n";

}
}
}
include_once 'sys/inc/tfoot.php';
exit();
}

if ($ank['ank_enter'] == '2' && !isset($user))
{
echo' <div class="gend">Эта страница доступна только для друзей пользователя!</div>';

if (isset($user) && $user['id']!=$ank['id'])echo "f<a href=\"/mail.php?id=$ank[id]\">Написать в приват</a><br />\n";
if (isset($user) && $user['id']==$ank['id'])echo "f<a href=\"/anketa.php\">Изменить анкету</a><br />\n";


if ($user['level']>$ank['level']){


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



if ($user['id']!=$ank['id']){



if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "f<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

echo "f<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]&all'>Все ники</a>)";
echo "<br />\n";

}
}
}


include_once 'sys/inc/tfoot.php';
exit();
}


if ($ank['ank_enter'] == '3' && $ank['id'] != $user['id'])
{
echo' <div class="gend">Пользователь ограничил доступ всем к страничке!</div>';

if (isset($user) && $user['id']!=$ank['id'])echo "f<a href=\"/mail.php?id=$ank[id]\">Написать в приват</a><br />\n";
if (isset($user) && $user['id']==$ank['id'])echo "f<a href=\"/anketa.php\">Изменить анкету</a><br />\n";


if ($user['level']>$ank['level']){


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



if ($user['id']!=$ank['id']){



if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "f<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

echo "f<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]&all'>Все ники</a>)";
echo "<br />\n";

}
}
}




include_once 'sys/inc/tfoot.php';
exit();
}



if ($ank['ank_enter'] == '2' && $ank['id'] != $user['id'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '$ank[id]' && `frend` = '$user[id]'"),0) == '0')
{
echo' <div class="gend">Эта страница доступна только для друзей пользователя!</div>';
if (isset($user) && $user['id']!=$ank['id'])echo "f<a href=\"/mail.php?id=$ank[id]\">Написать в приват</a><br />\n";
if (isset($user) && $user['id']==$ank['id'])echo "f<a href=\"/anketa.php\">Изменить анкету</a><br />\n";


if ($user['level']>$ank['level']){


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



if ($user['id']!=$ank['id']){



if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "f<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

echo "f<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]&all'>Все ники</a>)";
echo "<br />\n";

}
}
}








include_once 'sys/inc/tfoot.php';
exit();
}



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



echo "<span class=\"ank_n\">Регистрация:</span> <span class=\"ank_d\">".vremja($ank['date_reg'])."</span><br />\n";


echo "<span class=\"ank_n\">На сайте провел:</span> <span class=\"ank_d\">$displaystring</span><br />\n";

$perehodu=mysql_result(mysql_query("SELECT `perehodu` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);
echo "<span class=\"ank_n\">Переходов по сайту:</span> <span class=\"ank_d\">$perehodu</span><br />\n";


echo " Рейтинг: "; echo "$ank[rating]<br/>";

echo " Балы: "; echo "$ank[balls]<br/>";


echo "<span style='color:green'>";



if ($ank['group_access']>1)echo "<span class='status'>$ank[group_name]</span><br />\n";

echo "</span>";

echo "<span class=\"ank_n\">Последний везит:";
echo "</span> <span class=\"ank_d\">".vremja($ank['date_last'])."</span><br />\n";

$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"),0);

echo "<span class=\"ank_n\">Комм. в форуме:</span> <span class=\"ank_d\">$k_p_forum</span><br />\n";

$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='ank_n'>Нарушений:</span>".(($narush==0)?" <span class='ank_d'>нет</span><br />\n":" <span class=\"ank_d\">$narush</span><br />\n");
echo "</span>";
echo "</div>";
avatar($ank['id']);
echo "<br />\n";

if (isset($user) &&$user['id']==$ank['id'])


{

echo 'Фото: [<a href="/avatar.php">Ред.</a>] / ';
}
echo "<a href='/foto/$ank[id]/'>Все Фото</a><br/>";
echo "<div class='rowup'>";


echo "<div class='busi'>";
if (isset($user) && $user['id']!=$ank['id'])echo "<img src='/i/sendgift.gif' alt='' class='icon'/><a href=\"/present/present.php?user=$ank[id]\">Cделать подарок</a><br />";


echo "</div>";

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time'"), 0)!=0)
{
$q=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' AND `time` > '$time' ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($q))
{
echo "<span class='ank_n'>Забанен до ".vremja($post['time']).":</span>\n";
echo "<span class='ank_d'>".output_text($post['prich'])."</span><br />\n";
}
}
else
{
$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"), 0);
echo "<span class='ank_n'></span>".(($narush==0)?" <span class='ank_d'></span>\n":" <span class=\"ank_d\"></span><br />\n");
}




if ($ank['ank_name']!=NULL)echo "<span class=\"ank_n\">Имя:</span> <span class=\"ank_d\">$ank[ank_name]</span><br />\n";

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


if ($ank['ank_city']!=NULL)echo "Город: <a href='/s.php?go&ank_city=$ank[ank_city]'>$ank[ank_city]</a><br />";



$strana ="Другие страны";


if ($ank['ank_strana']!=NULL)echo "<span class=\"ank_n\">Страна:</span> <span class=\"ank_d\">$ank[ank_strana]</span></a> \n";
if ($ank['ank_strana']==Украина)echo "<img src='style/usr/ua.png' alt=''><br />";
if ($ank['ank_strana']==Россия)echo "<img src='style/usr/ru.png' alt=''><br />";
if ($ank['ank_strana']==Узбекистан)echo "<img src='style/usr/uz.png' alt=''><br />";
if ($ank['ank_strana']==Казахстан)echo "<img src='style/usr/kz.png' alt=''><br />";
if ($ank['ank_strana']==$strana)echo "<img src='style/usr/dr.png' alt=''><br />";
if ($ank['ank_strana']==Белоруссия)echo "<img src='style/usr/by.png' alt=''><br />";
if ($ank['ank_strana']==Азербайджан)echo "<img src='style/usr/az.png' alt=''><br />";



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";
}
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 style='color: #006633'>День рождения:</span><b> <span class=\"ank_d\">$ank[ank_d_r] $ank[mes]</span></b><br />\n";
}
if ($ank['ank_d_r']>=19 && $ank['ank_m_r']==1){echo " Зодиак:</span> Водолей<br />";}
elseif ($ank['ank_d_r']<=19 && $ank['ank_m_r']==2){echo "  Зодиак:</span> Водолей<br />";}
elseif ($ank['ank_d_r']>=18 && $ank['ank_m_r']==2){echo "  Зодиак:</span> Рыбы<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==3){echo "  Зодиак:</span> Рыбы<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==3){echo "  Зодиак:</span> Овен<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==4){echo "  Зодиак:</span> Овен<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==4){echo "  Зодиак:</span> Телец<br />";}
elseif ($ank['ank_d_r']<=21 && $ank['ank_m_r']==5){echo "  Зодиак:</span> Телец<br />";}
elseif ($ank['ank_d_r']>=20 && $ank['ank_m_r']==5){echo "  Зодиак:</span> Близнецы<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==6){echo "  Зодиак:</span> Близнецы<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==6){echo "  Зодиак:</span> Рак<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==7){echo "  Зодиак:</span> Рак<br />";}
elseif ($ank['ank_d_r']>=23 && $ank['ank_m_r']==7){echo "  Зодиак:</span> Лев<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==8){echo "  Зодиак:</span> Лев<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==8){echo "  Зодиак:</span> Дева<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==9){echo "  Зодиак:</span> Дева<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==9){echo "  Зодиак:</span> Весы<br />";}
elseif ($ank['ank_d_r']<=23 && $ank['ank_m_r']==10){echo "  Зодиак:</span> Весы<br />";}
elseif ($ank['ank_d_r']>=22 && $ank['ank_m_r']==10){echo "  Зодиак:</span> Скорпион<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==11){echo "  Зодиак:</span> Скорпион<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==11){echo "  Зодиак:</span> Стрелец<br />";}
elseif ($ank['ank_d_r']<=22 && $ank['ank_m_r']==12){echo "  Зодиак:</span> Стрелец<br />";}
elseif ($ank['ank_d_r']>=21 && $ank['ank_m_r']==12){echo "  Зодиак:</span> Козерог<br />";}
elseif ($ank['ank_d_r']<=20 && $ank['ank_m_r']==1){echo "  Зодиак:</span> Козерог<br />";}






echo'<img src="rating.php?rat='.(int)$ank['rating'].'" alt=""/>';

echo "<span class=\"ank_n\"></span> <span class=\"ank_d\"></span>".($ank['id']==$user['id']?" <a href='/who_rating.php'>[?]</a>":null)."<br />\n";








echo "</div>\n";
echo "<div class='rowdown'>";

echo "<b><div class='blueline'><a href=''>Обо мне</a></b><br></div>\n";echo "\n";

if ($ank['ank_xar']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Характер:</span> <span class=\"ank_d\">$ank[ank_xar]</b></span><br />\n";
if ($ank['zanit']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Занятость:</span> <span class=\"ank_d\">$ank[zanit]</b></span><br />\n";


if ($ank['ank_uvli']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Увлечения:</span> <span class=\"ank_d\">$ank[ank_uvli]</b></span><br />\n";
if ($ank['ank_oren']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Ориентация:</span></b> <span class=\"ank_d\">$ank[ank_oren]</b></span><br />\n";
if ($ank['polojen']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Положение:</span></b> <span class=\"ank_d\">$ank[polojen]</b></span><br />\n";

if ($ank['ank_rost']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Рост:</span> </b><span class=\"ank_d\">$ank[ank_rost]</b></span><br />\n";
if ($ank['ank_ves']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Вес:</span></b> <span class=\"ank_d\">$ank[ank_ves]</b></span><br />\n";


if ($ank['ank_o_sebe']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>О себе:</span> <span class=\"ank_d\">$ank[ank_o_sebe]</span><br />\n";


echo "</div>\n";
echo "<div class='rowup'>";

echo "<b><div class='blueline'><a href=''>Познакомлюсь</a></b><br>\n";echo "\n";

if ($ank['ank_poz']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>C:</span> <span class=\"ank_d\">$ank[ank_poz]</b></span><br />\n";



if ($ank['ank_celznak']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>Цель:</span> <span class=\"ank_d\">$ank[ank_celznak]</b></span><br />\n";

if ($ank['ank_opar']!=NULL)echo "<span class=\"ank_n\"><span style='color: #006633'>О патрнере:</span> <span class=\"ank_d\">$ank[ank_opar]</b></span><br /></div>\n";







echo "</div>\n";
echo "<div class='rowdown'>";

echo "<b><div class='blueline'><a href=''>Мои контакты</a></b><br></div>\n";echo "\n";
if ($ank['ank_icq']!=NULL && $ank['ank_icq']!=0)
echo "<img src=\"http://web.icq.com/whitepages/online?icq=$ank[ank_icq]&img=27\" alt=\"icq\" height=\"16\" width=\"16\" /> <span class=\"ank_d\">$ank[ank_icq]</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;

if (ereg("(@mail\.ru$)|(@bk\.ru$)|(@inbox\.ru$)|(@list\.ru$)", $ank['ank_mail']))
echo "<img src=\"http://status.mail.ru/?$ank[ank_mail]\" width=\"13\" height=\"13\" alt=\"\" /> <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> <a href=\"mailto:$ank[ank_mail]\" title=\"Написать письмо\" class=\"ank_d\">$ank[ank_mail]</a>$hide_mail<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";








echo "</div>\n";
echo "<div class='rowup'>";

if (isset($user)  && $user['id']!=$ank['id'] && $user['balls']>=50 && mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$user[id]'"),0)>=0)
{
echo "<b>Ваше отношение:</b><br />\n";
// мое отношение к пользователю
$my_r=intval(@mysql_result(mysql_query("SELECT `rating` FROM `user_voice2` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]'"),0));
echo "<form method='post' action='?id=$ank[id]&$passgen'>\n";
echo "<select name='rating'>\n";
echo "<option value='2' ".($my_r==2?'selected="selected"':null).">Замечательное</option>\n";
echo "<option value='1' ".($my_r==1?'selected="selected"':null).">Положительное</option>\n";
echo "<option value='0' ".($my_r==0?'selected="selected"':null).">Нейтральное</option>\n";
echo "<option value='-1' ".($my_r==-1?'selected="selected"':null).">Не очень...</option>\n";
echo "<option value='-2' ".($my_r==-2?'selected="selected"':null).">Негативное</option>\n";
echo "</select>\n";
echo "<input type='submit' value='GO' />\n";
echo "</form>\n";
//echo "<br />\n";
}





if ($user['level']>$ank['level']){

if ($ank['ip']!=NULL){
if (user_access('user_show_ip') && $ank['ip']!=0){
echo "<span class=\"ank_n\">IP:</span> <span class=\"ank_d\">".long2ip($ank['ip'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip]'>Бан</a>]";
echo "<br />\n";
}
}

if ($ank['ip_cl']!=NULL){
if (user_access('user_show_ip') && $ank['ip_cl']!=0){
echo "<span class=\"ank_n\">IP (CLIENT):</span> <span class=\"ank_d\">".long2ip($ank['ip_cl'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_cl]'>Бан</a>]";
echo "<br />\n";
}
}

if ($ank['ip_xff']!=NULL){
if (user_access('user_show_ip') && $ank['ip_xff']!=0){
echo "<span class=\"ank_n\">IP (XFF):</span> <span class=\"ank_d\">".long2ip($ank['ip_xff'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_xff]'>Бан</a>]";
echo "<br />\n";
}
}




if (user_access('user_show_ua') && $ank['ua']!=NULL)
echo "<span class=\"ank_n\">UA:</span> <span class=\"ank_d\">$ank[ua]</span><br />\n";
if (user_access('user_show_ip') && opsos($ank['ip']))
echo "<span class=\"ank_n\">Пров:</span> <span class=\"ank_d\">".opsos($ank['ip'])."</span><br />\n";
if (user_access('user_show_ip') && opsos($ank['ip_cl']))
echo "<span class=\"ank_n\">Пров (CL):</span> <span class=\"ank_d\">".opsos($ank['ip_cl'])."</span><br />\n";
if (user_access('user_show_ip') && opsos($ank['ip_xff']))
echo "<span class=\"ank_n\">Пров (XFF):</span> <span class=\"ank_d\">".opsos($ank['ip_xff'])."</span><br />\n";


}




if ($ank['show_url']==1)
{
if (otkuda($ank['url']))echo "<span class=\"ank_n\">URL:</span> <span class=\"ank_d\"><a href='$ank[url]'>".otkuda($ank['url'])."</a></span><br />\n";
}
if (user_access('user_collisions') && $user['level']>$ank['level'])
{
$mass[0]=$ank['id'];
$collisions=user_collision($mass);


if (count($collisions)>1)
{
echo "<span class=\"ank_n\">Возможные ники:</span><br />\n";
echo "<span class=\"ank_d\">\n";

for ($i=1;$i<count($collisions);$i++)
{
$ank_coll=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$collisions[$i]' LIMIT 1"));
echo "\"<a href='/info.php?id=$ank_coll[id]'>$ank_coll[nick]</a>\"<br />\n";
}

echo "</span>\n";
}
}
if (user_access('adm_ref') && ($ank['level']<$user['level'] || $user['id']==$ank['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user_ref` WHERE `id_user` = '$ank[id]'"), 0))
{
$q=mysql_query("SELECT * FROM `user_ref` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $set[p_str]");
echo "Посещаемые сайты:<br />\n";
while ($url=mysql_fetch_assoc($q)) {
$site=htmlentities($url['url'], ENT_QUOTES, 'UTF-8');
echo "<a".($set['web']?" target='_blank'":null)." href='/go.php?go=".base64_encode("http://$site")."'>$site</a> (".vremja($url['time']).")<br />\n";
}
echo "<br />\n";
}


echo "</div><div class='blueline'>\n";

if (isset($user) && $user['id']!=$ank['id'])echo "<img src='/i/mail.gif' alt='' class='icon'/><a href=\"/mail.php?id=$ank[id]\">Написать в приват</a><br />\n";
if (isset($user) && $user['id']==$ank['id'])echo "<a href=\"/anketa.php\">Изменить анкету</a><br />\n";


if ($user['level']>$ank['level']){




echo "<div class='blueline'>";
if (user_access('user_prof_edit'))
echo "<a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />\n";



if ($user['id']!=$ank['id']){



if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

echo "<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]&all'>Все ники</a>)";
echo "<br />\n";

}
}
}




if (user_access('adm_log_read') && $ank['level']!=0 && ($ank['id']==$user['id'] || $ank['level']<$user['level']))
echo "<a href='/adm_panel/adm_log.php?id=$ank[id]'>Отчет по администрированию</a><br />\n";



echo "</div>\n";

echo "</div>\n";

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


