<?php
include_once 'inc/database.php'; /* База данных */
include_once 'inc/array.php'; /* Массивы */
$id = fl($_GET['id']);
$a = fch("SELECT * FROM `heroes` WHERE `id` = ? LIMIT 1", array($id));
$u = fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array($a['user_id']));
if($a == 0) header('Location: /404/');
$header = $a['nickname'];
include_once 'inc/header.php';
//////////////////////////////
$lvl = $a['level'] + 1;
if($a['class'] == 'medic') $class = 'medic';
else $class = 'skull';
?>
<div class="case">
<b><? echo '<img src="/images/icon/'.$class.'.png" alt="*" height="10px" /> '.$a['nickname'];?></b> [<?=$array['crown'][$a['family']]?>]<br/>
<small><?=$array['class'][$a['class']]?> <?=$a['level']?> ур.</small>
<hr/>
<div class="center"><img src="/images/barbar.png" class="img-responsive" alt="*" /></div>
<hr/>
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
Сила: <img src="/images/icon/skull.png" alt="*" height="13px" /> <? echo get_power($a['id']); ?><br/>
Разум: <img src="/images/icon/brain.png" alt="*" height="13px" /> <? echo get_brain($a['id']); ?><br/>
Энергия: <img src="/images/icon/energy.png" alt="*" height="13px" /> <? echo get_energy($a['id']); ?>
</div>
<div class="col-md-6">
Защита: <img src="/images/icon/shield.png" alt="*" height="13px" /> <? echo get_block($a['id']); ?><br/>
Ловкость: <img src="/images/icon/agility.png" alt="*" height="13px" /> <? echo get_agility($a['id']); ?><br/>
Здоровье: <img src="/images/icon/heart.png" alt="*" height="13px" /> <? echo get_health($a['id']); ?>
</div>
</div>
</div>
<hr/>
Слава: <img src="/images/icon/star.png" alt="*" height="13px" /> <?=$a['rating']?><br/>
Уровень: <img src="/images/icon/level.png" alt="*" height="13px" /> <?=$a['level']?><br/>
<?if($a['user_id'] == $user['id']):?>
Опыт: <img src="/images/icon/exp.png" alt="*" height="13px" /> <?=$a['exp']?> из <?=$array['level'][$lvl]?> <br/>
<div class="bor">
<div class="bor-title"><span>Ресурсы</span></div>
<img src="/images/icon/gold.png" alt="Зол" height="13px" /> <?=$a['gold']?> / <img src="/images/icon/silver.png" alt="Сил" height="13px" /> <?=$a['silver']?>
</div>
<?endif;?>
</div>
<div class="line"></div>
<a class="link" href="/inv/<?=$a['id']?>">Инвентарь персонажа</a>
<?
if($a['user_id'] == $user['id']){
echo '<a class="link" href="/hero">Сменить персонажа</a>';
}
if($a['id'] == $hero['id']){
echo '<a class="link" href="/settings">Настройки персонажа</a>';
}
//////////////////////////////
include_once 'inc/footer.php';
?>