<?
    
    include './system/common.php';
    
 include './system/functions.php';
        
      include './system/user.php';
    
if(!$user) {

  header('location: /');
    
exit;

}
    
    $title = 'Тренировка';

if($user['start'] <9){
include './system/head.php';  
}else{
include './system/h.php';  
   } 
 $f = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$user['id'].'" AND `item` = "78"');
$f = mysql_fetch_array($f);  
    $w_1 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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` = "'.$user['id'].'" AND `id` = "'.$user['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);
   if($user['w_6'] == $f['id']){
   ?>
   <div class="block_zero center"><img src="/images/icon/2hit.png" alt=""> <span class="dgreen bold">Оружие надето!</span> <img src="/images/icon/2hit.png" alt="">
   <div class="separ"></div>
   <img src="http://tiwarus.ru/manekenImage/<?=$user['sex']?>/<?=$w_1['item']?>/<?=$w_2['item']?>/<?=$w_3['item']?>/<?=$w_4['item']?>/<?=$w_5['item']?>/<?=$w_6['item']?>/<?=$w_7['item']?>/<?=$w_8['item']?>/" width="120" height="160" style="margin-right:10px;margin-top:3px;" alt=""><br>
   <span class="yellow">У тебя очень мощное снаряжение!</span><br>Сражайся на арене и получай награду!<div class="mb10"></div><a class="btn" href="/arena/"><span class="end"><span class="label">
   <img src="/images/icon/arena.png" alt=""> Перейти на арену</span></span></a>
   </div>
   <div class="mini-line"></div>
   <?
   }elseif($user['skill'] == 6){
  


$w6 = mysql_query('SELECT * FROM `inv` WHERE `user` = "'.$user['id'].'" AND `id` = "'.$user['w_6'].'"');
$w6 = mysql_fetch_array($w6);
if(isset($_GET['inv'])){
mysql_query('UPDATE `inv` SET `equip`="0" WHERE `user`="'.$user['id'].'" AND `id`="'.$user['w_6'].'"');
mysql_query('UPDATE `users` SET `str`=`str`-"'.$w6['_str'].'",
                                `vit`=`vit`-"'.$w6['_vit'].'",
                                `def`=`def`-"'.$w6['_def'].'",
                                `agi`=`agi`-"'.$w6['_agi'].'",`w_6`="0" WHERE `id` = "'.$user['id'].'"');
mysql_query('UPDATE `inv` SET `equip`="1" WHERE `user`="'.$user['id'].'" AND `item`="78"');
mysql_query('UPDATE `users` SET `str`=`str`+"'.$f['_str'].'",
                                `vit`=`vit`+"'.$f['_vit'].'",
                                `def`=`def`+"'.$f['_def'].'",
                                `agi`=`agi`+"'.$f['_agi'].'", `w_6`="'.$f['id'].'" WHERE `id` = "'.$user['id'].'"');
                                header('location: ?');
}

   ?>
   <div class="block_zero center">
   <img src="/images/icon/2hit.png" alt=""> <span class="dgreen bold">Мастерство прокачано</span> <img src="/images/icon/2hit.png" alt="">
   <div class="separ"></div>
   <img src="http://tiwarus.ru/manekenImage/<?=$user['sex']?>/<?=$w_1['item']?>/<?=$w_2['item']?>/<?=$w_3['item']?>/<?=$w_4['item']?>/<?=$w_5['item']?>/<?=$w_6['item']?>/<?=$w_7['item']?>/<?=$w_8['item']?>/" width="120" height="160" style="margin-right:10px;margin-top:3px;" alt="">
   <div class="separ"></div>
   <div style="display:inline-block;white-space:nowrap;text-align:left;">
   <span class="yellow"><div class="item50 ibl fl" style="background-image:url(&quot;http://5.9.146.51/itemimage/78/0/0/3711470294.w?4&quot;);margin-right:5px;"><div class="it_brd q2p sh8"><div class="it_stat1"></div>
   <div class="clb"></div><div class="it_stat2 cntr"><div class="it_stars"></div></div></div></div></span><span class="yellow">Топор рыцаря</span><span class="small"><br><img src="/images/icon/grade/2p.png" alt=""> <span class="quality-2p">Обычный+</span><br>
   <span class="green">+60 мощь</span></span><div style="clear:both;"></div></div><div class="separ"></div>
   <a class="btn" href="?inv"><span class="end"><span class="label">Надеть оружие</span></span></a></div>
      <div class="mini-line"></div>

   <?
   }
   if($user['start'] <9 && $user['skill'] != 6){
  echo'
   <div class="block_zero center yellow">Прокачай мастерство до 6, чтобы надеть оружие!<br>Мастерство: '.$user['skill'].'</div>
   <div class="mini-line"></div>
   ';
   }
   if($user['w_6'] == $f['id']){
   ?>
   <div class="center"><div class="block_zero"><img src="/images/town/hd/train.jpg" width="100%" alt=""></div></div>
   <div class="mini-line"></div>
   <?}
    function cost($i) {
        
        switch($i) {
          case 0:
           $cost = 100;
           break;
        
          case 1:
           $cost = 400;
           break;
        
          case 2:
           $cost = 600;
           break;
          
          case 3:
           $cost = 800;
           break;

          case 4:
           $cost = 1000;
           break;   
           
          case 5:
           $cost = 1;
           break;        

          case 6:
           $cost = 1600;
           break;   

          case 7:
           $cost = 3200;
           break;

          case 8:
           $cost = 4800;
           break;   
           
          case 9:
           $cost = 6400;
           break;   

          case 10:
           $cost = 8000;
           break;   

          case 11:
           $cost = 10;
           break;   

          case 12:
           $cost = 2400;
           break;   

          case 13:
           $cost = 4800;
           break;   

          case 14:
           $cost = 7200;
           break;   

          case 15:
           $cost = 9600;
           break;   

          case 16:
           $cost = 12000;
           break;   

          case 17:
           $cost = 20;
           break;   

          case 18:
           $cost = 3200;
           break;   

          case 19:
           $cost = 7200;
           break;   

          case 20:
           $cost = 10800;
           break;   

          case 21:
           $cost = 14400;
           break;   

          case 22:
           $cost = 18000;
           break;   

          case 23:
           $cost = 40;
           break;   

          case 24:
           $cost = 3600;
           break;   

          case 25:
           $cost = 7200;
           break;   

          case 26:
           $cost = 10800;
           break;   

          case 27:
           $cost = 14400;
           break;   

          case 28:
           $cost = 18000;
           break;   

          case 29:
           $cost = 80;
           break;   

          case 30:
           $cost = 4800;
           break;   

          case 31:
           $cost = 9600;
           break;   

          case 32:
           $cost = 14400;
           break;   

          case 33:
           $cost = 19200;
           break;   

          case 34:
           $cost = 24000;
           break;   

          case 35:
           $cost = 160;
           break;   

          case 36:
           $cost = 5600;
           break;   

          case 37:
           $cost = 11200;
           break;   

          case 38:
           $cost = 16800;
           break;   

          case 39:
           $cost = 22400;
           break;   

          case 40:
           $cost = 28000;
           break;   

          case 41:
           $cost = 320;
           break;   

          case 42:
           $cost = 6400;
           break;   

          case 43:
           $cost = 12800;
           break;   

          case 44:
           $cost = 19200;
           break;   

          case 45:
           $cost = 25600;
           break;   

          case 46:
           $cost = 32000;
           break;   

          case 47:
           $cost = 640;
           break;   

          case 48:
           $cost = 7200;
           break;   

          case 49:
           $cost = 14400;
           break;   

          case 50:
           $cost = 21600;
           break;   

          case 51:
           $cost = 28800;
           break;   

          case 52:
           $cost = 36000;
           break;   

          case 53:
           $cost = 1280;
           break;   

          case 54:
           $cost = 5000;
           break;   

          case 55:
           $cost = 16000;
           break;   

          case 56:
           $cost = 24000;
           break;   

          case 57:
           $cost = 32000;
           break;   

          case 58:
           $cost = 40000;
           break;   

          case 59:
           $cost = 2560;
           break;   

        }
        
    return $cost;
    
    }

    function value($i) {
        
        switch($i) {
          case 0:
           $value = 's';
           break;
        
          case 1:
           $value = 's';
           break;
        
          case 2:
           $value = 's';
           break;
          
          case 3:
           $value = 's';
           break;

          case 4:
           $value = 's';
           break;        

          case 5:
           $value = 'g';
           break;        

          case 6:
           $value = 's';
           break;        

          case 7:
           $value = 's';
           break;        

          case 8:
           $value = 's';
           break;        

          case 9:
           $value = 's';
           break;        

          case 10:
           $value = 's';
           break;        

          case 11:
           $value = 'g';
           break;        

          case 12:
           $value = 's';
           break;        

          case 13:
           $value = 's';
           break;        

          case 14:
           $value = 's';
           break;        

          case 15:
           $value = 's';
           break;        

          case 16:
           $value = 's';
           break;        

          case 17:
           $value = 'g';
           break;        

          case 18:
           $value = 's';
           break;        
        
          case 19:
           $value = 's';
           break;        

          case 20:
           $value = 's';
           break;        
          
          case 21:
           $value = 's';
           break;        
          
          case 22:
           $value = 's';
           break;     
              
          case 23:
           $value = 'g';
           break;        

          case 24:
           $value = 's';
           break;     

          case 25:
           $value = 's';
           break;     

          case 26:
           $value = 's';
           break;     

          case 27:
           $value = 's';
           break;     

          case 28:
           $value = 's';
           break;     

          case 29:
           $value = 'g';
           break;     

          case 30:
           $value = 's';
           break;     

          case 31:
           $value = 's';
           break;     

          case 32:
           $value = 's';
           break;     

          case 33:
           $value = 's';
           break;     

          case 34:
           $value = 's';
           break;     

          case 35:
           $value = 'g';
           break;     

          case 36:
           $value = 's';
           break;     

          case 37:
           $value = 's';
           break;     

          case 38:
           $value = 's';
           break;     

          case 39:
           $value = 's';
           break;     

          case 40:
           $value = 's';
           break;     

          case 41:
           $value = 'g';
           break;     

          case 42:
           $value = 's';
           break;     

          case 43:
           $value = 's';
           break;     

          case 44:
           $value = 's';
           break;     

          case 45:
           $value = 's';
           break;     

          case 46:
           $value = 's';
           break;     

          case 47:
           $value = 'g';
           break;     

          case 48:
           $value = 's';
           break;     

          case 49:
           $value = 's';
           break;     

          case 50:
           $value = 's';
           break;     

          case 51:
           $value = 's';
           break;     

          case 52:
           $value = 's';
           break;     

          case 53:
           $value = 'g';
           break;     

          case 54:
           $value = 's';
           break;     

          case 55:
           $value = 's';
           break;     

          case 56:
           $value = 's';
           break;     

          case 57:
           $value = 's';
           break;     

          case 58:
           $value = 's';
           break;     

          case 59:
           $value = 'g';
           break;     

        }
    
    return $value;
    
    }

if(isset($_GET['str'])) {

if($user['_str'] < 61) {

    if(value($user['_str']) == 's') {

      if($user['s'] < cost($user['_str'])) {
      
        
      
      }
      else
      {
      
          mysql_query('UPDATE `users` SET `str` =   `str` + 1,
                                         `_str` =  `_str` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `s` = `s` - '.cost($user['_str']).' WHERE `id` = "'.$user['id'].'"');
       $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/str.png" alt=""> <b>Сила</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }

    }
    else
    if(value($user['_str'] == 'g')) {
      
      if($user['g'] < cost($user['_str'])) {
      
        
      
      }
      else
      {
      

          mysql_query('UPDATE `users` SET `str` =   `str` + 1,
                                         `_str` =  `_str` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `g` = `g` - '.cost($user['_str']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/str.png" alt=""> <b>Сила</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }    
    
    }

}    
$_SESSION['inf'] = $o;
    header('location: /train');

}

if(isset($_GET['vit'])) {

if($user['_vit'] < 61) {

    if(value($user['_vit']) == 's') {

      if($user['s'] < cost($user['_vit'])) {
      
        
      
      }
      else
      {
      
          mysql_query('UPDATE `users` SET `vit` =   `vit` + 1,
                                         `_vit` =  `_vit` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `s` = `s` - '.cost($user['_vit']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/health.png" alt=""> <b>Жизнь</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }

    }
    else
    if(value($user['_vit'] == 'g')) {
      
      if($user['g'] < cost($user['_vit'])) {
      
        
      
      }
      else
      {
      

          mysql_query('UPDATE `users` SET `vit` =   `vit` + 1,
                                         `_vit` =  `_vit` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `g` = `g` - '.cost($user['_vit']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/health.png" alt=""> <b>Жизнь</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }    
    
    }

}    
$_SESSION['inf'] = $o;
    header('location: /train');

}

if(isset($_GET['agi'])) {

if($user['_agi'] < 61) {

    if(value($user['_agi']) == 's') {

      if($user['s'] < cost($user['_agi'])) {
      
        
      
      }
      else
      {
      
          mysql_query('UPDATE `users` SET `agi` =   `agi` + 1,
                                         `_agi` =  `_agi` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `s` = `s` - '.cost($user['_agi']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/agi.png" alt=""> <b>Удача</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }

    }
    else
    if(value($user['_agi'] == 'g')) {
      
      if($user['g'] < cost($user['_agi'])) {
      
        
      
      }
      else
      {
      

          mysql_query('UPDATE `users` SET `agi` =   `agi` + 1,
                                         `_agi` =  `_agi` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `g` = `g` - '.cost($user['_agi']).' WHERE `id` = "'.$user['id'].'"');
       $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/agi.png" alt=""> <b>Удача</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }    
    
    }

}    
$_SESSION['inf'] = $o;
    header('location: /train');

}

if(isset($_GET['def'])) {

if($user['_def'] < 61) {

    if(value($user['_def']) == 's') {

      if($user['s'] < cost($user['_def'])) {
      
        
      
      }
      else
      {
      
          mysql_query('UPDATE `users` SET `def` =   `def` + 1,
                                         `_def` =  `_def` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `s` = `s` - '.cost($user['_def']).' WHERE `id` = "'.$user['id'].'"');
       $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/def.png" alt=""> <b>Защита</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }

    }
    else
    if(value($user['_def'] == 'g')) {
      
      if($user['g'] < cost($user['_def'])) {
      
        
      
      }
      else
      {
      

          mysql_query('UPDATE `users` SET `def` =   `def` + 1,
                                         `_def` =  `_def` + 1,
                                        `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

            mysql_query('UPDATE `users` SET `g` = `g` - '.cost($user['_def']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/def.png" alt=""> <b>Защита</b> увеличена на <span class="dgreen">+1</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      }    
    
    }

}    

