Файл: test.zfarm.mobi/mystylepostr/2.php
Строк: 61
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if($user['postroyki2'] == 2){}else{
header("Location: ./");
exit;
}
echo '<div class="feedbackPanel">Слоник за монеты</div>';
$oil = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_slonik` WHERE `user` = '".$user['id']."'"));
if(isset($_GET['Start']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_slonik` WHERE `user` = '".$user['id']."'"),0)<1){
$time_rand = rand(3600,10000);
$time_oil = $time+$time_rand;
$money = rand(100,5000);
$img_rand = rand(1,4);
if($img_rand = 1)$img_slonik = 'm_real_chest_03.png';
if($img_rand = 2)$img_slonik = 'm_real_chest_04.png';
if($img_rand = 3)$img_slonik = 'm_real_chest_01.png';
if($img_rand = 4)$img_slonik = 'm_real_chest_02.png';
mysql_query("INSERT INTO `mystyle_slonik` SET `time` = '".$time_oil."', `money` = '".$money."', `img` = '".$img_slonik."', `user` = '".$user['id']."'");
header("Location: ?link2");
exit;
}
if(isset($_GET['link2']) && num($_GET['link2'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_slonik` WHERE `id` = '".num($_GET['link2'])."' AND `user` = '".$user['id']."' AND `time` <= '".$time."'LIMIT 1"),0)!=0){
$oil = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_slonik` WHERE `id` = '".num($_GET['link2'])."' AND `user` = '".$user['id']."' AND `time` <= '".$time."'LIMIT 1"));
$money = $user['money']+$oil['money'];
mysql_query("UPDATE `mystyle_user` SET `money` = '".$money."' WHERE `id` = '".$user['id']."' LIMIT 1");
mysql_query("DELETE FROM `mystyle_slonik` WHERE `id` = '".$oil['id']."' AND `user` = '".$user['id']."'");
$text = 'Слоник нашёл '.$oil['money'].' монет';
$_SESSION['msg'] = $text;
header("Location: ?link2");
exit;
}
echo '<img class="portrait pt6 pl6 pr6 center kartinki_div" width="60" height="60" src="images/postroyki/m_elephant.png" alt="" />';
if($oil['user'] == 0)
{
echo '<br /><tr><a href="?link2&Start" class="btnp">Попросить слоника найти клад!</a></tr>';
}else{
if($oil['time'] < time()){
echo '<br /><tr><img width="60" height="60" src="images/syndyki/'.$oil['img'].'" alt="" /><a href="?link2='.$oil['id'].'" class="btnp">Открыть сундук</a></tr>';
}else{
echo '<li class="btnp">Слоник отправился в поиски клада.</li>';
echo '<li class="btnp">Вернётся через: '.time_left($oil['time']-$time).'</li>';
}
}
echo '<div style="clear:both"></div>';
?>