Файл: gamele.ru/inc/sell.php
Строк: 35
<?php
$GetItem = mysql_fetch_assoc(mysql_query("SELECT * FROM `invent` WHERE `id_item` = '".intval($_GET['uid'])."' and `pl_id` = '".$player['id']."' and `dprice` = '0' and `ddprice` = '0' LIMIT 1;"));
if(!empty($GetItem['id_item'])){
if($player['level']<5){
$licen=1;
}elseif(!empty($ITEM['gift'])){
$licen=0.45;
}else{
$licen=0.6;
}
$QueryLic = mysql_query("SELECT * FROM `licens` WHERE `time`>'".time()."' AND (`lic`='10' OR `lic`='11' OR `lic`='12' OR `lic`='13') AND `uid` = '".$player['id']."'");
$TradeLic = '';
$TradeGRLic = '';
while($GetLic = mysql_fetch_assoc($QueryLic)){
if($GetLic['lic'] == '11'){
$TradeLic .= 1;
}
if($GetLic['lic'] != '11'){
$TradeGRLic .= 1;
}
}
if(mysql_num_rows($QueryLic)>0){
if(!empty($TradeLic)){
$licen=0.99;
}
if(!empty($TradeGRLic) and empty($TradeLic)){
$licen=0.77;
}
}
$price = round((($GetItem['price']*$licen)/$GetItem['dolg'])*($GetItem['dolg']-$GetItem['iznos']),2);
mysql_query("DELETE FROM `invent` WHERE `id_item` = '".$GetItem['id_item']."' and `pl_id` = '".$player['id']."' LIMIT 1;");
mysql_query("UPDATE `user` SET `nv`= nv+".$price." WHERE `id` = '".$player['id']."' LIMIT 1;");
mysql_query("UPDATE `items` SET `count` = count+1 WHERE `id` = '".$GetItem['protype']."' AND `market` = '".$player['loc']."' LIMIT 1;");
$msg="<b><font class=nickname><font color=#cc0000>Вы удачно продали "".$GetItem['ItemName']."" за ".round((($GetItem['price']*$licen)/$GetItem['dolg'])*($GetItem['dolg']-$GetItem['iznos']),2)." ER!</font></font></b>";
pvu_logs($player['id'],"8",getIP(),"|".getIP()."|".(($GetItem['gift'])?$GetItem['gift']:'Не подарок')."|".$GetItem['price']."|".($GetItem['dolg']-$GetItem['iznos'])."|".$GetItem['dolg']."|".$GetItem['ItemName']);
}
?>