<?
    
    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;
    }
    
    $title = $i['login'];


include './system/h.php';


$w_1 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_1'].'"');
$w_1 = mysql_fetch_array($w_1);
if(!$w_1) {
  $w_1['item'] = 0;
}
$w_1_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_1['item'].'"');
$w_1_item = mysql_fetch_array($w_1_item);

$w_2 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_2'].'"');
$w_2 = mysql_fetch_array($w_2);
if(!$w_2) {
  $w_2['item'] = 0;
}

$w_2_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_2['item'].'"');
$w_2_item = mysql_fetch_array($w_2_item);

$w_3 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_3'].'"');
$w_3 = mysql_fetch_array($w_3);
if(!$w_3) {
  $w_3['item'] = 0;
}

$w_3_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_3['item'].'"');
$w_3_item = mysql_fetch_array($w_3_item);


$w_4 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_4'].'"');
$w_4 = mysql_fetch_array($w_4);

if(!$w_4) {
  $w_4['item'] = 0;
}

$w_4_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_4['item'].'"');
$w_4_item = mysql_fetch_array($w_4_item);

$w_5 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_5'].'"');
$w_5 = mysql_fetch_array($w_5);
if(!$w_5) {
  $w_5['item'] = 0;
}
$w_5_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_5['item'].'"');
$w_5_item = mysql_fetch_array($w_5_item);

$w_6 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_6'].'"');
$w_6 = mysql_fetch_array($w_6);
if(!$w_6) {
  $w_6['item'] = 0;
}
$w_6_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_6['item'].'"');
$w_6_item = mysql_fetch_array($w_6_item);

$w_7 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_7'].'"');
$w_7 = mysql_fetch_array($w_7);
if(!$w_7) {
  $w_7['item'] = 0;
}
$w_7_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_7['item'].'"');
$w_7_item = mysql_fetch_array($w_7_item);

$w_8 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$i['id'].'" AND `id` = "'.$i['w_8'].'"');
$w_8 = mysql_fetch_array($w_8);
if(!$w_8) {
  $w_8['item'] = 0;
}
$w_8_item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$w_8['item'].'"');
$w_8_item = mysql_fetch_array($w_8_item);


  $i_clan_memb = mysql_query('SELECT * FROM `clan_memb` WHERE `user` = "'.$i['id'].'"');
  $i_clan_memb = mysql_fetch_array($i_clan_memb);
  
    if(!$i_clan_memb) {
    
    if($clan && $clan_memb['rank'] >= $clan['rank_for_invite'] && $clan['r'] == $i['r'] && $_GET['clan_invite'] == true) {
    
    if(mysql_result(mysql_query('SELECT COUNT(`id`) FROM `clan_invite` WHERE `user` = "'.$i['id'].'" AND `clan` = "'.$clan['id'].'"'),0) == 0) {
      mysql_query('INSERT INTO `clan_invite` (`clan`,
                                              `user`) VALUES ("'.$clan['id'].'",
                                                                 "'.$i['id'].'")');
?>

<div class='content' align='center'><img src='/images/icon/ok.png' alt='*'/> <font color='#30c030'>Приглашение отправлено!</font></div><div class='line'></div>

<?

    }
    else
    {
    
    }

  
    }
  
  }
  
?>

<?
?>

<?



?>


<?



?>


 
 


<?
  
 
?>


