<?php
include 'system/bd.php';
include 'system/cook.php';
include ("system/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1 && isset($_GET['id'])){
include 'system/head.php';

if (intval($_GET['id'])==$user['id']){
	header("Location: /user.php");
	exit;
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id`='".intval($_GET['id'])."'"),0)){
	$us=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id`='".intval($_GET['id'])."'"));
}else{
echo 'не такого юзера';

echo '<a href="setting.php"> <img src="/img/images/arrow.png"> Вернуться</a></div><hr>';
include 'system/foot.php';
	exit;
}




$req = mysql_query("SELECT * FROM `block`  WHERE `usr`='$us[id]' and `ban_time`>'$time'");

$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
$req = mysql_query("SELECT * FROM `user` WHERE `id` = '$mag[nick]'");
$pic = mysql_fetch_array($req);

echo'<div class="block"><font color="red">';
echo"<img src='/img/images/del.png'>  Персонаж заблокирован!<br>";
echo"<img src='/img/images/del.png'>  Модератором: $pic[login]<br>";
echo"<img src='/img/images/del.png'> Причина: $mag[text]";

echo'</font></div>';
}
}



echo'
<div class="block"><img src="/img/icon/attack.png"> '.$us[login].' ';
$d = time()-7000;
if($us[online]<$d){
echo" - <font color=red>off</font>";}
else{
echo" - <font color=lime>on</font>";}
echo' </div>';







if($us[prava] == '3' ){
echo "<div class='block'><font color='orange'> Администратор [a]</font></div>";}
if($us[prava] == '2' ){
echo "<div class='block'><font color='lime'> Модератор [m]</font></div>";}
if($us[prava] == '1' ){
echo "<div class='block'><font color='yellow'> Консультант [s]</font></div>";}




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


  if($us[sex]=="man"){
echo"<img src='img/icon/man.png'/> Мужчина ";
}
  if($us[sex]=="woman"){
echo"<img src='img/icon/woman.png'/> Женщина ";}
$d = time()-7000;
if($us[online] <$d) { 
echo"<img src='img/user/icons/".$us[storona]."_".$us[rasa]."_off.png'>"; 
}else{
echo"<img src='img/user/icons/".$us[storona]."_".$us[rasa].".png'>";
}
  if($us[storona]=="dark"){
echo" Красный";}
  if($us[storona]=="light"){
echo" Синий";}

  if($us[rasa]=="war"){
echo" Воин ";}
  if($us[rasa]=="mage"){
echo" Маг ";}
  if($us[rasa]=="monk"){
echo" Монах ";}

 echo', '.$us[lvl].' ур. ';




           echo' </div></div>';
		   
		   
		   

if(!empty($us[clan])){
$req = mysql_query("SELECT * FROM `clans` WHERE `id` = '$us[clan]' LIMIT 1");

$clan = mysql_fetch_array($req);

echo"<div class='block'>
<img src='/img/icon/def.png'> Клан: <a href=\"clan/clans.php?id=$clan[id]\">$clan[name]</a>,";
}


if(!empty($us[clan_prava])){
if($us[clan_prava] == leader){
echo " <font color=#32CD32>Лидер</font>";
}
if($us[clan_prava] == deputy){
echo " <font color=#32CD32>Заместитель</font>";
}
if($us[clan_prava] == squaddie){
echo " <font color=#32CD32>Рядовой</font>";
}
if($us[clan_prava] == rookie){
echo " <font color=#32CD32>Новобранец</font>";
}


echo"</div>";

}
echo'<div class="block">';
echo'<div class="item_center bottom" style="padding-bottom: 3px;">';
echo' <img src="/img/user/avatar/'.$us[sex].'_'.$us[rasa].'_'.$us[storona].'.png"></div> ';
echo'</div>';
$hpfull = $us[hpfull] + $clan[hp];
$attack = $us[attack] + $clan[attack];
$def = $us[def] + $clan[def];
$sum=$attack+$def+$hpfull;
echo' <div class="block">
<img src="/img/icon/exp.png"> Опыт: <span class="gray"> '.$us[exp].'</span><br>
<img src="/img/icon/hp.png"> Здоровье: <span class="gray"> '.$us[hp].'/'.$hpfull.' </span><br>
<img src="/img/icon/mp.png"> Энергия: <span class="gray"> '.$us[mp].'/'.$us[mpfull].'</span><br>
<img src="/img/icon/attack.png"> Сила: <span class="gray">'.$attack.'</span><br>
<img src="/img/icon/def.png"> Защита: <span class="gray">'.$def.'</span><br>
<img src="/img/icon/sum.png"> Сумма параметров: <span class="gray">'.$sum.'</span><br>
<img src="/img/icon/gold.png"> Золото: <span class="gray">'.$us[gold].'</span><br>
<img src="/img/icon/silver.png"> Серебро: <span class="gray">'.$us[silver].'</span></div>';
echo'<div class="line"></div><div class="block_link">';
echo"<a href='equipment_1.php?id=".$us[id]."'><img src='/img/icon/def.png'> Снаряжение</a></div>";
echo'<div class="line"></div><div class="block_link">';
echo" <a href='mails.php?act=mesg&user=$us[id]'>  <img src='/img/icon/mail.png'> Написать сообщение</a></div>";
}
else
{
header ("Location: index.php"); exit;
}
include 'system/foot.php';
?>
