Файл: test.zfarm.mobi/mystyleuser/watertheplant.php
Строк: 22
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if(isset($_GET['watertheplant']) && num($_GET['watertheplant'])!=NULL && mysql_result(mysql_query("SELECT COUNT(id) FROM `mystyle_farm` WHERE `user` = '".num($user['id'])."' AND `id` = '".num($_GET['watertheplant'])."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_farm` WHERE `id` = '".num($_GET['watertheplant'])."' LIMIT 1"));
if(num($_GET['page']))$page = 'page='.num($_GET['page']).'';
if($post['voda'] < $time){
$rat = 5;
$avatar = 0;
$mozgi_exp_sql = 0;
if(isset($mozgi_exp))$mozgi_exp_sql=(($rat/100)*200);
if(isset($user['avatar_exp']))$avatar=(($rat/100)*$user['avatar_exp']);
$rat_user = $avatar+$mozgi_exp_sql;
if($rat_user==0)$rat=$rat;
else $rat=$rat_user;
$rtime = $time+1800;
$voda = $post['voda']+$rtime;
$time_all = $post['time']-1800;
mysql_query("UPDATE `mystyle_farm` SET `voda` = '".$voda."', `time` = '".$time_all."' WHERE `id` = '".$post['id']."' AND `user` = '".$user['id']."' LIMIT 1");
//////////////////////////////////////////////////////////////////
include_once 'mystylecollect/mystylecollectionsrand.php';
//////////////////////////////////////////////////////////////////
///////// Лог Пользователя ///// By MyStyle
$text = 'Успешно полито.';
$_SESSION['msg'] = $text;
$re2 = $user['rating']+$rat;
mysql_query("UPDATE `mystyle_user` SET `rating` = '".$re2."' WHERE `id` = '".$user['id']."' LIMIT 1");
header("Location: ./?$page");
exit;
}else{
$text = 'Рано поливать.';
$_SESSION['msg'] = $text;
header("Location: ./?$page");
exit;
}
}else{
$text = 'Ощибка доступа';
$_SESSION['msg'] = $text;
header("Location: ./?$page");
exit;
}
?>