<?

 
  
      $smith = 0;
      
      $bonus = 0;
  $all_bonus = 0;

  function bonus($_i) {

    switch($_i) {
      case 0:
    $bonus = 0;
       break;
      case 1:
    $bonus = 5;
       break;
      case 2:
   $bonus = 10;
       break;
      case 3:
   $bonus = 15;
        break;
      case 4:
   $bonus = 20;
       break;
      case 5:
   $bonus = 50;
     break;
      case 6:
   $bonus = 65; 
       break;
    }
  
  return $bonus;
  
  }

  if($i['w_1']) {
    if($w_1['smith'] > 0) {
    $smith +=$w_1['smith'];
    }
    $bonus += $w_1['bonus'];
$all_bonus += bonus($w_1_item['quality']);  
  }
  if($i['w_2']) {
    if($w_2['smith'] > 0) {
      $smith +=$w_2['smith'];
    }
    $bonus += $w_2['bonus'];
$all_bonus += bonus($w_2_item['quality']);  
  }

  if($i['w_3']) {

  if($w_3['smith'] > 0) {
  
  $smith +=$w_3['smith'];
  
  }

  $bonus += $w_3['bonus'];
  
    $all_bonus += bonus($w_3_item['quality']);
  
  }

  if($i['w_4']) {

  if($w_4['smith'] > 0) {
  
  $smith +=$w_4['smith'];
  
  }

  $bonus += $w_4['bonus'];
  
    $all_bonus += bonus($w_4_item['quality']);
  
  }

  if($i['w_5']) {

  if($w_5['smith'] > 0) {
  
  $smith +=$w_5['smith'];
  
  }

  $bonus += $w_5['bonus'];
  
    $all_bonus += bonus($w_5_item['quality']);
  
  }

  if($i['w_6']) {

  if($w_6['smith'] > 0) {
  
  $smith +=$w_6['smith'];
  
  }

  $bonus += $w_6['bonus'];
    $all_bonus += bonus($w_6_item['quality']);  
  }
  if($i['w_7']) {
    if($w_7['smith'] > 0) {
    $smith +=$w_7['smith'];
    }
    $bonus += $w_7['bonus'];
$all_bonus += bonus($w_7_item['quality']);  
  }
  if($i['w_8']) {
    if($w_8['smith'] > 0) {
    $smith +=$w_8['smith'];    
    }
    $bonus += $w_8['bonus'];
$all_bonus += bonus($w_8_item['quality']); 
  }
  if($smith > 0) {
?>
<?
  }
?>



<?
  if($i['id'] == $user['id']) {
?>


<?

  }
  else
  {

?>








<?

    }



?>

<?
  ?>
<?


    if($user['id'] == $i['id'] OR !$i['id']) {

?>
<?
    }
?>
</div>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8"/><link rel="icon" href="/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="http://213.239.195.28/xaos/style.css" type="text/css"/>
<div class="title-top"><?=$i['login']?>, <?=$i['level']?> ур.</div>
<div class="separ2"></div><div class="jour2"><div style="text-align:center;padding:3px;"><div style="width:36px;display:inline-block;vertical-align:top"><div style="padding-bottom:5px;"><img src="http://213.239.195.28/xaos/mob/3.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/mob/3.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/style2/unit.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/style2/ram.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div></div><div style="width:130px;display:inline-block;vertical-align:top"><div style="border:1px solid #131313;padding:1px;background:#232323;border-radius:3px;display:inline-block;"><img src="http://213.239.195.28/xaos/style2/profile.jpg" alt="" style="border:1px solid #131313;border-radius:3px;"/></div></div><div style="width:36px;display:inline-block;vertical-align:top"><div style="padding-bottom:5px"><img src="http://213.239.195.28/xaos/mob/3.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/style2/unit.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/style2/unit.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div><div style="padding-bottom:5px;padding-top:5px"><img src="http://213.239.195.28/xaos/style2/ram.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:32px;width:32px"/></div></div></div></div>
<div class="separ"></div><div class="jour2"><div class="jour" style="color:#a5a5a5"> 


<?

$q = mysql_query('SELECT * FROM `users` WHERE `access` = "2" ORDER BY `online` DESC LIMIT '.$start.', '.$max.'');

  while($row = mysql_fetch_array($q)) {
  
?>




<img src="http://xaos.mobi/menu/2.jpg" alt="" style="border:1px solid #131313;border-radius:2px;height:16px;width:16px"/> Роль: <span style="color:khaki"><?
if($i['id'] == 1)
{
echo"Администратор";
}else{
if($i['id'] == 1)
{
echo" ";
}
}
if($i['id'] == 0)
{
echo" ";
}else{
}
?></span><br/>


<?

}

?>


