<? 
$location = true;
require_once($_SERVER['DOCUMENT_ROOT']."/core/func.php"); 
require_once($_SERVER['DOCUMENT_ROOT']."/core/us_level.php"); 
//
//
//
//
$r = mt_rand(1000,9999); 
//
//
$id = number($_GET['id']); 
$users= fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array($id)); 
if(!$users){ 
header('location:/profile.php?id='.$uid.'&'.$r); 
exit(); 
} 
// 
// 
$title = $users['login']; 
head($title,$uid); 
//
//
require_once($_SERVER['DOCUMENT_ROOT']."/core/level.php");
//
//
$count_bag = $BaseConnect->query("SELECT (id) FROM `inv` WHERE `yes` = '0' AND `id_user` = '".$uid."'")->rowCount();  
$count_item = $BaseConnect->query("SELECT (id) FROM `inv` WHERE `yes` = '1' AND `id_user` = '".$id."'")->rowCount();  
//
//
?>


<div class = 'tophead cntr'> 
<div class = 'hrs'></div>
        <table class="dummy"> 
        <td class = 'right blck'> 
        <div class = 'items-list'> 

<?
        for($i = 1;$i < 5;$i++){ 
                $it = fch("SELECT * FROM `inv` WHERE `id_user` = ? AND `type` = ? AND `yes` = ? ", array($users['id'],$i,"1"));


if($it == false){ 
//
?>
            <div class = 'items-icons'> </div>
<?
//
}else{ 
?>

 <img class="tophead" src="/images/items/<?=$it['set'];?>/<?=$it['type'];?>.png" width="45" height="45">

<?
} 
?>
<br>
<?
} 
?>
        </div> 
        </td> 

        <td class = 'cntr'> 

<?
if($users['id'] == $uid)echo '<a href="avatar.php">';
?>
<img class="img3" src="/images/avatar/<?=$users['sex'];?>/<?=$users['avatar'];?>.png" width=70%" height="70%"  style="border-radius:8px" alt="*"></a>

        </td>


        <td class = 'left blck'> 
        <div class = 'items-list'> 

<?
        for($i = 5;$i < 9;$i++){ 
            $it = fch("SELECT * FROM `inv` WHERE `id_user` = ? AND `type` = ? AND `yes` = ? ", array($users['id'],$i,"1"));
//
//
if($it == false){ 
//
?>
            <div class = 'items-icons'> </div>
<?
//
}else{ 
?>

 <img class="tophead" src="/images/items/<?=$it['set'];?>/<?=$it['type'];?>.png" width="45" height="45">

<?
} 
?>
<br>
<?
        } 
?>
        </div> 
        </td> 
</table>
<?
if($users['premium_time'] >time()){
?>
<div class = 'premium'><span class="color">Премиум Аккаунт</span></div>
<?
}
?>
<?

//
//
if($users['skills_invise'] == 0){
//
//
//выводим активные умения 
// 
// 
for($i = 1;$i < 5;$i++){   
// 
// 
$fight = fch("SELECT * FROM `skills_fight` WHERE `id_user` = ? AND `type` = ? LIMIT 4", array($id,$i)); 
//
//
$inf = fch("SELECT * FROM `skills` WHERE `id_user` = ? AND `id` = ? LIMIT 4", array($id,$fight['id_skills'])); 
// 
// 
if($fight['id_skills'] == 0){ 
?> 
<div class = "items-icons"></div> 
<? 
}else{ 
?> 
<img class="imgSkill" 
src="/images/skills/<?=$inf['type'];?>.png" width="44" height="44">  
<? 
} 
// 
// 
} 
// 
//
}
//
// 
?>
</div>

<div class="tophead">

 <span class="lime">
Уровень: <?=$users['level'];?></span><br>
<?
if($uid == $id){
?>

<span class="orange"> Опыт: <?=$users['exp'];?> / <?=$level[$users['level']];?> </span><br>
<?
}
?>