$_SESSION['inf']=$o;
    header('location: /train');

}

if(isset($_GET['mana'])) {

if($user['_mana'] < 61) {

    if(value($user['_mana']) == 's') {

      if($user['s'] < cost($user['_mana'])) {
      
        
      
      }
      else
      {
      
          mysql_query('UPDATE `users` SET `mana` =  `mana` + 5,
                                         `_mana` = `_mana` + 1,
                                         `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

      mysql_query('UPDATE `users` SET `s` = `s` - '.cost($user['_mana']).' WHERE `id` = "'.$user['id'].'"');
      $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/mana.png" alt=""> <b>Мана</b> увеличена на <span class="dgreen">+5</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }

    }
    else
    if(value($user['_mana'] == 'g')) {
      
      if($user['g'] < cost($user['_mana'])) {
      
        
      
      }
      else
      {
      

          mysql_query('UPDATE `users` SET `mana` =  `mana` + 5,
                                         `_mana` = `_mana` + 1,
                                         `skill` = `skill` + 1 WHERE `id` = "'.$user['id'].'"');

      mysql_query('UPDATE `users` SET `g` = `g` - '.cost($user['_mana']).' WHERE `id` = "'.$user['id'].'"');
       $o='<div class="block_outer center" style="margin:7px 4px 7px 4px;">
      <img src="/images/icon/mana.png" alt=""> <b>Мана</b> увеличена на <span class="dgreen">+5</span><br><img src="/images/icon/skill.png" alt=""> <b>Мастерство</b> увеличено на <span class="dgreen">+1</span></div>';
      
      }    
    
    }

}    $_SESSION['inf']=$o;

    header('location: /train.php');

}

?>
<div class='main'>
<div class='block_zero'>
<img src='/images/icon/str.png' alt='*'/> Сила: <?=$user['str']?> <font color='#999'>(урон <?=round($user['str']/6)?> -  <?=round($user['str']/4)?>)</font><br/>
<small>+<?=$user['_str']?> к мастерству</small>

<?

  $_str_progress = round(100 / (60 / $user['_str']));

?>

<div style='border:1px solid #000; background: #ffffff; height: 4px;'>
<div style='background: #fc3; height: 4px; width: <?=$_str_progress?>%;'></div>
</div><small>Чем больше сила, тем больше урона нанесёшь врагу!
</small>
<?

  if($user['_str'] < 60) {
if($user['_str']!=2 && $user['start']<9){
?>
<br/><br/>
<div align='center'>
<a class='btn' href='?str'><span class='end'><span class='label'>Улучшить за <img src='/images/icon/<?=(value($user['_str']) == 'g' ? 'gold':'silver')?>.png' alt='*'/> <?=cost($user['_str'])?></span></span></a>
</div>

<?
}
  }

?>

</div>
 <div class='mini-line'></div>

<div class='block_zero'>

<img src='/images/icon/vit.png' alt='*'/> Жизнь: <?=$user['vit']?> <font color='#999'>(<?=($user['vit']*2)?>)</font><br/>
<small>+<?=$user['_vit']?> к мастерству</small>

<?

  $_vit_progress = round(100 / (60 / $user['_vit']));

?>

<div style='border:1px solid #000; background: #ffffff; height: 4px;'>
<div style='background: #fc3; height: 4px; width: <?=$_vit_progress?>%;'></div>
</div><small>Здоровья много не бывает
</small>

<?

  if($user['_vit'] < 60) {
if($user['_vit']!=1 && $user['start']<9){

?>
<br/><br/>
<div align='center'>
<a class='btn' href='?vit'><span class='end'><span class='label'>Улучшить за <img src='/images/icon/<?=(value($user['_vit']) == 'g' ? 'gold':'silver')?>.png' alt='*'/> <?=cost($user['_vit'])?></span></span></a>
</div>

<?
}
  }

?>


</div>
 <div class='mini-line'></div>

<div class='block_zero'>

<img src='/images/icon/agi.png' alt='*'/> Удача: <?=$user['agi']?> <font color='#999'>(<?=$user['agi']/100?> % крит/уклонение)</font><br/>
<small>+<?=$user['_agi']?> к мастерству</small>

<?

  $_agi_progress = round(100 / (60 / $user['_agi']));

?>

<div style='border:1px solid #000; background: #ffffff; height: 4px;'>
<div style='background: #fc3; height: 4px; width: <?=$_agi_progress?>%;'></div>
</div><small>Увеличивает шанс на уворот и крит.удар
</small>

<?

  if($user['_agi'] < 60) {
if($user['_agi']!=1 && $user['start']<9){

?>
<br/><br/>
<div align='center'>
<a class='btn' href='?agi'><span class='end'><span class='label'>Улучшить за <img src='/images/icon/<?=(value($user['_agi']) == 'g' ? 'gold':'silver')?>.png' alt='*'/> <?=cost($user['_agi'])?></span></span></a>
</div>

<?
}
  }

?>

</div>
 <div class='mini-line'></div>


<div class='block_zero'>

<img src='/images/icon/def.png' alt='*'/> Защита: <?=$user['def']?> <font color='#999'>(поглощение урона <?=round($user['def']/12)?> - <?=round($user['def']/7)?>)</font><br/>
<small>+<?=$user['_def']?> к мастерству</small>

<?

  $_def_progress = round(100 / (60 / $user['_def']));

?>

<div style='border:1px solid #000; background: #ffffff; height: 4px;'>
<div style='background: #fc3; height: 4px; width: <?=$_def_progress?>%;'></div>
</div><small>Поглощает урон врага
</small>

<?

  if($user['_def'] < 60) {
if($user['_def']!=1 && $user['start']<9){

?>
<br/><br/>
<div align='center'>
<a class='btn' href='?def'><span class='end'><span class='label'>Улучшить за <img src='/images/icon/<?=(value($user['_def']) == 'g' ? 'gold':'silver')?>.png' alt='*'/> <?=cost($user['_def'])?></span></span></a>
</div>

<?

  }
}
?>


</div>
 <div class='mini-line'></div>


<div class='block_zero'>

<img src='/images/icon/mana.png' alt='*'/> Мана:  <?=$user['mana']?><br/>
<small>+<?=$user['_mana']?> к мастерству</small>

<?

  $_mana_progress = round(100 / (60 / $user['_mana']));

?>
<div style='border:1px solid #000; background: #ffffff; height: 4px;'>
<div style='background: #fc3; height: 4px; width: <?=$_mana_progress?>%;'></div>
</div><small>Увеличивает запас маны
</small><br/>

<?

  if($user['_mana'] < 60) {
if($user['_mana']!=1 && $user['start']<9){

?>
<div align='center'>
<a class='btn' href='?mana'><span class='end'><span class='label'>Улучшить за <img src='/images/icon/<?=(value($user['_mana']) == 'g' ? 'gold':'silver')?>.png' alt='*'/> <?=cost($user['_mana'])?></span></span></a>
</div>

<?

  }
}
?>

</div>
 <div class='mini-line'></div>


<div class='block_zero'>
<img src='/images/icon/skill.png' alt='*'/> Мастерство: <?=$user['skill']?>
</div>
 <div class='mini-line'></div>

</div>
<ul class="hint">
<li>Прокачивая параметры, вы увеличиваете мастерство</li>
<li>Чем выше мастерство, тем более крутые вещи доступны в <img src="/images/icon/equip.png" alt=""> <a href="/shop/">Магазине снаряжения</a></li>
<li>Чем выше мастерство, тем больше параметров дают <img src="/images/icon/potion.png" alt=""> <a href="/lab/alchemy">Эликсиры</a></li>
</ul>
<?
  
if($user['start'] <9){
include './system/foot.php';  
}else{
include './system/f.php';  
   } 
?>