<img src='/xaos/style2/<?=$i['r']?>.png' alt='*'/> Сторона: <span style="color:khaki"><img src="http://213.239.195.28/xaos/style/shield_2_mini.png" alt="" style="height:16px"/> <?=($i['r'] == 0 ? 'Альянс':'Орда')?></span><br/><img src="http://213.239.195.28/xaos/16x16/tower.png" alt=""/> 
<?

  if($i_clan_memb) {

    $i_clan = mysql_query('SELECT * FROM `clans` WHERE `id` = "'.$i_clan_memb['clan'].'"');
    $i_clan = mysql_fetch_array($i_clan);

  switch($i_clan_memb['rank']) {
  
    case 0:
    $rank = 'Новобранец';
     break;
    case 1:
    $rank = 'Послушник';
     break;
    case 2:
    $rank = 'Солдат';
     break;
    case 3:
    $rank = 'Воин';
     break;
    case 4:
    $rank = 'Рыцарь';
     break;
case 5:
$rank = 'Лорд';
break;
case 6:
$rank = 'Привратник';
break;
case 7:
$rank = 'Казначей';
break;
case 8:
$rank = 'Верховный Магистр';
break;
case 9:
$rank = 'Верховный Магистр';
break;
    
  }


?>
<a href="/clan/<?=$i_clan['id']?>/"> <?=$i_clan['name']?></a>
<span>, <?=$rank?> </span><br/>
<?

}

?>



<?


  
  

?>


