<?php

require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
$page_title = 'Мастер';
require_once('conf/head.php');
if ((isset($_SESSION['id'])) or (isset($_SESSION['nick'])))  {
require_once('conf/top.php');;
}
$thing= abs(intval($_GET['thing']));
$user_id = abs(intval($_SESSION['id']));
if (empty($thing)) {
  ?>
  <script type="text/javascript">
  document.location.href = "clothes.php?id=<?php echo "$user_id"?>";
  </script>
  <?php
  exit();
}
$query = "Select * from things where thing_id='$thing' limit 1";
$result = mysqli_query($dbc, $query) or die ('Ошибка передачи запроса к БД2');
$total = mysqli_num_rows($result);
if ($total == 0) {
  ?>
  <script type="text/javascript">
  document.location.href = "clothes.php?id=<?php echo "$user_id"?>";
  </script>
  <?php
  exit();
}
$row=mysqli_fetch_array($result);
$inf_cl = $row['inf_id'];
$type = $row['type'];
if ($type == 1) {
  $query_inf = "Select name,screen,klass from clothes where clothes_id = '$inf_cl' limit 1";
  $result_inf = mysqli_query($dbc, $query_inf) or die ('Ошибка передачи запроса к БД');
  $row_inf = mysqli_fetch_array($result_inf);
}//Назваине брони
if ($type == 2) {
  $query_inf = "Select name,screen,klass from pistols where pistols_id = '$inf_cl' limit 1";
  $result_inf = mysqli_query($dbc, $query_inf) or die ('Ошибка передачи запроса к БД');
  $row_inf = mysqli_fetch_array($result_inf);
}//Название Пистолета
if ($type== 3) {
  $query_inf = "Select name,screen,klass from weapons where weapons_id = '$inf_cl' limit 1";
  $result_inf = mysqli_query($dbc, $query_inf) or die ('Ошибка передачи запроса к БД');
  $row_inf = mysqli_fetch_array($result_inf);
}//Название оружия
if ($type == 4) {
  $query_inf = "Select name,screen,klass from shlem where shlem_id = '$inf_cl' limit 1";
  $result_inf = mysqli_query($dbc, $query_inf) or die ('Ошибка передачи запроса к БД');
  $row_inf = mysqli_fetch_array($result_inf);
}//Назваине шлема
$user_set = $row['user_id'];
$query_user = "Select nick,last_active,gruppa from users where id='$user_set' limit 1";
$result_user = mysqli_query($dbc, $query_user) or die ('Ошибка передачи запроса к БД2');
$row_user=mysqli_fetch_array($result_user);
if (isset($_SESSION['id']) and $_SESSION['id'] == $row['user_id']) {
?><br/>
<p class="name">Техник</p>
  <div class='npc_title'><img src="img/ico/novikov.png"  style='float:left;margin-right:5px;'/>
		<b>Имя:</b> <b style='color:#faaa05'>Нармин</b></br>
		<b>Ранг:</b> Опытный<br/>
		<b>Расса:</b> Техник<br/>
</div>
<div class='npc_border'></div>
<?php

if($user[vip]==1){?><font color="gold">Скидка улучшения вещи для VIP -25%.Цены указаны без скидки кроме первой раскачки!</font><p class"zx"></p>
<?php }
$err = abs(intval($_GET['err']));
if (empty($err) or $err<>1 and $err <>2 and $err <>3) {?>
<a class="net">Показывай свое снаряжение, посмотрим что я смогу сделать!</p>
<?php }
else {
if ($err == 1) {?><div class='info' style='color:#FFFFFF;border:1px solid #C51A01;background-color:#C51A01'>Чувачок, улучшать больше нечего:)</div><?php }
if ($err == 2) {?><div class='info' style='color:#FFFFFF;border:1px solid #C51A01;background-color:#C51A01'>Я бесплатно не работаю или ты решил меня ОБМАНУТЬ?!</div><?php }
if ($err == 3) {?><div class='info' style='color:#FFFFFF;border:1px solid #64B02C;background-color:#009933'>- Смотри…И как…сделал что смог…</div><?php }
}
} else {?><div class="stats">
<p class="podmenu">Список улучшений</p>
</div><?php }
?>
<p><b><a href="thing.php?thing=<?php echo "$thing";?>">[<?php echo $row_inf['name'];?> Улучшаемое]</a></b></p>
<p>Состояние: <span class="white"><?php echo $row['sost'];?>/8</span></p>
<p>Владелец: <span class="white">
<?php 
 if ($row_user['gruppa'] == 'svoboda') {if ($razn_last_act < 300 ) {?><img src="img/ico/svobodaon.png" width="12" height="12" alt="н"/><?php } else {?><img src="img/ico/svoboda.png" width="12" height="12" alt="н"/><?php }}
