<?
$IT= $_GET['IT'];
$itemSEL=mysql_query("SET NAMES cp1251");
$itemSEL=mysql_query("SELECT * FROM inv WHERE IL_ALL_CLASS=\"armor\" AND ID_USERS=\"$_SESSION[s]\" AND IL_NO!=\"1\" AND IL_COUNT>0");
$itemSEL99=mysql_query("SELECT * FROM inv WHERE IL_ALL_CLASS=\"armor\" AND ID_USERS=\"$_SESSION[s]\" AND IL_NO!=\"1\" AND IL_COUNT>0");

echo"<a href=\"game.php\"> в игру</a>";
if(mysql_num_rows($itemSEL99)<1){echo'у вас нет не одного предмета';die;}
$itemsFET2=mysql_fetch_assoc($itemSEL);
$itemID=mysql_query("SET NAMES cp1251");
$itemID2=mysql_query("SELECT * FROM inv WHERE ID_IL=\"$IT\" AND IL_ALL_CLASS=\"armor\" AND ID_USERS=\"$_SESSION[s]\" AND IL_NO!=\"1\" AND IL_COUNT>0");

while($itemsFET=mysql_fetch_assoc($itemSEL99)){
if(!isset($IT)){
$mUs=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$mUs2=mysql_fetch_assoc($mUs);





if(mysql_num_rows($itemSEL99)>0){
$ENDcos=round($itemsFET[IL_COST]/5);
echo '<center>'.$itemsFET[IL_NAME].' за:'.$ENDcos;

echo"<a href=\"game.php?speak=karter&id=karter_sell&IT=$itemsFET[ID_IL]\">продать</a></center><br/>";


}
die;
}
}
if(mysql_num_rows($itemID2)>0 AND isset($IT)){
$ENDcos=round($itemsFET2[IL_COST]/5);
echo"вы успешно продали $itemsFET2[IL_NAME] за $ENDcos";
$ENDCo=$mUs2[money]+$ENDcos;
$updMON=mysql_query("UPDATE users SET money=\"$ENDCo\" WHERE NICK=\"$_SESSION[s]\"");
$delINV=mysql_query("DELETE FROM inv WHERE ID_IL=\"$IT\" AND ID_USERS=\"$_SESSION[s]\"");

die;
}
?>