<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">

<head><meta http-equiv='content-type' content='application/xhtml+xml; charset=windows-1251'/>
<link rel="shortcut icon" href="ico.ico" type="image/x-icon" />
<title></title>
<link rel="stylesheet" href="../styleN.css" type="text/css" />
</head>
<body>


<?
$ruda = $_GET['ruda'];
$Rco = $_GET['Rco'];
echo"<img src=\"img/al.png\" alt=\"c\" width=\"10\" height=\"10\"> <a href=\"game.php\"> </a><br/><img src=\"img/fred.jpeg\">";
echo'<br/><b>
 o poa ee p  e oo,       ec e   . 
H  ec pece p, o   e  .</b><br/>';
$ruda3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");
$use22=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$use44=mysql_fetch_assoc($use22);
$rud=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");


if(mysql_num_rows($ruda3)<1 AND isset($Rco)){echo"<div class=\"main_title\"><center><font color=\"red\"><img src=\"img/bad.png\">      </font></center></div>";}
if(mysql_num_rows($ruda3)>0 AND isset($ruda) OR isset($Rco)){
$ruda44=mysql_fetch_assoc($ruda3);
if($ruda44[IL_COUNT]>1){

echo"";
if($Rco==0 AND isset($Rco)){echo"<div class=\"main_title\" style=\"background:black\"><center><font color=\"red\"><img src=\"img/bad.png\"> -     0</font></center></div>";}
if($Rco>$ruda44[IL_COUNT] AND isset($Rco)){echo"<div class=\"main_title\" style=\"background:black\"><center><font color=\"red\"><img src=\"img/bad.png\">     </font></center></div>";}
if($Rco<=$ruda44[IL_COUNT] AND isset($Rco) AND $Rco>0){
echo"<div class=\"main_title\" style=\"background:black\"><center><img src=\"img/success.png\"><font color=\"white\">    $Rco   ".round($Rco*3)." </font></center></div>";
if($Rco==$ruda44[IL_COUNT]){$delRud=mysql_query("DELETE FROM inv WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");
$monPLu2=$use44[money]+($Rco*3);
$monPLu=mysql_query("UPDATE users SET money=\"$monPLu2\" WHERE NICK=\"$_SESSION[s]\"");
}
if($Rco<$ruda44[IL_COUNT]){
$rudCOU=$ruda44[IL_COUNT]-$Rco;
$rudcou2=mysql_query("UPDATE inv SET IL_COUNT=\"$rudCOU\" WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");
$monPLu2=$use44[money]+($Rco*3);
$monPLu=mysql_query("UPDATE users SET money=\"$monPLu2\" WHERE NICK=\"$_SESSION[s]\"");
}

}

echo"
</center>";

}
if($ruda44[IL_COUNT]<2 AND mysql_num_rows($ruda3)>0){echo"<div class=\"main_title\"><center><b>  :$ruda44[IL_COUNT]</b>";
if($Rco<=$ruda44[IL_COUNT] AND isset($Rco) AND $Rco>0){
echo"<div class=\"main_title\" style=\"background:black\"><center><img src=\"img/success.png\"><font color=\"white\">    $Rco   ".round($Rco/3)." </font></center></div>";
if($Rco==1){
$delRud=mysql_query("DELETE FROM inv WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");
$monPLu2=$use44[money]+($Rco*10);
$monPLu=mysql_query("UPDATE users SET money=\"$monPLu2\" WHERE NICK=\"$_SESSION[s]\"");
 print('<SCRIPT>location.href="game.php?speak=fred&id=fr_trade";</SCRIPT>');
}
}


}
}
if($ruda=='sell'){
if(mysql_num_rows($rud)>=0){
echo"<font color=\"red\">    ?</font><br/>
<a href=\"game.php?speak=fred&id=fr_trade&ruda=sell&Rco=10\">10   30 </a>
<a href=\"game.php?speak=fred&id=fr_trade&ruda=sell&Rco=100\">100  = 300 </a>
<a href=\"game.php?speak=fred&id=fr_trade&ruda=sell&Rco=500\">500  = 1500 </a>
<a href=\"game.php?speak=fred&id=fr_trade&ruda=sell&Rco=1000\">1000  = 3000 </a>
<a href=\"game.php?speak=fred&id=fr_trade&ruda=sell&Rco=5000\">5000  = 15000 </a> ";}
}
echo"
<li><a href=\"game.php?speak=$speak&id=fr_buy\"><img src=\"img/chat.png\" height=\"10\" width=\"10\"> Oo, oa co oap</a></li>
<li><a href=\"game.php?speak=$speak&id=fr_trade&ruda=sell\"><img src=\"img/chat.png\" height=\"10\" width=\"10\">  e ec pa a poa</a></li>
<li><a href=\"game.php?speak=$speak&id=fr_a_kuznec\"><img src=\"img/chat.png\" height=\"10\" width=\"10\">    </a></li>
<li><a href=\"game.php?speak=$speak&id=fr_a_gorn\"><img src=\"img/chat.png\" height=\"10\" width=\"10\">    </a></li>
<li><a href=\"game.php?speak=$speak&id=fr_end\"><img src=\"img/chat.png\" height=\"10\" width=\"10\"> ,</a></li>
";
?>
	 </div></div>
<div class="line"></div>
<div class='main_foot'><div class=center><div class=grey><div class=small><div class=foot><a href=pvp.php?r=381966></a> | <a href=forum.php></a> | <a href=lib.php?cat=rules></a> | <a href=lib.php></a> | <a href=support.php></a></div></div><div class='foot_margin'></div><div class=smallest><?echo date("H:i");?> <br/><div class='min_margin'></div>&copy; 2013 <u> </u></div></div></div></div></div>

	 <?
die;

?>
