<?
if(isset($_GET['sell']) && intval($_GET['sell'])!=NULL && mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_treeground` 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_treeground` WHERE `id` = '".intval($_GET['sell'])."' AND `id_user` = '$ku[id]'"));
$pet=mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_tree` 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_treeground` SET `id_pet` = '0' WHERE `id` = '$petground[id]'");
header("Location:?mytreefarm&moderate&".passgen());
exit;
}
podtv("?mytreefarm&sell=$petground[id]&ok","?mytreefarm");
include_once 'inc/foot.php';
}
?>