<?
if(isset($_GET['sell']) && intval($_GET['sell'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_prud` WHERE `id` = '".intval($_GET['sell'])."' AND `id_user` = '$ku[id]' AND `id_fish` != '0'"),0)!=0)
{
$prud=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_prud` WHERE `id` = '".intval($_GET['sell'])."' AND `id_user` = '$ku[id]'"));
$fish=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_fish` WHERE `id` = '$prud[id_fish]'"));
if(isset($_GET['ok']))
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+($fish['cena']/2))."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_prud` SET `id_fish` = '0' WHERE `id` = '$prud[id]'");
header("Location:?myprud&moderate&".passgen());
exit;
}
podtv("?myprud&sell=$prud[id]&ok","?myprud");
include_once 'inc/foot.php';
}
?>