<?
if(isset($_GET['clean_sad']) && isset($_GET['ok']))
{
if($ku['time_cp3']>$time)
{
$cena=$ku['count_cp3']*10;
if($ku['rubies']<$cena)
{
$_SESSION['no_rubies']=$cena-$ku['rubies'];
header("Location:?mygarden");
exit;
}
}
mysql_querll("UPDATE `kolhoz_sad` SET `id_tree` = '0', `plug` = '0', `time` = '$time' WHERE `id_user` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_user` SET `last_tree` = '0', `last_soil3` = '0', `count_cp3` = '".($ku['count_cp3']+1)."', `time_cp3` = '".($time+(3600*24))."'".($ku['time_cp3']>$time?", `rubies` = '".($ku['rubies']-$cena)."'":null)." WHERE `id` = '$ku[id]'");
$_SESSION['cp']=1;
header("Location:?mygarden");
exit;
}
elseif(isset($_GET['clean_sad']))
{
echo '<div class="event"><h1>Подтверждение</h1></div><div class="content"><ul class="block"><li><span class="title">Вы уверены?</span></li><li class="pt"><img alt="" width="16" height="16" src="img/icons/tick.png"> <a href="?mygarden&clean_sad&ok"><span>
Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="img/icons/cross.png"> <a href="?mygarden"><span>
Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';
}
?>