<?php
//////////////////////////////////////////
// CHAT POWERED : http://sim-sim.h2m.ru//
// ICQ : 378036650                     //
// Email : olegarhi75@mail.ru          //
// WEB SITE Version 1.0 www.waufon.ru  //
////////////////////////////////////////
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
$time = date( "H:i" );
$credits = $row['credits'];
$win = 0;
$krutim = mt_rand( 1, 35 );
$bar1 = mt_rand( 1, 4 );
$bar2 = mt_rand( 1, 4 );
$bar3 = mt_rand( 1, 4 );
echo "<title>GAME</title>\r\n<style type=\"text/css\">\r\nbody { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }\r\na:link,a:visited { text-decoration: underline; color: {$lcol} }\r\ndiv { background-color: {$rcol} }\r\n.cp \t{ border-style:solid; border-width: 0px; color: {$lcol} ; background-color: {$bcol}; text-align: left }\r\n</style>\r\n</head>\r\n<body>\r\n<div align=\"center\">Однорукий бандит<br/></div>";
if ( empty( $do ) )
{
    echo "\r\n<form  action=\"seven.php\" method=\"post\">\r\nВаша ставка (1-10):<br/>\r\n<input type=\"text\" name=\"stav\" maxlength=\"2\"/>\r\n<input type=\"hidden\" name=\"do\" value=\"game\"/>\r\n<input type=\"hidden\" name=\"id\" value=\"{$id}\"/>\r\n<input type=\"hidden\" name=\"pass\" value=\"{$pass}\"/> \r\n<input type=\"hidden\" name=\"rm\" value=\"{$rm}\"/>    \r\n<input value=\"Крутить\" type=\"submit\" class=\"cp\">\r\n</form>\r\n---<br/>\r\n<u>Кредиты:</u> {$credits}<br/>";
}
else
{
    $stav = intval( $stav );
    if ( $stav <= $credits && $stav != 0 && $stav <= 10 )
    {
        if ( $krutim == 1 )
        {
            $win = $stav * 7;
            echo "<p align=\"center\">\r\n<blink>JACKPOT!!!</blink><br/>\r\n<b>7-7-7</b><br/>\r\n<blink>JACKPOT!!!</blink>\r\n</p>\r\n<div>\r\n<u><b>Крупье</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>, \r\nПоздравляю! Вы сорвали ДЖЕКПОТ!<br/>\r\n</div>";
        }
        else if ( $krutim == 3 )
        {
            $win = $stav * 4;
            echo "<p align=\"center\">\r\n<b>Победа!</b><br/>\r\n<b>7-0-7</b><br/><br/>\r\n</p>\r\n<div>\r\n<u><b>Крупье</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>, \r\nПоздравляю!<br/>\r\n</div>";
        }
        else if ( $krutim == 5 )
        {
            $win = $stav;
            echo "<p align=\"center\">\r\n<b>ZERO!</b><br/>\r\n<b>0-0-0</b><br/>\r\n</p>\r\n<div>\r\n<u><b>Крупье</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>, \r\nПоздравляю!<br/>\r\n</div>";
        }
        else if ( $krutim == 7 )
        {
            $win = $stav * 2;
            echo "<p align=\"center\">\r\n<b>Пятерочка!</b><br/>\r\n<b>5-5-5</b><br/>\r\n</p>\r\n<div>\r\n<u><b>Крупье</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>, \r\nПоздравляю!<br/>\r\n</div>";
        }
        else
        {
            print "<p align=\"center\">\r\n<b>{$bar1}-{$bar2}-{$bar3}</b><br/>\r\n</p>\r\n<div>\r\n<u><b>Крупье</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>, \r\nВы проиграли...<br/>\r\n</div>";
        }
        echo "<u>Ставка:</u> {$stav}<br/>\n";
        if ( $win != 0 )
        {
            $credits = $credits + $win;
            @mysql_query( "update users set credits='".$credits."' where id='".$id."';" );
            echo "<u>Выигрыш:</u> {$win}<br/>\n";
            echo "<u>Кредиты:</u> {$credits}<br/>---<br/>\n";
        }
        else
        {
            $credits = $credits - $stav;
            @mysql_query( "update users set credits='".$credits."' where id='".$id."';" );
            echo "<u>Кредиты:</u> {$credits}<br/>---<br/>\n";
        }
        echo " <a href=\"seven.php?id={$id}&amp;pass={$pass}&amp;do={$do}&amp;stav={$stav}\">Крутить</a><br/>";
    }
    else
    {
        echo "<br/><div>\r\n<u><b>Охранник</b></u> [{$time}]&gt;\r\n<b>".$row['login']."</b>,\r\nВы не можете играть!<br/>\r\nНе правильная ставка<br/>\r\nили<br/>\r\nБольше нет КРЕДИТов!\r\n</div>";
    }
}
if ( isset( $do ) )
{
    echo "<a href=\"seven.php?id={$id}&amp;pass={$pass}\">Новая ставка</a><br/>";
}
echo "<a href=\"index.php?id={$id}&amp;pass={$pass}\">В казино</a>\r\n<br/>---<br/>";
$end = gettime( );
echo "<a href=\"../enter.php?id={$id}&amp;pass={$pass}\">Прихожая</a>\r\n<p align=\"center\">\r\n[".round( $end - $mystart, 5 )."]\r\n</p></body></html>";
mysql_close( $link );
echo "\r\n\r\n\r\n\r\n";
?>