<?php

require_once('conf/dbc.php');
require_once('conf/session_start.php');
require_once('conf/ban.php');
if ((!isset($_SESSION['id'])) or (!isset($_SESSION['nick'])))  {
?>
<script type="text/javascript">
  document.location.href = "login.php";
</script>
<?php
}
$page_title = 'Лот';
require_once('conf/head.php');
require_once('conf/top.php');
$lot = abs(intval($_GET['lot']));
if (empty($lot)) {
  ?>
  <script type="text/javascript">
  document.location.href = "a_clothes.php";
  </script>
  <?php
  exit();
}
  $query_lot = "Select  thing_id, price,price_now, price_user from auction where id_lot='$lot' limit 1";
  $result_lot = mysqli_query($dbc, $query_lot) or die ('Ошибка передачи запроса к БД');
  $row_lot = mysqli_fetch_array($result_lot);
if ($row_lot == 0) {
  ?>
  <script type="text/javascript">
  document.location.href = "a_clothes.php";
  </script>
  <?php
  exit();
}
$thing=$row_lot['thing_id'];

$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 = "thingnotfound.php";
  </script>
  <?php
  exit();
}
$row=mysqli_fetch_array($result);
$user_set = $row['user_id'];
$query_user = "Select * 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);
$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);
}//Назваине шлема
?>
<div id="main">
<div class="stats">
<p class="podmenu"><?php echo $row_inf['name'];?></p>
</div>
<div class="stats">
<p><img src="img/ico/left.png" /> <a href="a_clothes.php">Назад к аукциону</a></p>
</div>
<?php
$err=abs(intval($_GET['err']));
if (!empty($err)) {
?>
<div id="error">
<?php
if ($err == 1) {echo 'Недостаточно денег чтобы сделать ставку';}
if ($err == 2) {echo 'Недостаточно денег чтобы приобрести эту вещь';}

?>
</div>
<?php
}
$user_id = abs(intval($_SESSION['id']));
  $query_u = "Select lvl,money, habar from users where id = '$user_id'";
  $result_u = mysqli_query($dbc, $query_u) or die ('Ошибка передачи запроса к БД');
  $row_u = mysqli_fetch_array($result_u);
  $money = $row_u['money'];
  $habar = $row_u['habar'];
  $lvl = $row_u['lvl'];
  ?>
  <div class="stats">
    <p>[<img src="img/ico/money.png" width="12" height="12"/> <span class="white"><?php echo "$money"; ?></span>] [<img src="img/ico/materials.png" width="12" height="12"/> <span class="white"><?php echo "$habar"; ?></span>]</p>
  </div>
