Файл: ferma/inc/clean_grounds.php
Строк: 37
<?
if(isset($_GET['clean_grounds']) && isset($_GET['ok']))
{
if($ku['time_cp']>$time)
{
$cena=$ku['count_cp']*10;
if($ku['rubies']<$cena)
{
$_SESSION['no_rubies']=$cena-$ku['rubies'];
header("Location:?farm");
exit;
}
}
mysql_query("UPDATE `kolhoz_ground` SET `id_plant` = '0', `cultivator` = '0', `time` = '$time' WHERE `id_user` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `last_plant` = '0', `last_soil` = '0', `count_cp` = '".($ku['count_cp']+1)."', `time_cp` = '".($time+(3600*24))."'".($ku['time_cp']>$time?", `rubies` = '".($ku['rubies']-$cena)."'":null)." WHERE `id` = '$ku[id]'");
$_SESSION['cp']=1;
header("Location:?farm");
exit;
}
elseif(isset($_GET['clean_grounds']))
{
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="i/icons/tick.png"> <a href="?farm&clean_grounds&ok"><span>
Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="i/icons/cross.png"> <a href="?farm"><span>
Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';
}
?>