if ($row_user['gruppa'] == 'dolg') {if ($razn_last_act < 300 ) {?><img src="img/ico/dolgon.png" width="12" height="12" alt="н"/><?php } else {?><img src="img/ico/dolg.png" width="12" height="12" alt="н"/><?php }}
if ($row_user['gruppa'] == 'naemniki') {if ($razn_last_act < 300 ) {?><img src="img/ico/naemniki.png" width="12" height="12" alt="н"/><?php } else {?><img src="img/ico/naemniki.png" width="12" height="12" alt="н"/><?php }}
if ($row_user['gruppa'] == 'chistoenebo') {if ($razn_last_act < 300 ) {?><img src="img/ico/chistoenebo.png" width="12" height="12" alt="н"/><?php } else {?><img src="img/ico/chistoenebo.png" width="12" height="12" alt="н"/><?php }}
if ($row_user['gruppa'] == 'renegat') {if ($razn_last_act < 300 ) {?><img src="img/ico/renegat.png" width="12" height="12" alt="н"/><?php } else {?><img src="img/ico/renegat.png" width="12" height="12" alt="н"/><?php }}

?> 
<a  class="white" href="profile.php?id=<?php echo "$user_set"?>"><?php echo $row_user['nick'];?></a></span></p>	  
<?php
if (isset($_SESSION['id']) and $_SESSION['id'] == $row['user_id']) {
  $up1 = ($row['upgrade_stat1'] +1);
  $up2 = ($row['upgrade_stat2'] +1);
  $up3 = ($row['upgrade_stat3'] +1);
  $up4 = ($row['upgrade_speed'] +1);
  if ($type == 1) {
    ?>
	<div class="stats">
	<?php
    if ($up1<=4) {
      $query_up = "Select name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade = '$up1' and stat = 'hp'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=1"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up1 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к здоровью)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к здоровью)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к здоровью)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up1 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к здоровью)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
    if ($up2<=4) {
      $query_up = "Select name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade = '$up2' and stat = 'bronya'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=2"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up2 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к броне)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к броне)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к броне)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up2 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к броне)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up3<=4) {
      $query_up = "Select name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade = '$up3' and stat = 'prochn'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=3"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up3 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к прочности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к прочности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к прочности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up3 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к прочности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up4<=4) {
      $query_up = "Select name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade = '$up4' and stat = 'radiation'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=4"><?php echo $row_up['name'];?>Улучшить</a><?php
	  ////////////////////
if ($up4 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к радиозащите)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к радиозащите)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к радиозащите)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up4 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к радиозащите)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
	?>
    </div>
  <?php
  }
  if ($type == 2) {
    ?>
	<div class="stats">
	<?php
    if ($up1<=4) {
      $query_up = "Select name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade = '$up1' and stat = 'yron'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=1"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up1 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к урону)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к урону)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к урону)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up1 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к урону)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
    if ($up2<=4) {
      $query_up = "Select name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade = '$up2' and stat = 'tochn'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=2"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up2 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к точности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к точности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к точности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up2 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к точности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up3<=4) {
      $query_up = "Select name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade = '$up3' and stat = 'safety'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=3"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up3 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к надёжности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к надёжности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к надёжности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up3 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к надёжности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up4<=4) {
      $query_up = "Select name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade = '$up4' and stat = 'speed'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=4"><?php echo $row_up['name'];?>Улучшить</a><?php
	  ////////////////////
if ($up4 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(-1 сек к скорострельности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(-2 сек к скорострельности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(-3 сек к скорострельности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up4 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(-4 сек к скорострельности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
	?>
    </div>
  <?php
  }
  //
  if ($type == 3) {
    ?>
	<div class="stats">
	<?php
    if ($up1<=4) {
      $query_up = "Select name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade = '$up1' and stat = 'yron'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=1"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up1 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к урону)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к урону)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к урону)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up1 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к урону)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
    if ($up2<=4) {
      $query_up = "Select name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade = '$up2' and stat = 'tochn'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=2"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up2 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к точности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к точности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к точности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up2 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к точности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up3<=4) {
      $query_up = "Select name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade = '$up3' and stat = 'safety'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=3"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up3 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к надёжности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к надёжности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к надёжности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up3 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к надёжности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up4<=4) {
      $query_up = "Select name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade = '$up4' and stat = 'speed'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=4"><?php echo $row_up['name'];?>Улучшить</a><?php
	  ////////////////////
if ($up4 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(-10% к скорострельности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
          if ($up4 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(-25% к скорострельности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(-50% к скорострельности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up4 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(-75% к скорострельности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
	?>
    </div>
  <?php
  }
//
  if ($type == 4) {
    ?>
	<div class="stats">
	<?php
    if ($up1<=4) {
      $query_up = "Select name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade = '$up1' and stat = 'hp_sh'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД41');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=1"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up1 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к здоровью)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к здоровью)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up1 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к здоровью)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up1 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к здоровью)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
    if ($up2<=4) {
      $query_up = "Select name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade = '$up2' and stat = 'bronya_sh'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД42');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=2"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up2 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к броне)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к броне)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up2 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к броне)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up2 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к броне)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up3<=4) {
      $query_up = "Select name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade = '$up3' and stat = 'sost_sh'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД43');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=3"><?php echo $row_up['name'];?>Улучшить</a><?php
	  /////////////////////
if ($up3 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к прочности)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к прочности)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up3 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к прочности)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up3 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к прочности)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?></p>
	  <?php
	}
	if ($up4<=4) {
      $query_up = "Select name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade = '$up4' and stat = 'radiation'";
      $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД44');
      $row_up = mysqli_fetch_array($result_up);
      ?>
<p>- <a href="upgrade_thing.php?thing=<?php echo "$thing";?>&stat=4"><?php echo $row_up['name'];?>Улучшить</a><?php
	  ////////////////////
if ($up4 == 1) {?> <img src="img/ico/class1.png" width="12" height="12"/><span class="bonus">(+10% к радиозащите)</span><span class="white"> [5.000 для VIP 3750 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 2) {?> <img src="img/ico/class2.png" width="12" height="12"/><span class="bonus">(+25% к радиозащите)</span><span class="white"> [30.000 <img src="img/ico/materials.png" width="12" height="12"/>]</span><?php }
	  if ($up4 == 3) {?> <img src="img/ico/class3.png" width="12" height="12"/><span class="bonus">(+50% к радиозащите)</span><span class="white"> [10.000 Золота]</span><?php }
	  if ($up4 == 4) {?> <img src="img/ico/class4.png" width="12" height="12"/><span class="bonus">(+75% к радиозащите)</span><span class="white"> [25.000 Золота]</span><?php }
	  /////////////////////?>
	  </p>
	  <?php
	}
	?>
    </div>
  <?php
  }
  //
}
?>
<div class="stats">
<p class="podmenu">Уже установлено</p>
</div>
<?php ///////////////////////Улучшения для одежды ТИП 1
if ($type == 1) {
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Здоровье]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat1= $row['upgrade_stat1'];
  $query_up = "Select number_upgrade, name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade <= '$upgrade_stat1' and stat = 'hp' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Здоровье вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Броня]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat2= $row['upgrade_stat2'];
  $query_up = "Select number_upgrade, name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade <= '$upgrade_stat2' and stat = 'bronya' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Броню вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Прочность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat3= $row['upgrade_stat3'];
  $query_up = "Select number_upgrade, name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade <= '$upgrade_stat3' and stat = 'prochn' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Прочность вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Радиозащита]</b></p>
  <div class="clothes">
  <?php
  $upgrade_speed= $row['upgrade_speed'];
  $query_up = "Select number_upgrade, name,about from upgrade_clothes where clothes_id='$inf_cl' and number_upgrade <= '$upgrade_speed' and stat = 'radiation' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
}

