<?
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();
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'>&laquo;<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 &&
!preg_match('#info\.php#',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&amp;',preg_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();

echo "<div class='location'>";
echo'Страна: ';
if($ank['strana_icon']===0 && $ank['srana_text']==NULL){ 
echo'Не указана =(';
}else{
echo'<img src="/strana/icon/'.$ank['strana_icon'].'.gif" /> ';
echo''.$ank['strana_text'].'';
}
if (isset($user) && $user['id']==$ank['id']){echo' [<a href = "/strana/">Изм</a>]<br/>';}else{echo'<br/>';}
echo "</div>";
echo "<div class='location'>";
echo "<span class=\"ank_n\">Авторитет</span>:\n";
if($ank['rating']>=0 && $ank['rating']<=1)echo " <img src='/rating/img/1.gif'></img>"; 
if($ank['rating']>=2 && $ank['rating']<=3)echo " <img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=4 && $ank['rating']<=5)echo " <img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=6 && $ank['rating']<=7)echo " <img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=8 && $ank['rating']<=9)echo " <img src='/rating/img/2.gif'></img>";

if($ank['rating']>=10 && $ank['rating']<=11)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=12 && $ank['rating']<=13)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=14 && $ank['rating']<=15)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=16 && $ank['rating']<=17)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=18 && $ank['rating']<=19)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";

if($ank['rating']>=20 && $ank['rating']<=21)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=22 && $ank['rating']<=23)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=24 && $ank['rating']<=25)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=26 && $ank['rating']<=27)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=28&& $ank['rating']<=29)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";

if($ank['rating']>=30 && $ank['rating']<=31)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=32&& $ank['rating']<=33)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=34 && $ank['rating']<=35)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=36 && $ank['rating']<=37)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=38 && $ank['rating']<=39)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";

if($ank['rating']>=40 && $ank['rating']<=41)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=42 && $ank['rating']<=43)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=44 && $ank['rating']<=45)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=46 && $ank['rating']<=47)echo " <img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=48 && $ank['rating']<=49)echo " <img src='/rating/img/3.gif'></img>";

if($ank['rating']>=50 && $ank['rating']<=51)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=52 && $ank['rating']<=53)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=54 && $ank['rating']<=55)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=56 && $ank['rating']<=57)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=58 && $ank['rating']<=59)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=60 && $ank['rating']<=61)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=62 && $ank['rating']<=63)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=64 && $ank['rating']<=65)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=66 && $ank['rating']<=67)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=68 && $ank['rating']<=69)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=70 && $ank['rating']<=71)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=72 && $ank['rating']<=73)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=74 && $ank['rating']<=75)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=76 && $ank['rating']<=77)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=78 && $ank['rating']<=79)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=80 && $ank['rating']<=81)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=82 && $ank['rating']<=83)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=84 && $ank['rating']<=85)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=86 && $ank['rating']<=87)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=88 && $ank['rating']<=89)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=90 && $ank['rating']<=91)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=92 && $ank['rating']<=93)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=94 && $ank['rating']<=95)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=96 && $ank['rating']<=97)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=98 && $ank['rating']<=99)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img>";

if($ank['rating']>=100 && $ank['rating']<=101)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=102 && $ank['rating']<=103)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=104 && $ank['rating']<=105)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=106 && $ank['rating']<=107)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=108 && $ank['rating']<=109)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=110 && $ank['rating']<=111)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=112 && $ank['rating']<=113)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=114 && $ank['rating']<=115)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=116 && $ank['rating']<=117)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=118&& $ank['rating']<=119)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=120 && $ank['rating']<=121)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=122 && $ank['rating']<=123)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=124 && $ank['rating']<=125)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=126 && $ank['rating']<=127)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=128 && $ank['rating']<=129)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=130 && $ank['rating']<=131)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=132 && $ank['rating']<=133)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=134 && $ank['rating']<=135)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=136 && $ank['rating']<=137)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=138 && $ank['rating']<=139)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=140 && $ank['rating']<=141)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=142 && $ank['rating']<=143)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=144 && $ank['rating']<=145)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=146 && $ank['rating']<=147)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=148 && $ank['rating']<=149)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img>";