<?
if($uid == $id){
?>
<img src="/images/stat.png" width="15px" height="15px" alt=""> <a onclick="{ showSmilies(); return false; }" href="?"><small><span class="color">Список ресурсов</span></small></a>
<?
require_once($_SERVER['DOCUMENT_ROOT']."/templates/statistic.php"); 
?>
<?
}
?>
</div>
<br>
<div class="tophead2">
<div class="title cntr"><span class="color">Навыки</span></div>
<table style='width:100%;'>
<tr>
<td style='width: 33%;' class='cntr'>
<a class="tophead" ><img src="/images/t1.png"alt="" width="50" height="50" ><br><font size=""> Убийца<br> <?=$users['kill'];?> ур </font></a>
</td>

<td style='width: 33%;' class='cntr'>
<a class="tophead"><img src="/images/t2.png"  alt=""width="50" height="50" ><br><font size=""> Целитель<br> <?=$users['medik'];?> ур </font></a>
</td>



<td style='width: 33%;' class='cntr'>
<a class="tophead" ><img src="/images/t3.png" alt=""width="50" height="50" ><br><font size="">  Чернокнижник<br> <?=$users['mag'];?> ур </font></a>
</td>


</tr>
</table>
</div>



<br>

<div class="tophead2">
<div class="title cntr"><span class="color">Характеристики</span></div>
<table style='width:100%;'>
<tr>

<td style='width: 33%;' class='cntr'>
<a class="tophead"><img src="/images/power.png"  width="17px" height="17px" alt=""><font size="">  <?=$users['power'];?> </font></a>
</td>

<td style='width: 33%;' class='cntr'>
<a class="tophead" ><img src="/images/block.png"  width="17px" height="17px" alt=""><font size=""> <?=$users['block'];?></font></a>
</td>


<td style='width: 33%;' class='cntr'>
<a class="tophead" ><img src="/images/health.png" width="17px" height="17px" alt=""><font size="">   <?=$users['health'];?></font></a>
</td>


</tr>
</table>
<img src="/images/stat.png" width="15px" height="15px" alt=""> <a onclick="{ showSmilies2(); return false; }" href="?"><small><span class="color">Список бонусов</span></small></a>
<?
require_once($_SERVER['DOCUMENT_ROOT']."/templates/statistic2.php"); 
?>
<?
//}
?>
</div>


</div>




<?
if($uid == $id){
?>
<div class="tophead2"><div class="main_menu_section">
<a class="main_menu_button" href="/item.php?id=<?=$id;?>">
<div class="main_menu_button_image active">
<img src="/images/snar.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Снаряжение (<?=$count_item;?>/8) </div></a>

<a class="main_menu_button" href="/skill.php">
<div class="main_menu_button_image">
<img src="/images/ability.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Умения </div></a>

<a class="main_menu_button" href="/bag.php">
<div class="main_menu_button_image">
<img src="/images/bag.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Рюкзак  (<?=$count_bag;?>/30)</div></a>
</div>

<div class="main_menu_section">
<a class="main_menu_button" href="/contacts/">
<div class="main_menu_button_image active">
<img src="/images/mail.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Моя почта</div></a>

<a class="main_menu_button" href="/ref.php">
<div class="main_menu_button_image">
<img src="/style/1.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Пригласить друга</div></a>

<a class="main_menu_button" href="/paywk/">
<div class="main_menu_button_image">
<img src="/images/ruby.png" width="20px" height="20px" alt=""></div>
<div class="main_menu_button_content">Купить рубины</div></a></div>
</div>
<?
}
else{
?><div class="tophead2">
<div class="main_menu_section">

<a class="main_menu_button" href="/mail/<?=$id;?>/user">
<div class="main_menu_button_image">
<img src="/images/mail.png" width="16px" height="16px" alt=""></div>
<div class="main_menu_button_content">Написать сообщение</div></a></div>
</div></div>

<?
}
if($user['adm'] != 0){
?>
<div class="tophead2">
<a href="/ban_user.php?id=<?=$id;?>"><span class="orange"><u>Забанить</u></span></a><br>
<a href="/ip/<?=$id;?>/user/"><span class="orange"><u>Список мультов</u></span></a><br>
<a href="/update.php"><span class="orange"><u>Панель управления</u></span></a>
</div>
</div>
<?
}
//
//
foot($uid);
?>