<div class="slot">
<?php
/////////////////////////////////////Начало БРОНИ
if ($type == 1) {
?>
<table width="190" border="0" cellpadding="0" cellspacing="0">
      <tbody>
      <tr>
      <td width="54" valign="top"><img src="img/clothes/<?php echo $row_inf['screen'];?>" alt="Слот №1" width="80" height="100"/></td>
      <td width="136" valign="top">
  </div>
	  </td>
      </tr>
      </tbody>
      </table>
	  <div class="clothes">

	    <p><?php
		if ($row_inf['klass'] == 1) {?><img src="img/ico/class1.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 2) {?><img src="img/ico/class2.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 3) {?><img src="img/ico/class3.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 4) {?><img src="img/ico/class4.png" width="12" height="12"/><?php }
		?><span class="white"><?php echo $row_inf['name']; ?></span>(
		<span class="bonus"><?php echo $row['need_lvl'];?> ур,</span><?php if ($row['privat'] == 0) { echo " новый";}
	if ($row['privat'] == 1) { echo " личный";}?>)</p>
        <p><img src="img/ico/shield.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat2'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat2'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat2'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat2'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Броня: <span class="white"><?php echo $row['stat2'];?></span></p>
        <p> <img src="img/ico/life.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat1'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat1'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat1'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat1'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?>Здоровье: <span class="white"><?php echo $row['stat1'];?></span></p>
      
	  <p><img src="img/ico/shield.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat3'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat3'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat3'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat3'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Прочность: <span class="white"><?php echo $row['stat3'];?></span></p>
	  <p><img src="img/ico/goodrad.png" alt="н"/><?php
		if ($row['upgrade_speed'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_speed'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_speed'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_speed'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Рад.защита: <span class="white"><?php echo $row['speed'];?></span></p>
	 <p><img src="img/ico/profile.png" alt="н" width="12" height="12"/>Владелец: <span class="white">
	  <?php 
 $g=$row_user['gruppa'];
 if($g=='dolg'){$gruppa='<img src="/img/ico/dolg.png" height="12" width="12"/>';}elseif($g=='naemniki'){$gruppa='<img src="/img/ico/odinochkion.png" height="12" width="12"/>';}elseif($g=='svoboda'){$gruppa='<img src="/img/ico/svoboda.png" height="12" width="12"/>';}
$last_active = $row_user['last_active'];$last_active = strtotime("$last_active");$now = (date("Y-m-d H:i:s"));$now = strtotime("$now");$ont = ($now - $last_active);
if($ont<300){$onl='<img src="/img/ico/on.png" height="12" width="12"/>';}else{$onl='<img src="/img/ico/off.png" height="12" width="12"/>';}
?>
 	  <?php echo $onl;?><?php echo $gruppa;?><a  class="white" href="profile.php?id=<?php echo "$user_set"?>"><?php echo $row_user['nick'];?></a></span></p>
	  
	 
<?php
}
//////////////////////////////////////Конец БРОНИ

/////////////////////////////////////Начало пистолета\
if ($type == 2) {
?>
<table width="190" border="0" cellpadding="0" cellspacing="0">
      <tbody>
      <tr>
      <td width="54" valign="top"><img src="img/weapons/<?php echo $row_inf['screen'];?>" alt="Слот №1" /></td>
      <td width="136" valign="top">
  </div>
	  </td>
      </tr>
      </tbody>
      </table>
	  <div class="clothes">
	    <p><?php
		if ($row_inf['klass'] == 1) {?><img src="img/ico/class1.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 2) {?><img src="img/ico/class2.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 3) {?><img src="img/ico/class3.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 4) {?><img src="img/ico/class4.png" width="12" height="12"/><?php }
		?><span class="white"><?php echo $row_inf['name']; ?></span> (<span class="bonus"><?php echo $row['need_lvl'];?> ур,</span><?php if ($row['privat'] == 0) { echo " новый";}
	if ($row['privat'] == 1) { echo " личный";}?>)</p>
        <p> <img src="img/ico/to4nost.png" alt="н"/><?php

		if ($row['upgrade_stat1'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat1'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat1'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat1'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?>Урон: <span class="white"><?php echo $row['stat1'];?></span></p>
        <p><img src="img/ico/to4nost.png" alt="н"/><?php
		if ($row['upgrade_stat2'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat2'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat2'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat2'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Точность: <span class="white"><?php echo $row['stat2'];?></span></p>
      </div>
	  </td>
      </tr>
      </tbody>
      </table>
	  <div class="clothes">
	  		<p><img src="img/ico/to4nost.png" alt="н"/><?php
		if ($row['upgrade_stat3'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat3'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat3'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat3'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Надёжность: <span class="white"><?php echo $row['stat3'];?></span></p>
			<p><img src="img/ico/speed.png" alt="н"/><?php
		if ($row['upgrade_speed'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>-1сек)</span><?php }
		if ($row['upgrade_speed'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>-2сек)</span><?php }
		if ($row['upgrade_speed'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>-3сек)</span><?php }
		if ($row['upgrade_speed'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>-4сек)</span><?php }
		?> Перезарядка: <span class="white"><?php echo $row['speed'];?>сек</span></p>
	<p><img src="img/ico/profile.png" alt="н"/>Владелец: <span class="white">
	  <?php 
 $g=$row_user['gruppa'];
 if($g=='dolg'){$gruppa='<img src="/img/ico/dolg.png" height="12" width="12"/>';}elseif($g=='naemniki'){$gruppa='<img src="/img/ico/odinochkion.png" height="12" width="12"/>';}elseif($g=='svoboda'){$gruppa='<img src="/img/ico/svoboda.png" height="12" width="12"/>';}
$last_active = $row_user['last_active'];$last_active = strtotime("$last_active");$now = (date("Y-m-d H:i:s"));$now = strtotime("$now");$ont = ($now - $last_active);
if($ont<300){$onl='<img src="/img/ico/on.png" height="12" width="12"/>';}else{$onl='<img src="/img/ico/off.png" height="12" width="12"/>';}
?>
 	  <?php echo $onl;?><?php echo $gruppa;?><a  class="white" href="profile.php?id=<?php echo "$user_set"?>"><?php echo $row_user['nick'];?></a></span></p>
	
<?php
}
/////////////////////////////////////Конец пистолета

////////////////////////Автомат НАЧАЛО!!!
if ($type == 3) {
?>	
	<div class="clothes">
	
<img src="img/weapons/<?php echo $row_inf['screen'];?>" alt="Слот №3" width="145" height="50"/>
   <p><?php
		if ($row_inf['klass'] == 1) {?><img src="img/ico/class1.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 2) {?><img src="img/ico/class2.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 3) {?><img src="img/ico/class3.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 4) {?><img src="img/ico/class4.png" width="12" height="12"/><?php }
		?><span class="white"><?php echo $row_inf['name']; ?></span> (<span class="bonus"> <?php echo $row ['need_lvl'];?> ур,</span><?php if ($row['privat'] == 0) { echo " новый";}
	if ($row['privat'] == 1) { echo " личный";}?>)</p>
    <p><img src="img/ico/to4nost.png" alt="н"/><?php
		if ($row['upgrade_stat1'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat1'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat1'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat1'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Урон: <span class="white"><?php echo $row['stat1'];?></span></p>
    <p> <img src="img/ico/to4nost.png" alt="н"/><?php
		if ($row['upgrade_stat2'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat2'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat2'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat2'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?>Точность: <span class="white"><?php echo $row['stat2'];?></span></p>
	<p><img src="img/ico/to4nost.png" alt="н"/><?php
		if ($row['upgrade_stat3'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat3'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat3'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat3'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Надёжность: <span class="white"><?php echo $row['stat3'];?></span></p>
    <p><?php
		if ($row['upgrade_speed'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>-15%)</span><?php }
		if ($row['upgrade_speed'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>-25%)</span><?php }
		if ($row['upgrade_speed'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>-50%)</span><?php }
		if ($row['upgrade_speed'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>-75%)</span><?php }
		?><img src="img/ico/speed.png" alt="н"/> Перезарядка: <span class="white"><?php echo $row['speed'];?>сек</span></p>
	 <p><img src="img/ico/profile.png" alt="н"/> Владелец: <span class="white">
	  <?php 
 $g=$row_user['gruppa'];
 if($g=='dolg'){$gruppa='<img src="/img/ico/dolg.png" height="12" width="12"/>';}elseif($g=='naemniki'){$gruppa='<img src="/img/ico/odinochkion.png" height="12" width="12"/>';}elseif($g=='svoboda'){$gruppa='<img src="/img/ico/svoboda.png" height="12" width="12"/>';}
$last_active = $row_user['last_active'];$last_active = strtotime("$last_active");$now = (date("Y-m-d H:i:s"));$now = strtotime("$now");$ont = ($now - $last_active);
if($ont<300){$onl='<img src="/img/ico/on.png" height="12" width="12"/>';}else{$onl='<img src="/img/ico/off.png" height="12" width="12"/>';}
?>
 	  <?php echo $onl;?><?php echo $gruppa;?><a  class="white" href="profile.php?id=<?php echo "$user_set"?>"><?php echo $row_user['nick'];?></a></span></p>
	  <?php
}
///////////////////////////////
/////////////////////////////////////Начало шлема
if ($type == 4) {
?>
<table width="190" border="0" cellpadding="0" cellspacing="0">
      <tbody>
      <tr>
      <td width="54" valign="top"><img src="img/shlem/<?php echo $row_inf['screen'];?>" alt="Слот №4" width="55" height="55"/></td>
      <td width="136" valign="top">
  </div>
	  </td>
      </tr>
      </tbody>
      </table>
	  <div class="clothes">

	    <p><?php
		if ($row_inf['klass'] == 1) {?><img src="img/ico/class1.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 2) {?><img src="img/ico/class2.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 3) {?><img src="img/ico/class3.png" width="12" height="12"/><?php }
		if ($row_inf['klass'] == 4) {?><img src="img/ico/class4.png" width="12" height="12"/><?php }
		?><span class="white"><?php echo $row_inf['name']; ?></span>(
		<span class="bonus"><?php echo $row['need_lvl'];?> ур,</span><?php if ($row['privat'] == 0) { echo " новый";}
	if ($row['privat'] == 1) { echo " личный";}?>)</p>
        <p><img src="img/ico/shield.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat2'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat2'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat2'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat2'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Броня: <span class="white"><?php echo $row['stat2'];?></span></p>
        <p> <img src="img/ico/life.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat1'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat1'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat1'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat1'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?>Здоровье: <span class="white"><?php echo $row['stat1'];?></span></p>
      
	  <p><img src="img/ico/shield.png" alt="н" width="12" height="12"/><?php
		if ($row['upgrade_stat3'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_stat3'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_stat3'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_stat3'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Прочность: <span class="white"><?php echo $row['stat3'];?></span></p>
	  <p><img src="img/ico/goodrad.png" alt="н"/><?php
		if ($row['upgrade_speed'] == 1) {?><span class="bonus">(<img src="img/ico/class1.png" width="12" height="12"/>+15%)</span><?php }
		if ($row['upgrade_speed'] == 2) {?><span class="bonus">(<img src="img/ico/class2.png" width="12" height="12"/>+25%)</span><?php }
		if ($row['upgrade_speed'] == 3) {?><span class="bonus">(<img src="img/ico/class3.png" width="12" height="12"/>+50%)</span><?php }
		if ($row['upgrade_speed'] >= 4) {?><span class="bonus">(<img src="img/ico/class4.png" width="12" height="12"/>+75%)</span><?php }
		?> Рад.защита: <span class="white"><?php echo $row['speed'];?></span></p>
	 <p><img src="img/ico/profile.png" alt="н" width="12" height="12"/>Владелец: <span class="white">
	  <?php
$g=$row_user['gruppa'];
 if($g=='dolg'){$gruppa='<img src="/img/ico/dolg.png" height="12" width="12"/>';}elseif($g=='naemniki'){$gruppa='<img src="/img/ico/odinochkion.png" height="12" width="12"/>';}elseif($g=='svoboda'){$gruppa='<img src="/img/ico/svoboda.png" height="12" width="12"/>';}
$last_active = $row_user['last_active'];$last_active = strtotime("$last_active");$now = (date("Y-m-d H:i:s"));$now = strtotime("$now");$ont = ($now - $last_active);
if($ont<300){$onl='<img src="/img/ico/on.png" height="12" width="12"/>';}else{$onl='<img src="/img/ico/off.png" height="12" width="12"/>';}
?>
 	  <?php echo $onl;?><?php echo $gruppa;?><a  class="white" href="profile.php?id=<?php echo "$user_set"?>"><?php echo $row_user['nick'];?></a></span></p>
	  
	 
<?php
}
//////////////////////////////////////Конец шлема

if ($row['user_id'] == $_SESSION['id']) {
?>
<div class="zx">
<p class="bonus"><b>[Ваш лот]</b></p>
<p>Ставка: [<span class="white"><img src="img/ico/money.png" width="12" height="12"/> <?php echo $row_lot['price_now']?></span>]</p>
<p>Выкуп: [<span class="white"><img src="img/ico/money.png" width="12" height="12"/> <?php echo $row_lot['price']?></span>]</p>
</div>
<?php
}
else {
?>
<div class="zx">
<?php
$new_price= ($row_lot['price_now']+($row_lot['price_now']*0.10));
$new_price = round($new_price);
if ($row_lot['price'] > $new_price) {
?>
<p>Ставка: [<span class="white"><img src="img/ico/money.png" width="12" height="12"/> <?php echo $row_lot['price_now']?></span>][<img src="img/ico/top.png" width="12" height="12"/> <a href="lot_price.php?type=1&lot=<?php echo "$lot" ?>">повысить до <img src="img/ico/money.png" width="12" height="12"/><?php echo "$new_price"  ?></a>]</p>
<?php
}
?>
<p>Выкуп: [<span class="white"><img src="img/ico/money.png" width="12" height="12"/> <?php echo $row_lot['price']?></span>][<img src="img/ico/money.png" width="12" height="12"/> <a href="lot_price.php?type=2&lot=<?php echo "$lot" ?>">выкупить</a>]</p>
</div>
<?php if ($row_lot['price_user'] == $_SESSION['id']) {?><div class="zx"><p class="bonus">[Ваша ставка]</p></div><?php }
}
?>
</div>

</div>


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

</body>
</html>