if($ank['rating']>=150 && $ank['rating']<=151)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=152 && $ank['rating']<=153)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=154 && $ank['rating']<=155)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=156 && $ank['rating']<=157)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=158 && $ank['rating']<=159)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=160 && $ank['rating']<=161)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=162 && $ank['rating']<=163)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=164 && $ank['rating']<=165)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=166 && $ank['rating']<=167)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=168 && $ank['rating']<=169)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=170 && $ank['rating']<=171)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=172&& $ank['rating']<=173)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=174 && $ank['rating']<=175)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=176 && $ank['rating']<=177)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=178 && $ank['rating']<=179)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=180 && $ank['rating']<=181)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=182 && $ank['rating']<=183)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=184 && $ank['rating']<=185)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=186 && $ank['rating']<=187)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=188 && $ank['rating']<=189)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=190 && $ank['rating']<=191)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=192 && $ank['rating']<=193)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=194 && $ank['rating']<=195)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=196 && $ank['rating']<=197)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=198 && $ank['rating']<=199)echo " <img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img>";

if($ank['rating']>=200 && $ank['rating']<=201)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=202 && $ank['rating']<=203)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=204 && $ank['rating']<=205)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=206 && $ank['rating']<=207)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=208 && $ank['rating']<=209)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=210 && $ank['rating']<=211)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=212 && $ank['rating']<=213)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=214 && $ank['rating']<=215)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=216 && $ank['rating']<=217)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=218 && $ank['rating']<=219)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=220 && $ank['rating']<=221)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=222 && $ank['rating']<=223)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=224 && $ank['rating']<=225)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=226 && $ank['rating']<=227)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=228 && $ank['rating']<=229)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=230 && $ank['rating']<=231)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=232 && $ank['rating']<=233)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=234 && $ank['rating']<=235)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=236 && $ank['rating']<=237)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=238 && $ank['rating']<=239)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=240 && $ank['rating']<=241)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=242 && $ank['rating']<=243)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=244 && $ank['rating']<=245)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=246 && $ank['rating']<=247)echo " <img src='/rating/img/3.gif'><img src='/rating/img/3.gif'></img></img><img src='/rating/img/3.gif'></img><img src='/rating/img/3.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=248 && $ank['rating']<=249)echo " <img src='/rating/img/4.gif'></img>";

if($ank['rating']>=250 && $ank['rating']<=251)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=252&& $ank['rating']<=253)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=254 && $ank['rating']<=255)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=256 && $ank['rating']<=257)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=258 && $ank['rating']<=259)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=260 && $ank['rating']<=261)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=262 && $ank['rating']<=263)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=264 && $ank['rating']<=265)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=266 && $ank['rating']<=267)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=268 && $ank['rating']<=269)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=270 && $ank['rating']<=271)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=272 && $ank['rating']<=273)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=274 && $ank['rating']<=275)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=276 && $ank['rating']<=277)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=278 && $ank['rating']<=279)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=280 && $ank['rating']<=281)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=282 && $ank['rating']<=283)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=284 && $ank['rating']<=285)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=286 && $ank['rating']<=287)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=288 && $ank['rating']<=289)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=290 && $ank['rating']<=291)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=292 && $ank['rating']<=293)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=294&& $ank['rating']<=295)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=296 && $ank['rating']<=297)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=298 && $ank['rating']<=299)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img>";

