Файл: world-faces.ru/world-faces.ru/play/777/777.php
Строк: 149
<?php
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title']='777'; // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
aut();
if(mysql_result(mysql_query("SELECT count(id) FROM `my_apps` where `id_us` = '".$us['id']."' and `id_app` = '12'"),0)==0){
$app = DB::$dbs->queryFetch("SELECT * FROM `apps` where `id` = ? limit 1",array(12));
function ret($type){
$type = str_replace('И','и',$type);
$type = str_replace('а','ы',$type);
$type = str_replace('П','п',$type);
$type = str_replace('ие','ия',$type);
return $type;
}
echo '<div class="title" align="center">Запуск '.ret($app['type']).' | <a href="/play">закрыть</a></div>';
echo '<div class="prof"><img src="'.$app['img'].'" align="middle" alt="'.$app['name'].'"/><b>'.$app['name'].'</b><br/>'.$app['opis'].'</div>';
echo '<div class="app">Запустили уже <b>'.DB::$dbs->querySingle("SELECT count(id) FROM `my_apps` where `id_app` = '12'").'</b> человек! <a href="?add"><input type="submit" value="Запустить '.$app['name'].'!"/></a></div>';
if(isset($_GET['add'])){
DB::$dbs->query("INSERT INTO `my_apps` set `id_us` = ?, `id_app` = ?",array($us['id'],12));
$text = 'запустил'.(($us['pol']==0)?'а':'').' приложение <b>[url='.$app['src'].']"'.$app['name'].'"[/url]</b>!';
DB::$dbs->query("INSERT INTO `lenta_saita` set `user` = ?, `time` = ?,`action` = ?",array($us['nick'],time(),$text));
header('location:'.$app['src'].'');
}
niz(); exit;
}
if (isset($user) & $user['balls']<=4)
{
if ($user['pol']==0){echo "Извини <b>красавица,</b> n";} else {echo "<b>Извини братан,</b> n";}
echo "но в игре минимальная ставка <b>5</b> баллов<br/>У вас <b>$user[balls]</b> балловn";
}
else
{
////////////////////////////////////////////////////////Generation
$num1 = rand(1, 9);//////////////////////////////
$num_a = rand(1, 6);////////////////////////////
$num_b = rand(1, 6);///////////////////////////
$num_c = rand(1, 9);////////////////////////////
$num_d = array($num_a, $num_b, $num_c);////////
$num_e = rand(0, 2); ////////////////////////////////
$num2 = $num_d[$num_e];////////////////////////////////
$num3 = rand(1, 9);/////////////////////////////////
//////////////////////////////////////////////////////////Generation
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']-5)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "Выпали числа:<br/>";
echo "[$num1]-[$num2]-[$num3]";
echo "<br/>";
/////////////////////////////////////////////////////////////////////////////////////////
//if 6=6=6
if ($num1 == 6 and $num2 == 6 and $num3 == 6)
{
$num = rand(1, 3);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+200)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выйграли 200 баллов!</font><br/>";
}
//if 8=8=8
if ($num1 == 8 and $num2 == 8 and $num3 == 8 )
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+100)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выиграли 100 баллов!</font><br/>";
}
//if 9=9=9
if ($num1 == 9 and $num2 == 9 and $num3 == 9)
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+90)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выиграли 90 баллов!</font><br/>";
}
//if 1=1=1
if ($num1 == 1 and $num2 == 1 and $num3 == 1)
{
$num = rand(1, 50);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выиграли 50 баллов!</font><br/>";
}
// if 3=3=3
if ($num1 == 3 and $num2 == 3 and $num3 == 3)
{
$num = rand(1, 70);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выиграли 50 баллов!</font><br/>";
}
//if 7=7=7
if ($num1 == 7 and $num2 == 7 and $num3 == 7)
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+150)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выиграли 150 баллов!</font><br/>";
}
// if *=7=7
if ($num2 == 7 and $num3 == 7)
{
$num = rand(1, 18);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+20)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выйграли 20 баллов!</font><br/>";
}
// if *=*=7
if ($num3 == 7)
{
$num = rand(1, 14);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+5)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color="red">Вы выйграли 5 баллов!</font><br/>";
}
//Go
echo "<a href="go.php">Играть ещё</a><br/>";
}
echo "<a href="index.php">»Назад</a>n";
include_once '../../sys/inc/tfoot.php';
?>