<? 
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;}

$id = _string(_num($_GET['id']));
  if($id) {
    $i = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$id.'"');
    $i = mysql_fetch_array($i);
    
    if(!$i) {
      header('location: /user/');
      exit;}

    }else{ 
      $i = $user;
    }


if(!$id){
$title = 'Трофеи';
}else{
$title = 'Трофеи '.$i['login'].'';	
}
include './system/h.php'; 
echo'<div class="title">'.$title.'</div>';


$c = mysql_query('SELECT * FROM `trophies_user` WHERE `user_id` = "'.$i['id'].'" ORDER BY `id` DESC');
  
while($row = mysql_fetch_array($c)){
echo'<div class="empty_block">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 5px;">
<tbody><tr><td width="25%">
<center><img src="/images/ico/medals/trophy'.$row['trophies_id'].'.png"></center>
</td>
<td width="75%">
<font color="#fff"> '.$row['name'].' </font></br>
+'.$row['param'].' к параметрам </br>
+'.$row['exp'].'% <img src="/images/ico/png/exp.png" width="18" alt="*"> опыту</br>
+'.$row['silver'].'% <img src="/images/ico/png/silver.png" width="18" alt="*"> серебру
</td>
</tr></tbody>
</table>
</div><div class="line"></div>';
}

echo'<div class="empty_block item_center">
Трофеи - одни из самых ценных артефактов в игре
</div><div class="line"></div>';
echo'<div class="block_link"><a href="/user/'.$i['id'].'/"><img src="/images/ico/png/back.png" alt="*"/> Назад в профиль </a></div>
<div class="line"></div>';
include './system/f.php';
?>