if($ank['rating']>=300 && $ank['rating']<=301)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=302 && $ank['rating']<=303)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=304 && $ank['rating']<=305)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img1.gif'></img>";
if($ank['rating']>=306 && $ank['rating']<=307)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=308 && $ank['rating']<=309)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=310 && $ank['rating']<=311)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=312 && $ank['rating']<=313)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=314 && $ank['rating']<=315)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=316 && $ank['rating']<=317)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=318 && $ank['rating']<=319)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=320 && $ank['rating']<=321)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=322 && $ank['rating']<=323)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=324 && $ank['rating']<=325)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=326 && $ank['rating']<=327)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=328 && $ank['rating']<=329)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=330 && $ank['rating']<=331)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=332 && $ank['rating']<=333)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=334 && $ank['rating']<=335)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=336 && $ank['rating']<=337)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=338 && $ank['rating']<=339)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img>";
if($ank['rating']>=340 && $ank['rating']<=341)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=342 && $ank['rating']<=343)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/34gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=344 && $ank['rating']<=345)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=346 && $ank['rating']<=347)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/2.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img><img src='/rating/img/1.gif'></img>";
if($ank['rating']>=348 && $ank['rating']<=349)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img>";
if($ank['rating']>=350 && $ank['rating']<=351)echo " <img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img><img src='/rating/img/4.gif'></img>";
if($ank['rating']>=352 && $ank['rating']<=353)echo " <img src='/rating/img/5.gif'></img>";
if($ank['rating']>=354 && $ank['rating']<=355)echo " <img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img>";
if($ank['rating']>=356 && $ank['rating']<=357)echo " <img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img>";
if($ank['rating']>=358 && $ank['rating']<=359)echo " <img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img><img src='/rating/img/5.gif'></img>";
if($ank['rating']>=360 && $ank['rating']<=361)echo " <img src='/rating/img/6.gif'></img>";
if($ank['rating']>=362 && $ank['rating']<=363)echo " <img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img>";
if($ank['rating']>=364 && $ank['rating']<=365)echo " <img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img>";
if($ank['rating']>=366 && $ank['rating']<=367)echo " <img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img><img src='/rating/img/6.gif'></img>";
if($ank['rating']>=368 && $ank['rating']<=369)echo " <img src='/rating/img/7.gif'></img>";
if($ank['rating']>=370 && $ank['rating']<=371)echo " <img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img>";
if($ank['rating']>=372 && $ank['rating']<=373)echo " <img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img>";
if($ank['rating']>=374 && $ank['rating']<=375)echo " <img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img><img src='/rating/img/7.gif'></img>";
echo "<br/>\n";
echo "<span class=\"ank_n\">У Вас : </span>\n";
echo ''.$user['rating'].'% авторитета</a>';
echo "         (<a href='/rating/'>Повысить</a>)<br />\n";
echo "</div>";
 echo "<div class='location'>";

echo "".status($ank['id'])." $ank[nick]";
echo "".medal($ank['id'])."<br />";


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

 echo "</div>";

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

$checkmcrbl=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog` WHERE `uid` = $ank[id]"),0);

if ($checkmcrbl!=0)
{
$mcrbl=mysql_fetch_array(mysql_query("SELECT * FROM `microblog` WHERE `uid` = '$ank[id]' ORDER BY `time` DESC LIMIT 1"));
if(isset($user))
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]' AND `uid`='$user[id]' LIMIT 1"),0)==0)
{
mysql_query("INSERT INTO `microblog_see` (`id_blog`, `uid`, `time_last`) VALUES ('$mcrbl[id]', '$user[id]', '$time')");
}
else
{
$guest=mysql_fetch_array(mysql_query("SELECT * FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]' AND `uid`='$user[id]' LIMIT 1"));
mysql_query("UPDATE `microblog_see` SET `times` = '".($guest['times']+1)."', `time_last`='$time' WHERE `id` = '$guest[id]' LIMIT 1");
}
}


$komall=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_komm` WHERE `id_blog` = '$mcrbl[id]'"),0);

