<?
if(isset($_GET['sell']) && intval($_GET['sell'])!=NULL && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id` = '".intval($_GET['sell'])."' AND `id_user` = '$ku[id]' AND `id_pet` != '0'"),0)!=0)
{
$petground=mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_petground` WHERE `id` = '".intval($_GET['sell'])."' AND `id_user` = '$ku[id]'"));
$pet=mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_pet` WHERE `id` = '$petground[id_pet]'"));
if(isset($_GET['ok']))
{
mysql_querll("UPDATE `kolhoz_user` SET `money` = '".($ku['money']+($pet['cena']/2))."' WHERE `id` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_petground` SET `id_pet` = '0' WHERE `id` = '$petground[id]'");
header("Location:?mypetfarm&moderate&".passgen());
exit;
}
podtv("?mypetfarm&sell=$petground[id]&ok","?mypetfarm");
include_once 'inc/foot.php';
}
?>