/////////////////////////////////////////
/////////////////////////////Улучшения для пистолета ТИП 2
if ($type == 2) {
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Урон]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat1= $row['upgrade_stat1'];
  $query_up = "Select number_upgrade, name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade <= '$upgrade_stat1' and stat = 'yron' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Здоровье вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Точность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat2= $row['upgrade_stat2'];
  $query_up = "Select number_upgrade, name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade <= '$upgrade_stat2' and stat = 'tochn' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Броню вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Надёжность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat3= $row['upgrade_stat3'];
  $query_up = "Select number_upgrade, name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade <= '$upgrade_stat3' and stat = 'safety' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Прочность вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Скорострельность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_speed= $row['upgrade_speed'];
  $query_up = "Select number_upgrade, name,about from upgrade_pistols where pistols_id='$inf_cl' and number_upgrade <= '$upgrade_speed' and stat = 'speed' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-1сек)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-3сек)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-4сек)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-5сек)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
}
///////////////////////////////////////
/////////////////////////////Улучшения для автомата ТИП 3
if ($type == 3) {
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Урон]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat1= $row['upgrade_stat1'];
  $query_up = "Select number_upgrade, name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade <= '$upgrade_stat1' and stat = 'yron' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Здоровье вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Точность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat2= $row['upgrade_stat2'];
  $query_up = "Select number_upgrade, name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade <= '$upgrade_stat2' and stat = 'tochn' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Броню вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Надёжность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat3= $row['upgrade_stat3'];
  $query_up = "Select number_upgrade, name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade <= '$upgrade_stat3' and stat = 'safety' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Прочность вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Скорострельность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_speed= $row['upgrade_speed'];
  $query_up = "Select number_upgrade, name,about from upgrade_weapons where weapons_id='$inf_cl' and number_upgrade <= '$upgrade_speed' and stat = 'speed' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (-75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
}
///////////////////////////////////////
 ///////////////////////Улучшения для одежды ТИП 4(шлемы)
