<?php
include 'system/bd.php';
include 'system/cook.php';
include ("system/gzip.php");
include ("system/head1.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'system/head.php';
echo'
<div class="title">'.$user[login].'';
$d = time()-10000;
if($user[online]<$d){echo"<font color=red> Off</font>";}
else{
echo"<font color=lime> On</font>";

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


echo'<div class="line"></div><div class="block_link">';


if($user[sex]=="man"){
echo"<img src='img/icon/man.png'/> Мужчина";
}
if($user[sex]=="woman"){
echo"<img src='img/icon/woman.png'/> Женщина ";}

echo"<img src='img/user/icons/".$user[storona]."_".$user[rasa].".png'>";

if($user[storona]=="dark")
{
echo"Красный";}
if($user[storona]=="light")
{
echo"Синий";
}
if($user[rasa]=="war")
{
echo" <b>Воин</b> ";
}
if($user[rasa]=="mage")
{
echo"Маг";}
if($user[rasa]=="monk")
{
echo"Монах";
}
echo ' , '.$user[lvl].' ур.</div>';

}
echo"</div>";


if(!empty($user[clan]))
{
$req = mysql_query("SELECT * FROM `clans` WHERE `id` = '$user[clan]' LIMIT 1");
$clan = mysql_fetch_array($req);
echo'<div class="line"></div><div class="block_link">';
echo"<img src='/img/icon/def.png'> Клан: <a href='clan/clans.php?id=$clan[id]\'>$clan[name]</a>";
echo'</div>';
}
if(!empty($user[clan_prava]))
{
if($user[clan_prava] == leader)
{
echo " <font color=#32CD32>Лидер</font>";
}
if($user[clan_prava] == deputy)
{
echo " <font color=#32CD32>Заместитель</font>";
}
if($user[clan_prava] == squaddie)
{
echo " <font color=#32CD32>Рядовой</font>";
}
if($user[clan_prava] == rookie)
{
echo " <font color=#32CD32>Новобранец</font>";
}
}



echo'<div class="item_center bottom" style="padding-bottom: 3px;">';
echo'<img src="/img/user/avatar/'.$user[sex].'_'.$user[rasa].'_'.$user[storona].'.png"> ';



$hpfull = $user[hpfull] + $clan[hp];
$attack = $user[attack] + $clan[attack];
$def = $user[def] + $clan[def];
$sum=$attack+$def+$hpfull;

echo'<div class="block">
<img src="/img/icon/exp.png"> Опыт <span class="gray"> '.$user['exp'].'/'.$exp.' - ('.$exp_progress.'%)</span><br>
<img src="/img/icon/hp.png"> Здоровье <span class="gray"> '.$user[hp].'/'.$hpfull.' </span><br>
<img src="/img/icon/mp.png"> Энергия<span class="gray"> '.$user[mp].'/'.$user[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"> '.$user[gold].' </span><br>
<img src="/img/icon/silver.png"> Серебро <span class="gray"> '.$user[silver].' </span></div>';




echo'<div class="line"></div><div class="block_link">';
echo"<a href='equipment.php'><img src='img/images/arrow.png'> Снаряжение [".mysql_result(mysql_query("SELECT COUNT(*) FROM `item` WHERE '$user[id]' = `user` and `wearing` = 'yes' "),0)."/5]</a></div>";

echo'<div class="line"></div><div class="block_link">';
echo"<a href='inventar.php'><img src='img/images/arrow.png'> Инвентарь [".mysql_result(mysql_query("SELECT COUNT(*) FROM `item` WHERE '$user[id]' = `user` and `wearing` = 'no' "),0)."/20]</a></div>";


echo'<div class="line"></div><div class="block_link">';
echo"<a href='achievements.php'> <img src='img/images/arrow.png'> Достижения</a></div>";

echo'<div class="line"></div><div class="block_link">';
echo"<a href='spells.php'><img src='img/images/arrow.png'> Умения</a></div>";

echo'<div class="line"></div><div class="block_link">';
echo"<a href='tren.php'><img src='img/images/arrow.png'> Тренировка</a></div>";

echo'<div class="line"></div><div class="block_link">';
echo"<a href='mails.php'><img src='img/icon/mail.png'> Почта</a></div>";
}
else
{
header ("Location: index.php")
 exit;
}
include 'system/foot.php';
?>