echo "<div class='triangle2'></div><a href='/microblog/all.php?id=$ank[id]'><div class='trianglerect2'>";
echo "<span style='index:red'>".esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($mcrbl['text']))))))))."</span></div></a>";
$komms=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_komm` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superall=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_klass` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superyou=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_klass` WHERE `id_blog` = '$mcrbl[id]' AND `uid` = '$user[id]'"),0);
$see=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_see` WHERE `id_blog` = '$mcrbl[id]'"),0);
$superother=$superall-$superyou;
echo "<img src='/img/bubl.png' alt='' /> <a href='/microblog/microblog.php?id=$mcrbl[id]'>$komms</a> &bull; ";
if ($superyou!=0)
{
echo "<img src='/img/cls.png' alt='' /> Вы <span style='text-decoration:underline'>и ещё <a href='microblog/klasslist.php?id=$mcrbl[id]'>$superother чел.</a></span>";
}
if ($superyou==0)
{
echo "<img src='/img/cls.png' alt='' /> <a href='/microblog/klass.php?id=$mcrbl[id]'>Kласс!</a> <span style='text-decoration:underline'><a href='microblog/klasslist.php?id=$mcrbl[id]'>$superother чел.</a></span>";
}
echo " &bull; <span style='color:red'>".vremja($mcrbl['time'])."</span>";
echo " &bull; <img src='/img/eye.png' alt='' /> <a href='microblog/see.php?id=$mcrbl[id]'>$see</a>";
$allmcrbl=mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog` WHERE `uid` = '$ank[id]'"),0);
if ($allmcrbl>1)
{
echo " &bull; <span style='text-decoration:underline'><a href='microblog/all.php?id=$ank[id]'>Все микроблоги</span> $allmcrbl</a>";
}
echo "</div>";
}
if ($checkmcrbl==0)
{
echo "<div class='triangle2'></div><a href='/microblog/all.php?id=$ank[id]'><div class='trianglerect2'>";
echo " Я люблю ❤friendc.keo.su</span></div></a>";
}
 echo "</div>";
echo "<div class='foot'>";
avatar($ank['id']);
echo "<br />\n";
echo '<img src="rating.php?rat='.(int)$ank['rating'].'" alt=""/><br />';
echo "</div>";
echo "<div class='location'>"; 
if ($ank['ank_mail']!=NULL)echo "Статус: <span style='color:green'>Гражданин</span>";
else
{
echo "Статус: <span style='color:green'>Гость</span>";
if ($ank['id']==$user['id'])
echo " <a href=polz.php>Стать гражданином</a>";
}

 echo "</div>"; 

 echo "<div class='location'>";
include_once "moduls.zags/info.php"; 
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `garem` WHERE `id_user`='".$ank['id']."'"),0)==1){
$garem=mysql_fetch_assoc(mysql_query("SELECT * FROM `garem` WHERE `id_user` = $ank[id] LIMIT 1"));
$us = get_user($garem['id_garem']);
echo'<img src="/style/my_menu/harem.png">В гареме у <a href="info.php?id='.$us['id'].'"><b>'.$us['nick'].'</b></a><br/>';
}
$pol = ($ank['pol']==1) ? '' : 'а';
echo'<img src="/style/my_menu/harem.png">Украден'.$pol.': <b>'.$ank['steal_garem'].'</b> раз.<br/>';

echo "</div>";

echo "<div class='location'>";
if(!isset($_GET['nag'])){
echo "<a href='/info.php?id=$ank[id]&amp;nag'>";


echo "<img src='/style/my_menu/5.gif  ' alt='' class='icon'/>\n";
echo "Награды";

 echo "</div>";
}else{
echo "<a href='/info.php?id=$ank[id]'>";
echo "<div class='location'>";
echo "Награды<br/>";
 echo "</div>";
echo "<div class='location'>";

echo"<table class='post'>";
echo"<td class='p_t'>";
echo "<small>Награды/<a href=\"rank.php?id=$ank[id]\" title=\"Все\">Награды</a></small>\n";
$k_p=mysql_result(mysql_query("SELECT COUNT(*) FROM `rank` WHERE `id_user` = $ank[id] ",$db), 0);
echo " ($k_p)<br />";

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `rank` WHERE `id_user` = '$ank[id]' LIMIT 1"), 0);

if ($k_post==0)
{
echo '<sub> Oбитатель '.$ank['nick'].' не награждался</sub>';
}

$q = mysql_query("SELECT * FROM `rank` WHERE `id_user` = '$ank[id]' ORDER BY time DESC LIMIT 4");
while ($f = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$f[ot_id]' LIMIT 1"));
echo"<img src='/rank/".$f['id_rank'].".gif' width='20' height='20'  alt='' class='icon'/></hr>";
}
echo'  </td>
   </tr>
</table>';
}
echo "</div>";


echo "<div class='location'>";
if(!isset($_GET['stat'])){
echo "<a href='/info.php?id=$ank[id]&amp;stat'>";


echo "<img src='/style/my_menu/info.png ' alt='' class='icon'/>\n";
echo "Статистика";

 echo "</div>";
}else{
echo "<a href='/info.php?id=$ank[id]'>";
echo "<div class='location'>";
echo "Статистика<br/>";
 echo "</div>";
echo "<div class='location'>";
 

$chat_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$ank[id]'"),0);
echo "<span class=\"ank_n\">Сообщений в чате:</span> <span class=\"ank_d\">$chat_post</span><br />\n";

$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"),0);
echo "<span class=\"ank_n\">Тем в форуме:</span> <span class=\"ank_d\">$k_them</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";



if (user_access('user_show_add_info') && $user['level']>$ank['level']){
$zakl3=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$ank[id]'"),0);
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<span class=\"ank_n\">Закладки:</span> <span class=\"ank_d\">$zakl3</span><br />\n";

$guest3=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `id_user` = '$ank[id]'"),0);
echo "<span class=\"ank_n\">Гостевая:</span> <span class=\"ank_d\">$guest3</span><br />\n";


$mail3=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'"),0);
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<span class=\"ank_n\">Приватные сообщения:</span> <span class=\"ank_d\">$mail3</span><br />\n";
}
$komm_loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_komm` WHERE `id_user` = '$ank[id]'"),0);
echo "<span class=\"ank_n\">Комментарии в загрузках:</span> <span class=\"ank_d\">$komm_loads</span><br />\n";

