Файл: zfarm.mobi/inc/center/lottery.php
Строк: 304
<?
$title='Лотерея';
include_once '../system/config.php';
if($ku['level']<35)
{
echo "<div class='content'>";
echo "<div class='div'>";
echo 'Так просто ты тут ни чего не узнаешь. Попробуй найти того, кто тебе объяснит.';
include_once '../system/foot.php';
echo "</div></div>";
}
$lottery = mysql_fetch_array(mysql_query("SELECT * FROM `lottery_user` WHERE `id_user` = '$ku[id]'"));
$cena = $lottery['money']-($lottery['level_money']*1000000);
if($lottery['level_money']<10)$LevelMoney=15;
if($lottery['level_money']>9)$LevelMoney=30;
$cenaExp = $lottery['exp']+($lottery['level_exp']*500000);
if($lottery['level_exp']<10)$LevelExp=15;
if($lottery['level_exp']>9)$LevelExp=50;
if(isset($_GET['cena']) && ($lottery['level_money']<=20))
{
if(isset($_GET['ok']) && ($ku['rubies']>=$lottery['level_money']*$LevelMoney))
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$lottery['level_money']*$LevelMoney)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery_user` SET `money` = '".($lottery['money']-$lottery['level_money']*1000000)."', `level_money` = `level_money` + '1' WHERE `id_user` = '$ku[id]'");
header("Location:/lottery");
}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>Уменьшение цены</div><div class='div'>";
echo'Вы уменьшаете цену до <img src="/img/icons/money.png" alt="o"> '.strkol($cena).'<br> Стоимость: <img src="/img/icons/ruby.png" alt="o">'.($lottery['level_money']*$LevelMoney).'';
echo'<div style="margin-top:4px"></div>';
echo'<img src="/img/icons/tick.png"> <a href="/lottery/cena/ok">Да, подтверждаю</a>';
echo'<br><img src="/img/icons/cross.png"> <a href="/lottery/">Нет, отказываюсь</a>';
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
echo "</div>";
}
if(isset($_GET['exp']) && ($lottery['level_exp']<=20))
{
if(isset($_GET['ok']) && ($ku['rubies']>=$lottery['level_exp']*$LevelExp))
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$lottery['level_exp']*$LevelExp)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery_user` SET `exp` = '".($lottery['exp']+$lottery['level_exp']*500000)."', `level_exp` = `level_exp` + '1' WHERE `id_user` = '$ku[id]'");
header("Location:/lottery");
}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>Увеличение опыта</div><div class='div'>";
echo'Вы увеличиваете опыт до <img src="/img/icons/experience.png" alt="o"> '.rating($cenaExp).'<br> Стоимость: <img src="/img/icons/ruby.png" alt="o">'.($lottery['level_exp']*$LevelExp).'';
echo'<div style="margin-top:4px"></div>';
echo'<img src="/img/icons/tick.png"> <a href="/lottery/exp/ok">Да, подтверждаю</a>';
echo'<br><img src="/img/icons/cross.png"> <a href="/lottery/">Нет, отказываюсь</a>';
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
echo "</div>";
}
if(isset($_GET['start']))
{
$money=$lottery['money'];
if($ku['money']>=$money)
{
$random=rand(0,10000);
$RandomRating=rand(0,1000);
if($RandomRating<800)
{
$rating=$lottery['exp'];
}
if($RandomRating<970 && $RandomRating>800)
{
$rating=$lottery['exp']*2;
}
if($RandomRating<1000 && $RandomRating>970)
{
$rating=$lottery['exp']*10;
}
$rat=$rating;
$rat_drakon_act=0;
$rat_school_act=0;
$rat_lib_act=0;
if(isset($drakon_act))$rat_drakon_act=(($rat/100)*300);
if(isset($school_act))$rat_school_act=$rat*2;
if(isset($lib_act))$rat_lib_act=$rat/2;
$rat=$rat_drakon_act+$rat_medal+$rat_school_act+$rat_lib_act+$rat;
$rating=$rat;
$ku['money']=minus_money($money);
$ku['rating']=plus_rating($rating);
update_mc($rat);
if(isset($pme))$ku['money']=money_plus($pm);
//////////////////Выигрыш бонусов и вертов
if($random<100)
{
$timee=3600;
mysql_query("UPDATE `kolhoz_user` SET `time_shmel` = '".($ku['time_shmel']>$time?"".($ku['time_shmel']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$shmel=1;
}
if($random<200 && $random>100)
{
$timee=3600;
mysql_query("UPDATE `kolhoz_user` SET `time_yastreb` = '".($ku['time_yastreb']>$time?"".($ku['time_yastreb']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$yastreb=1;
}
if($random<300 && $random>200)
{
$timee=3600;
mysql_query("UPDATE `kolhoz_user` SET `time_drakon` = '".($ku['time_drakon']>$time?"".($ku['time_drakon']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$drakon=1;
}
if($random<400 && $random>300)
{
$timee=3600;
mysql_query("UPDATE `kolhoz_user` SET `scarecrow_time` = '".($ku['scarecrow_time']>$time?"".($ku['scarecrow_time']+$timee)."":"".($time+$timee)."")."' WHERE `id` = '$ku[id]'");
$scarerow=1;
}
if($random<1400 && $random<1300)
{
$timee=3600;
mysql_query("UPDATE `kolhoz_user` SET `hydropinics_time` = '".($ku['hydropinics_time']>$time?"".($ku['hydropinics_time']+$timee)."":"".($time+$timee)."")."', `hydropinics_type` = '400' WHERE `id` = '$ku[id]'");
$rhpe=1;
}
//////////////////Выигрыш рубинов колхозу
if($random<500 && $random>400 && $mc)
{
mysql_query("INSERT INTO `kolhoz_collective_cash` SET `id_user` = '$ku[id]', `id_collective` = '$mc[id]', `type` = 'rubies', `time` = '$time', `count` = '20'");
mysql_query("UPDATE `kolhoz_collective` SET `rubies` = '".($mc['rubies']+20)."' WHERE `id` = '$mc[id]'");
$CollectiveRubies20=1;
}
if($random<550 && $random>500 && $mc)
{
mysql_query("INSERT INTO `kolhoz_collective_cash` SET `id_user` = '$ku[id]', `id_collective` = '$mc[id]', `type` = 'rubies', `time` = '$time', `count` = '1000'");
mysql_query("UPDATE `kolhoz_collective` SET `rubies` = '".($mc['rubies']+1000)."' WHERE `id` = '$mc[id]'");
$CollectiveRubies1000=1;
}
if($random<600 && $random>550 && $mc)
{
mysql_query("INSERT INTO `kolhoz_collective_cash` SET `id_user` = '$ku[id]', `id_collective` = '$mc[id]', `type` = 'rubies', `time` = '$time', `count` = '2000'");
mysql_query("UPDATE `kolhoz_collective` SET `rubies` = '".($mc['rubies']+2000)."' WHERE `id` = '$mc[id]'");
$CollectiveRubies2000=1;
}
//////////////////Выигрыш рубинов игроку
if($random<700 && $random>600)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+10)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +5 WHERE `id` = '1'");
$UserRubies10=1;
}
if($random<800 && $random>700)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+100)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +50 WHERE `id` = '1'");
$UserRubies100=1;
}
if($random<4950 && $random>4900)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+1000)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +500 WHERE `id` = '1'");
$UserRubies1000=1;
}
if($random<1500 && $random>1400)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+500)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +250 WHERE `id` = '1'");
$UserRubies500=1;
}
if($random<2000 && $random>1800)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+50)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +25 WHERE `id` = '1'");
$UserRubies50=1;
}
if($random<6500 && $random>6450)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+2000)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +1000 WHERE `id` = '1'");
$UserRubies2000=1;
}
if($random<5900 && $random>5890) /// max 200 к рандому
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+5000)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +2500 WHERE `id` = '1'");
$UserRubies5000=1;
}
if($random<3300 && $random>3295)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+10000)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = `JackPot` +5000 WHERE `id` = '1'");
$UserRubies10000=1;
}
if($random<5000 && $random>4997)
{
$result = mysql_query("SELECT * FROM `lottery` WHERE `id` = '1' ORDER BY `time` DESC LIMIT 10000000000");
while($msg = mysql_fetch_assoc($result))
$rubiesi=($msg['JackPot']);
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+$rubiesi)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `lottery` SET `JackPot` = '0' WHERE `id` = '1'");
$JackPotRand=1;
}
echo "<div class='feedback'><img src='/img/icons/experience.png' alt='o'> Опыт <span>".rating($rat)."</span></div>";
}
else
{
$_SESSION['msg']='Недостаточно монет';
header("Location:/lottery");
}
}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>Лотерея ''Спринт''</h2></div>";
echo "<div class='content'><div class='block'>";
$result = mysql_query("SELECT * FROM `lottery` WHERE `id` = '1' ORDER BY `time` DESC LIMIT 10000000000");
while($msg = mysql_fetch_assoc($result)){
echo 'Джекпот: <span ><img src="/img/icons/ruby.png">'.($msg['JackPot']).'</span><br></div>';
echo "<div class='block'>";
}
echo "<ul><li><img src='/img/icons/ticket.png' alt='o'>
<a href='/lottery/start/'>Купить билет </a> <span><img src='/img/icons/money.png' alt='o'> <span color='yellow'>".strkol($lottery['money'])."</span></span>
</li>";
if($lottery['level_money']<=20)echo "<li> <a href='/lottery/cena/'>Уменьшить цену</a> до <img src='/img/icons/money.png' alt='o'> ".strkol($cena)."</span>
</li>";
if($lottery['level_exp']<=20)echo "<li> <a href='/lottery/exp/'>Увеличить мин.опыт</a> до <img src='/img/icons/experience.png' alt='o'> ".rating($cenaExp)."</span>
</li>";
if(isset($_GET['start']) && ($ku['money']>=$money))
{
echo "<br><li class='n pt'>Ваш выигрыш:</li>";
echo "<li><span><ul>";
echo "<li><span><img src='/img/icons/experience.png' alt='o'> <span color='yellow'>".rating($rating)."</span><span class='minor'> (<span>$rating</span>)</span></span></li>";
if(isset($pme))echo "<li><span><img src='/img/icons/money.png' alt='o'> <span color='yellow'>$pm</span></li>";
if(isset($UserRubies10))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>10</span></li>";
if(isset($UserRubies50))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>50</span></li>";
if(isset($UserRubies100))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>100</span></li>";
if(isset($UserRubies500))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>500</span></li>";
if(isset($UserRubies1000))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>1'000</span></li>";
if(isset($UserRubies2000))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>2'000</span></li>";
if(isset($UserRubies5000))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>5'000</span></li>";
if(isset($UserRubies10000))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>10'000</span></li>";
if(isset($JackPotRand))echo "<li><span><img src='/img/icons/ruby.png' alt='o'> Джекпот ".$msg['JackPot']."</li>";
if(isset($CollectiveRubies1000))echo "<li><span>В колхозную кассу от вашего имени добавляется <img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>1'000</span></li>";
if(isset($CollectiveRubies2000))echo "<li><span>В колхозную кассу от вашего имени добавляется <img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>2'000</span></li>";
if(isset($CollectiveRubies20))echo "<li><span>В колхозную кассу от вашего имени добавляется <img src='/img/icons/ruby.png' alt='o'> <span color='yellow'>20</span></li>";
if(isset($scarerow))echo "<li><span><img src='/img/icons/scarecrow.png' alt='o'> Пугало на <span color='yellow'>1 час!</span></li>";
if(isset($rhpe))echo "<li><span><img src='/img/icons/hydropinics.png' alt='o'> Гидропоника 400% на <span color='yellow'>1 час!</span></li>";
if(isset($shmel))echo "<li><span><img src='/img/icons/heli1n.png' alt='o'> Бонус от вертолета Шмель на <span color='yellow'>1 час!</span></li>";
if(isset($yastreb))echo "<li><span><img src='/img/icons/heli2n.png' alt='o'> Бонус от вертолета Ястреб на <span color='yellow'>1 час!</span></li>";
if(isset($drakon))echo "<li><span><img src='/img/icons/heli3n.png' alt='o'> Бонус от вертолета Дракон на <span color='yellow'>1 час!</span></li>";
}
echo "<br>Лотерея беспроигрышная. Минимальный выигрыш <img src='/img/icons/experience.png' alt='o'> ".rating($lottery['exp'])."</li>";
echo "</ul></div>";
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
?>
/*
#--- Информация: -----------------------------------------------#
| Автор: Pavel Grey (Mukpomup/JlaHb24ru)
| Версия игры указана в нижней панеле Kolhoz.in
| Игру делал один.
#--- Контакты: ----------------------------------------------------#
| ICQ: 5065063
| ProfiWM.COM/us2521 - Профиль на профике
| vk.com/PavelGrey - Профиль в вк
| pavelgrey.com - сайт автора
#--- О данной игре: ---------------------------------------------#
| Мобильный колхоз - это новая онлайн игра не имеющая аналогов
| Все права принадлежат автору, запрещено использовать игру как
| средство заработка (на покупку игровой валюты не действует)
#--------------------------------------------------------------------#
*/