</div></div><div class="separ"></div><div class="jour2"><div class="jour" style="color:#a5a5a5"><img src="http://213.239.195.28/xaos/icons/exp2.png" alt=""/> Опыт: <span style="color:khaki"><?=numi($i['exp'])?></span> / <?=numi($exp)?><br/><img src="http://213.239.195.28/xaos/icons/doubleexp.png" alt=""/>
Всего опыта: <span style="color:khaki">1.07m</span><br/><img src="http://213.239.195.28/xaos/style2/shield3.png" alt=""/>  Сила духа: 59 м, <span style="color:khaki">+25% <img src="http://213.239.195.28/xaos/icons_old/exp2.png" alt=""/> <img src="http://213.239.195.28/xaos/16x16/purse.png" alt=""/></span><br/><img src="http://213.239.195.28/xaos/style2/dsword.png" alt=""/>  Лига Кланов: <span style="color:khaki">+21 </span> к <img src="http://213.239.195.28/xaos/16x16/sword.png" alt=""/><img src="http://213.239.195.28/xaos/style/heart.png" alt=""/><img src="http://213.239.195.28/xaos/style2/shield1.png" alt=""/><br/></div></div>
</div></div><div class="separ"></div><div class="jour2"><div class="jour" style="color:#a5a5a5"><img src="http://213.239.195.28/xaos/16x16/sword.png" alt=""/> Сила: <span style="color:khaki"><?=$i['str']?></span> <span style="color:green">+<?=($clan['built_1'] > 0 ? ' '.$clan_buff.' ':'')?></span><br/><img src="http://213.239.195.28/xaos/style/heart.png" alt=""/> Здоровье: <span style="color:khaki"><?=$i['vit']?></span> <span style="color:green">+<?=($clan['built_1'] > 0 ? ' '.$clan_buff.' ':'')?></span><br/><img src="http://213.239.195.28/xaos/style2/shield1.png" alt=""/> Защита: <span style="color:khaki"><?=$i['def']?></span> <span style="color:green">+<?=($clan['built_1'] > 0 ? ' '.$clan_buff.' ':'')?></span><br/><img src="http://213.239.195.28/xaos/16x16/sum.png" alt=""/> Всего: <span style="color:khaki"><span style="color:green"><?=($i['str']+$i['vit']+$i['def'])?></span></span></div></div>
<div class="separ"></div><div class="jour2"><div class="jour" style="color:#a5a5a5"><img src="http://213.239.195.28/xaos/style2/trophy.png" alt=""/> Лига Бойцов:  <span style="color:khaki">1000 место</span><br/><img src="http://213.239.195.28/xaos/style2/dsword.png" alt=""/> Тренировка: <span style="color:khaki">+<?=$i['skill']?> / 650</span><br/><img src="http://213.239.195.28/xaos/16x16/add.png" alt=""/> Заточка:  <span style="color:khaki">+0 / 700</span><br/><img src="http://213.239.195.28/xaos/16x16/chess_tower.png" alt=""/> Амулеты: <span style="color:khaki">+0 / 320 <span style="color:#a5a5a5">+ 222 <img src="http://213.239.195.28/xaos/16x16/award_star_gold_3.png" alt=""/></span></span><br/><img src="http://213.239.195.28/xaos/16x16/shuriken.png" alt=""/> Таланты: <span style="color:khaki">+0 / 675</span><br/><img src="http://213.239.195.28/xaos/16x16/boomerang.png" alt=""/> Специализация: <span style="color:khaki">0%</span><br/><img src="http://213.239.195.28/xaos/16x16/ruby.png" alt=""/> Качество:  <span style="color:khaki">+<?=$bonus?> / <?=$all_bonus?></span><br/><img src="http://213.239.195.28/xaos/16x16/wand.png" alt=""/> Чары:  <span style="color:khaki">+0 / 28000</span><br/><img src="http://213.239.195.28/xaos/16x16/helmet_mine.png" alt=""/> Шахты:  <span style="color:khaki">+0 / 30</span><br/>
<img src="http://213.239.195.28/xaos/16x16/purse.png" alt=""/> <?=numi($i['s'])?> <img src="http://213.239.195.28/xaos/16x16/diamond.png" alt=""/> 78 <img src="http://213.239.195.28/xaos/16x16/award_star_gold_3.png" alt=""/> 0 <img src="http://213.239.195.28/xaos/16x16/medal_bronze_1.png" alt=""/> <?=$i['coliseum_rating']?>  <img src="http://213.239.195.28/xaos/16x16/medal_award_bronze.png" alt=""/> 0<br/></div></div>
<div class="separ"></div><div class="jour2"><div class="jour" style="color:#a5a5a5"><img src="http://213.239.195.28/xaos/16x16/book_spelling.png" alt=""/> О себе: <span style="color:khaki">нет информации</span><br/><img src="http://213.239.195.28/xaos/16x16/male.png" alt=""/> Пол: <span style="color:khaki"><?=($user['sex'] == 0 ? 'Мужской':'Женский')?></span><br/><img src="http://213.239.195.28/xaos/16x16/time.png" alt=""/> Игровое время: <span style="color:khaki">1 час</span><br/><img src="http://213.239.195.28/xaos/16x16/timeline.png" alt=""/> Регистрация:<span style="color:khaki"> <?=date('H:i:s, d.m.y', $user['last_update'])?>
</span><br/><img src="http://213.239.195.28/xaos/16x16/arrow_refresh.png" alt=""/> Был в игре <span style="color:khaki">29<?=$data['login']?> секунд назад.</span><br/><img src="http://213.239.195.28/xaos/icons_old/pin.png" alt=""/> ID игрока: <span style="color:khaki"><?=$i['id']?></span></div></div><div class="separ"></div>
<?

    if($user['id'] == $i['id'] OR !$i['id']) {

?>
<a href="" class="menu_link"><img src="http://213.239.195.28/xaos/16x16/chart_bar.png" alt=""/> Рейтинг игрока</a>
<a href="" class="menu_link"><img src="http://213.239.195.28/xaos/16x16/theater.png" alt=""/> Изменить имя</a>
<a href="" class="menu_link"><img src="http://213.239.195.28/xaos/16x16/toolbox.png" alt=""/> Настройки профиля</a>
<a href="" class="menu_link"><img src="http://213.239.195.28/xaos/16x16/setting_tools.png" alt=""/> Настройки уведомлений</a><div class="separ3"></div>
<?

}


?>
<?
  if($i['id'] == $user['id']) {
?>


<?
  if(!$i_clan_memb && $clan && $clan_memb['rank'] >= $clan['rank_for_invite'] && $clan['r'] == $i['r']) {

    if(mysql_result(mysql_query('SELECT COUNT(*) FROM `clan_invite` WHERE `user` = "'.$i['id'].'" AND `clan` = "'.$clan['id'].'"'),0) == 0) {

?>
 <img src="http://213.239.195.28/xaos/16x16/tower.png" alt=""/> <a href='/user/<?=$i['id']?>/?clan_invite=true' class='menu_link'> Пригласить в клан</a>
<?

  }
  }

?>




<?
}

if($user['access']=='2'){
?>

<a href='/user_pass.php?id=<?=$i['id']?>' class='menu_link'>Пароль</a>

<?
}
?>






<?
$drag=mysql_fetch_array(mysql_query("SELECT * FROM `dragons` WHERE `user`='".$user['id']."'"));

include './system/f.php';

?>