<!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>



<?
$r=$_GET['r'];
$idT=$_GET['idT'];
echo"<a href=\"game.php\"><img src=\"img/al.png\" alt=\"c\" width=\"16\" height=\"16\">  </a><br/><img src=\"img/fred.jpeg\">";
echo"<br/><sup><font color=\"red\">
        1</font></sup><br/>
<b><center><div class=\"top\"><font color=\"white\">    :</font></div></center></b>
";
$inv=mysql_query("SET NAMES cp1251");
$inv=mysql_query("SELECT * FROM inv WHERE ID_USERS=\"$_SESSION[s]\" AND IL_MAX_PROCH>IL_MIN_PROCH AND IL_MAX_PROCH>0");
while($inv2=mysql_fetch_assoc($inv)){
echo"<font color=\"black\">$inv2[IL_NAME]</font><br/>
<img src=\"$inv2[IL_IMAGE]\" alt=\"+\"> 
<br/><b>:$inv2[IL_MIN_PROCH]/$inv2[IL_MAX_PROCH]
<br> :".round($inv2[IL_COST]/$inv2[IL_MAX_PROCH])*($inv2[IL_MAX_PROCH]-$inv2[IL_MIN_PROCH])." </b>
<a href=\"game.php?NICK=$_SESSION[s]&pass=$pass&speak=fred&id=fr_repair&r=repair&idT=$inv2[ID_IL]\"></a></font><br/>";
}
if($r=='repair'){
$mon=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$mon2=mysql_fetch_assoc($mon);
$cos=mysql_query("SELECT * FROM inv WHERE ID_IL=\"$idT\" AND ID_USERS=\"$_SESSION[s]\"");
$cos2=mysql_fetch_assoc($cos);
$mm=round($cos2[IL_COST]/$cos2[IL_MAX_PROCH])*($cos2[IL_MAX_PROCH]-$cos2[IL_MIN_PROCH]);
if($cos2[IL_MIN_PROCH]==$cos2[IL_MAX_PROCH]){
echo"<div class=\"main_title\"><center><font color=\"red\"><img src=\"img/bad.png\">     </font></center></div>";
?>
</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;}
if($mon2[money]<$mm){echo"<div class=\"main_title\"><center><font color=\"red\"><img src=\"img/bad.png\">     </font></center></div>";}
if($mon2[money]>=$mm){
$PROCH=$cos2[IL_MAX_PROCH]-1;
$monM=$mon2[money]-$mm;
$rep=mysql_query("UPDATE inv SET IL_MIN_PROCH=\"$PROCH\",IL_MAX_PROCH=\"$PROCH\" WHERE ID_IL=\"$idT\" AND ID_USERS=\"$_SESSION[s]\"");
$moneyM=mysql_query("UPDATE users SET money=\"$monM\" WHERE NICK=\"$_SESSION[s]\"");
echo"<div class=\"main_title\"><img src=\"img/success.png\">   </font></div>";
}}
echo"<div class=\"menu\"><li></li><li><a href=\"game.php?speak=fred\"><img src=\"img/chat.png\" height=\"16\" width=\"16\"><b>      </b></a></li></div>";
?>

</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;

?>
