Файл: iwup.biz/frog.php
Строк: 106
<?php
$mt=microtime(1);
$time=time();
$timenext=$time+24*3600*7;
include('db.php');
include('ses.php');
include('auth.php');
include('nast.php');
include('shapka.php');
function win($a,$b,$c)
{
if($a==$b && $a==$c)
return $a;
else
return 0;
}
if($_SESSION['auth'])
{
print '</div><div class="top">Слот Fairy Land</div><div class="ma">';
print "<a href="help.php?ses=$ses&act=frog">Помощь</a><br />";
$info=mysql_fetch_assoc(mysql_query("SELECT * from `user` WHERE `uid`='$_SESSION[uid]'"));
if($info['status']<3)
print "Вы забанены<br />
Свяжитель с администрацией для выяснения причин<br />
";
else
{
if(!isset($_SESSION['kod777']))
$_SESSION['kod777']=rand(1,10000);
print "Стоимость игры: 1 р.<br />";
if($info['balans']<1)
print "Недостаточно средств для начала игры<br />";
elseif(!isset($_GET['act']) or !isset($_GET['kod']) or @$_SESSION['kod777']!=$_GET['kod'])
{
print "Fairy Land:<br />";
print "<img src="image/frog/0.gif" alt="frog"/>|<img src="image/frog/0.gif" alt="frog"/>|<img src="image/frog/0.gif" alt="frog"/><br />";
print "><a href="frog.php?ses=$ses&act=game&kod=$_SESSION[kod777]">Крутить рулетку!</a><br />";
}
else
{
$slch=mt_rand(10000,1000000);
$win=0;
if($slch%2000==0)
{
$a=100; $b=100; $c=100;
}
elseif($slch%500==0)
{
$a=50; $b=50; $c=50;
}
elseif($slch%90==0)
{
$a=10; $b=10; $c=10;
}
elseif($slch%30==0)
{
$a=5; $b=5; $c=5;
}
elseif($slch%10==0)
{
$a=2; $b=2; $c=2;
}
elseif($slch%3==0)
{
$a=1; $b=1; $c=1;
}
else
{
$nch=mt_rand(1,6);
if($nch==1)
$a=1;
elseif($nch==2)
$a=2;
elseif($nch==3)
$a=5;
elseif($nch==4)
$a=10;
elseif($nch==5)
$a=50;
else
$a=100;
$nch2=mt_rand(1,6);
if($nch2==1)
$b=1;
elseif($nch2==2)
$b=2;
elseif($nch2==3)
$b=5;
elseif($nch2==4)
$b=10;
elseif($nch2==5)
$b=50;
else
$b=100;
$nch3=mt_rand(1,6);
if($nch3==1)
$c=1;
elseif($nch3==2)
$c=2;
elseif($nch3==3)
$c=5;
elseif($nch3==4)
$c=10;
elseif($nch3==5)
$c=50;
else
$c=100;
for($i=0; $i<30; $i++)
{
if($nch==$nch2 && $nch2==$nch3)
{
$nch=mt_rand(1,6);
if($nch==1)
$a=1;
elseif($nch==2)
$a=2;
elseif($nch==3)
$a=5;
elseif($nch==4)
$a=10;
elseif($nch==5)
$a=50;
else
$a=100;
$nch2=mt_rand(1,6);
if($nch2==1)
$b=1;
elseif($nch2==2)
$b=2;
elseif($nch2==3)
$b=5;
elseif($nch2==4)
$b=10;
elseif($nch2==5)
$b=50;
else
$b=100;
$nch3=mt_rand(1,6);
if($nch3==1)
$c=1;
elseif($nch3==2)
$c=2;
elseif($nch3==3)
$c=5;
elseif($nch3==4)
$c=10;
elseif($nch3==5)
$c=50;
else
$c=100;
}
else
break;
}
}
$win=win($a,$b,$c);
$time=time();
print "Выпавшая комбинация:<br /><img src="image/frog/$a.gif" alt="$a"/>|<img src="image/frog/$b.gif" alt="$b"/>|<img src="image/frog/$c.gif" alt="$c"/><br />";
print "Выигрыш: $win р.<br />";
unset($_SESSION['kod777']);
$_SESSION['kod777']=rand(1,10000);
print "><a href="frog.php?ses=$ses&act=game&kod=$_SESSION[kod777]">Играть еще!</a><br />";
mysql_query("UPDATE `user` SET `balans`=`balans`+'$win'-'1',`losenow`=`losenow`+1,`winnow`=`winnow`+'$win',`lose`=`lose`+1,`win`=`win`+'$win' WHERE `uid`='$_SESSION[uid]' ");
mysql_query("INSERT into `frog` VALUES('0','$time','$_SESSION[login]','$win')");
}
}
print '</div><div class="down"><a href="enter.php?ses='.$ses.'">Личный кабинет</a><br /></div><div>';
}
else
{
print 'Авторизация не удалась.Возможго вы ввели неверный логин или пароль, либо истекло время жизни сессии<br /><a href="index.php">повторить ввод</a><br />';
}
include('foot.php');
?>