if ($type == 4) {
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Здоровье]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat1= $row['upgrade_stat1'];
  $query_up = "Select number_upgrade, name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade <= '$upgrade_stat1' and stat = 'hp' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Здоровье вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Броня]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat2= $row['upgrade_stat2'];
  $query_up = "Select number_upgrade, name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade <= '$upgrade_stat2' and stat = 'bronya' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Броню вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Прочность]</b></p>
  <div class="clothes">
  <?php
  $upgrade_stat3= $row['upgrade_stat3'];
  $query_up = "Select number_upgrade, name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade <= '$upgrade_stat3' and stat = 'prochn' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
//Прочность вывели
  ?><div class="stats"><p class="white" style="background-color:#1e2833;"><b>[Радиозащита]</b></p>
  <div class="clothes">
  <?php
  $upgrade_speed= $row['upgrade_speed'];
  $query_up = "Select number_upgrade, name,about from upgrade_shlem where shlem_id='$inf_cl' and number_upgrade <= '$upgrade_speed' and stat = 'radiation' order by number_upgrade asc";
  $result_up = mysqli_query($dbc, $query_up) or die ('Ошибка передачи запроса к БД2');
  while ($row_up = mysqli_fetch_array($result_up)) {?>
    <div class="zx">
    <?php
    if ($row_up['number_upgrade'] == 1) {?>
	  <p><img src="img/ico/class1.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+10%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 2) {?>
	  <p><img src="img/ico/class2.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+25%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 3) {?>
	  <p><img src="img/ico/class3.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+50%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
	if ($row_up['number_upgrade'] == 4) {?>
	  <p><img src="img/ico/class4.png" width="12" height="12"/><span class="white"><?php echo $row_up['name'];?></span> (+75%)<p>
	  <p>[<?php echo $row_up['about'];?>]</p>
	<?php 
	}
  ?></div><?php
  }
  ?></div></div><?php
}

/////////////////////////////////////////
require_once('conf/navig.php');
require_once('conf/foot.php');
mysqli_close($dbc);
?>

</body>
</html>