$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$ank[id]'"),0);
echo "<span class=\"ank_n\">Комментарии новостей:</span> <span class=\"ank_d\">$news_komm</span><br />\n";


if (isset($access['show_all_info'])){
$user_voice=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_user` = '$ank[id]' OR `id_kont` = '$ank[id]'"),0);
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<span class=\"ank_n\">Рейтинги:</span> <span class=\"ank_d\">$user_voice</span><br />\n";

$votes_user=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `u_id` = '$ank[id]'"),0);
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<span class=\"ank_n\">Голосования:</span> <span class=\"ank_d\">$votes_user</span><br />\n";

$obmennik3=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$ank[id]'"),0);
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<span class=\"ank_n\">Файлы в обменнике:</span> <span class=\"ank_d\">$obmennik3</span><br />\n";
}

echo "<span class=\"ank_n\">Баллы:</span> <span class=\"ank_d\">$ank[balls]</span><br />\n";

echo "<span class=\"ank_n\">Рейтинг:</span> <span class=\"ank_d\">$ank[rating]</span><br />\n";



$timediff=mysql_result(mysql_query("SELECT `time` FROM `user` WHERE `id` = '$ank[id]' LIMIT 1",$db), 0);

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

$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 = "минута"; 
    } 
} 


$displaystring="". 
$sHoursLeft." ". 
$sHoursText." ". 
$sMinsLeft." ". 
$sMinsText." ";


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

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";
echo "<span class=\"ank_n\">Посл. посещение:</span> <span class=\"ank_d\">".vremja($ank['date_last'])."</span><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";
}







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


if (user_access('user_prof_edit'))
echo "&raquo;<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 "&raquo;<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />\n";





if (user_access('user_delete'))
{

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";

}
}
}

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

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


echo "</div>";
echo "<div class='location'>";
if(!isset($_GET['ank'])){
echo "<a href='/info.php?id=$ank[id]&amp;ank'>";


echo "<img src='/style/my_menu/anketa.gif ' alt='' class='icon'/>\n";
echo "Анкета";
{
echo " [<a href='/anketa.php'>Ред</a>]";
}
echo "</div>";
}else{
echo "<div class='location'>";
echo "<a href='/info.php?id=$ank[id]'>";
echo "Анкета<br/>";
echo "</div>";
echo "<div class='location'>";
$k_zna = mysql_result(mysql_query("SELECT COUNT(*) FROM `user_znachki` WHERE `user_id` = '$ank[id]' LIMIT 1"), 0);

if ($k_zna==0)
{
echo '<br />Нет значков!<br />';
}
else
{echo "<br /><div class='p_m'>\n";
$zna= mysql_query("select * from `user_znachki` Where `user_id` =$ank[id]  LIMIT 4;"); 
while ($znac = mysql_fetch_array($zna)){
echo "<img src=$znac[url] width='50' height='50' alt='' />";

}
echo "<a href=znachki.php?id=$ank[id]>>></a></div>";}
echo "<span class='ank_n'>ID:</span> <span class='ank_d'>$ank[id]</span><br />\n";

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><br />\n":" <span class=\"ank_d\">$narush</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 "<span class=\"ank_n\">Город:</span> <span class=\"ank_d\">$ank[ank_city]</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";
}
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";
}

if ($ank['ank_icq']!=NULL && $ank['ank_icq']!=0)
echo "<img src=\"http://web.icq.com/whitepages/online?icq=$ank[ank_icq]&amp;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 (preg_match("#(@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";
if ($ank['ank_o_sebe']!=NULL)echo "<span class=\"ank_n\">О себе:</span> <span class=\"ank_d\">$ank[ank_o_sebe]</span><br />\n";

}
echo "</div>";




if (isset($user) && $user['id']!=$ank['id'])echo "<div class='location'><img src='/style/icons/mess0.png' alt='' /><a href=\"/mail.php?id=$ank[id]\"><b>Написать в приват</b></a><br />\n";
echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/my_menu/foto.gif' alt='' /><a href='/foto/$user[id]/'><b>Фотоальбомы</b></a><br />\n";

 echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/icons/music.png' alt='' /><a href='/audio/user.album.php?id=$ank[id]'>Аудиоальбомы</font></a><br />";
 echo "</div>";
echo "</div>";
echo "<div class='location'>";
echo"<img src='/style/my_menu/pod16.png' alt='' /><a href='/present/presentlist.php?user=$ank[id]'>Подарки</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `present_give` WHERE `id_give` = '$ank[id]'"),0).")</span><br />\n";
 echo "</div>";
 echo "<div class='location'>";
$d1sql = 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");
 $d2sql = mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$ank[id]' AND `frend` = '$user[id]') OR (`user` = '$user[id]' AND `frend` = '$ank[id]') LIMIT 1");
 if (isset($user) && $user['id']!=$ank['id'] && mysql_result($d1sql, 0)==0 && mysql_result($d2sql, 0)==0)
 	{
	echo '<img src="/style/my_menu/friends.gif"><a href="frend_add.php?id='.$ank['id'].'">Предложить дружбу</a><br/>';
 	}
if($user['id']!=$ank['id']){
 echo '<img src="/style/my_menu/users.png"><a href="frend.php?id='.$ank['id'].'">Друзья '.$ank['nick'].'</a>';
}
else {
 echo '<img src="/style/my_menu/users.png"><a href="frend.php?id='.$ank['id'].'">Мои друзья</a>';
}

if($user['id']==$ank['id']) {
 echo "<a href='/lenta.php'>❤[Лента]</a> ";
$lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `id_kont` = '$user[id]' AND `read` = '0' "),0);
if($lenta>0) { echo "<b>+$lenta</b>"; }
echo "<br/>";
}
echo "</div>";
echo "<div class='location'>";
if (isset($user) && $user['id']!=$ank['id'])
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guest` WHERE `id_user` = '$ank[id]' AND `id_guest` = '$user[id]'"), 0)==0)
{
mysql_query("INSERT INTO `my_guest` (`id_user`, `id_guest`, `time`) values('$ank[id]', '$user[id]', '$time')",$db);
}
mysql_query("UPDATE `my_guest` SET `time` = '$time' WHERE `id_user` = '$ank[id]' AND `id_guest` = '$user[id]'");
}
echo "<img src='/style/my_menu/my_guest.gif' alt='' class='icon'/>\n";
echo '<a href="my_guest.php?id='.$ank['id'].'">Мои гости</a><br/>';

 echo "</div>";
