<?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']='Кости'; // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
aut();

echo "<div class=\"str\">\n";
echo "</div>\n";
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']-35)."' 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']+50)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выйграли 50 баллов!</font><br/>";
}
//if 8=8=8
if ($num1 == 8 and $num2 == 8 and $num3 == 8 )
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+40)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выиграли 40 баллов!</font><br/>";
}
//if 9=9=9
if ($num1 == 9 and $num2 == 9 and $num3 == 9)
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+35)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выиграли 35 баллов!</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']+15)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выиграли 15 баллов!</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']+20)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выиграли 20 баллов!</font><br/>";
}
//if 7=7=7
if ($num1 == 7 and $num2 == 7 and $num3 == 7)
{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+55)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выиграли 55 баллов!</font><br/>";
}
// if *=7=7
if ($num2 == 7 and $num3 == 7)
{
$num = rand(1, 18);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+5)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выйграли 5 баллов!</font><br/>";
}
// if *=*=7
if ($num3 == 7)
{
$num = rand(1, 14);
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+3)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "<font color=\"red\">Вы выйграли 3 баллов!</font><br/>";
}




//Go
echo "<b>&#187;</b> <a href=\"go.php\"> Играть ещё</a><br/>";
}
echo "Баллы: $user[balls]<br />\n";

echo "<b>&#187;</b> <a href=\"index.php\"> Назад</a>\n";
include_once '../../sys/inc/tfoot.php';
?>
