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

  header('location: /');
    
exit;

}

  $maneken = mysql_query('SELECT * FROM `maneken` WHERE `user` = "'.$user['id'].'"');
  $maneken = mysql_fetch_array($maneken);

  if(!$maneken) {
    
    mysql_query('INSERT INTO `maneken` (`user`) VALUES ("'.$user['id'].'")');
  
  }
  
    $title = 'Примерочная';    

include './system/h.php';  

?>

<div class='title'><?=$title?></div>
 <div class='line'></div>

<?

$quality = _string(_num($_GET['quality']));

if(!$quality) {

    if($user['skill'] > 0) {


?>

<div class='content'>
  <img src='/images/icon/quality/1.png'/> <a href='/maneken.php?quality=1'><font color="#6c3">Обычные вещи</font></a><br/>
  <small>Требуется 1 мастерства</small>
</div>
 <div class='line'></div>

<?

    }

?>

<?

    if($user['skill'] > 9) {


?>

<div class='content'>
  <img src='/images/icon/quality/2.png'/> <a href='/maneken.php?quality=2'><font color="#69c">Редкие вещи</font></a><br/>
  <small>Требуется 10 мастерства</small>
</div>
 <div class='line'></div>

<?

    }

?>


<?

    if($user['skill'] > 23) {


?>

<div class='content'>
  <img src='/images/icon/quality/3.png'/> <a href='/maneken.php?quality=3'><font color="#c6f">Эпические вещи</font></a><br/>
  <small>Требуется 24 мастерства</small>
</div>
 <div class='line'></div>

<?

    }

?>

<?

    if($user['skill'] > 47) {


?>

<div class='content'>
  <img src='/images/icon/quality/4.png'/> <a href='/maneken.php?quality=4'><font color="#f60">Легендарные вещи</font></a><br/>
  <small>Требуется 48 мастерства</small>
</div>
 <div class='line'></div>

<?

    }
    
?>

<?

    if($user['skill'] > 199) {


?>

<div class='content'>
  <img src='/images/icon/quality/5.png'/> <a href='/maneken.php?quality=5'><font color="#999">Божественные вещи</font></a><br/>
  <small>Требуется 200 мастерства</small>
</div>
 <div class='line'></div>

<?

    }

?>

<div class='list'>
  <li class='no_b'><a href='/shop.php'><img src='/images/icon/equip.png' alt='*'/> Магазин снаряжения</a></li>
</div>

<?
   
}
else
{

    if($quality == 1 && $user['skill'] < 1 OR $quality == 2 && $user['skill'] < 10 OR $quality == 3 && $user['skill'] < 24 OR $quality == 4 && $user['skill'] < 48 OR $quality == 5 && $user['skill'] < 200) {
    
      header('location: /maneken.php');
    
    exit;
    
    }

  $w = _string(_num($_GET['w']));

  if($w) {



  }
  else
  {

?>

<div class='content' align='center'>

<img src='/manekenImage.php?g=<?=$user['sex']?>&w_1=<?=$maneken['w_1']?>&w_2=<?=$maneken['w_2']?>&w_3=<?=$maneken['w_3']?>&w_4=<?=$maneken['w_4']?>&w_5=<?=$maneken['w_5']?>&w_6=<?=$maneken['w_6']?>&w_7=<?=$maneken['w_7']?>&w_8=<?=$maneken['w_8']?>' alt='*'/>

</div>


<div class='list'>
  <li class='no_b'></li>
</div>


<?

  }

}

include './system/f.php';

?>