Файл: KOSMOS/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:?myfarm");
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:?myfarm");
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="images/icons/tick.png"> <a href="?myfarm&clean_grounds&ok"><span>
Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="images/icons/cross.png"> <a href="?myfarm"><span>
Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';
}
?>