echo "<div class='location'>";
$sum = mysql_result(mysql_query("SELECT COUNT(*) FROM `garem` WHERE `id_garem`='".$ank['id']."'"),0);
echo'<img src="/style/my_menu/garem.gif"><a href="/garem/index.php?id='.$ank['id'].'">Гарем</a> ('.$sum.')<br/>';

echo "</div>";

if ($ank['id']==$user['id']) {
$jn_new=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
$jn_all=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]'"), 0);

echo "<div class='location'><img src='/style/jurnal.gif' /> <a href='/jurnal.php'>Журнал</a>";
echo "<b>(";
if ($jn_new!=0)echo "+$jn_new/";
echo "$jn_all)</b></font><br/>\n";
echo "</div>";
	}

echo "<div class='location'>";
$guest_count=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_gb` WHERE `guest_id` = '$ank[id]'"), 0);
echo "<img src='/style/gb.png' /> <a href='/users_gb.php?id=$ank[id]'>Гостевая </a><b>($guest_count)</b></font><br/>\n";
echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/my_menu/anonim.png' alt='' /><a href='/views/?id=$ank[id]/'>Мнения</a>:</span> <span class=\"ank_d\">";echo mysql_result(mysql_query("SELECT COUNT(*) FROM `views` WHERE `id_kont` = '$ank[id]'"),0);echo "</span><br />\n";
echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/icons/make.png' alt='' /><a href='/pages/dei.php?id=$ank[id]'>Действия</font></a><br/>";
echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/icons/diary.gif' alt='' /><a href='/diary/?id=$ank[id]'>Дневник</font></a></font><br/>\n";
 echo "</div>";
echo "<div class='location'>";

echo "<img src='/style/my_menu/who_rating.png' alt='' /> <a href='who_rating.php?id=$ank[id]'><b>Отзывы</b></a><br />\n";
echo "</div>";
echo "<div class='location'>";
echo "<img src='/style/my_menu/set.png' alt='' /> <a href='/umenu.php'>Мои настройки</a><br />\n";
 echo "</div>\n";
echo "<div class='location'>";
include_once 'wall/wall.php';

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


				
if($user['balls']==!0){
if (isset($user) && $user['id']!=$ank['id'])echo "<img src='/style/my_menu/ico_mone.png'alt=''/><a href=\"/give_ball.php?id=$ank[id]\">Перевести Баллы</a><br />\n";
}
if ($user['level']==10){
echo "<img src='style/icons/5.gif' alt='' class='icon'/><a href=\"medals/rank.php?id=$ank[id]&pod=1\">Наградить юзера</a><br />";}
if($user['pol']!=$ank['pol'] && mysql_result(mysql_query("SELECT COUNT(*) FROM `garem` WHERE `id_garem`='".$user['id']."' AND `id_user`='".$ank['id']."'"),0)==0 && isset($user))echo'<img src="/style/my_menu/harem.png"> <a href="/garem/index.php?act=steal&amp;id='.$ank['id'].'">Украсть к себе в гарем</a><br/>';
if (isset($user) && $user['id'] != $ank['id']) {
echo "<img src='/style/my_menu/duels.png' alt='' /> <a href='/duels/duel.new.php?id={$ank['id']}'>Вызвать на дуэль</a><br />";
}
echo '<img src="/style/my_menu/duels.png">Выигранных дуэлей: ' . mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE  `who`='".$ank['id']."'"), 0) . '<br />';
echo '<img src="/style/my_menu/duels.png">Проигранных дуэлей: ' . mysql_result(mysql_query("SELECT COUNT(*) FROM `duels` WHERE  `who2`='".$ank['id']."'"), 0) . '<br />';
 echo "</div>";

echo "<div class='err'>Расскажите о своем сайте друзьям:</div>";
echo "<div class='err'>";
include_once 'i.html';
echo "</div>";
include_once 'sys/inc/tfoot.php';
?>