Файл: dev/casino.php
Строк: 281
<?
include_once '../sys/core/start.php';
include_once '../sys/core/compress.php';
include_once '../sys/core/sess.php';
include_once '../sys/core/home.php';
include_once '../sys/core/settings.php';
include_once '../sys/core/db_connect.php';
include_once '../sys/core/ipua.php';
include_once '../sys/core/fnc.php';
include_once '../sys/core/user.php';
include_once '../sys/inc/fnc_game.php';
include_once '../sys/inc/thead.php';
include_once '../sys/inc/uhead.php';
only_reg();
###### Configurations modul Casino ########
$cena                     = 2; // Cena for one game
$currency                 = 'baks'; // currency casino. Equal to the name column in the table `user`
$one_bonus                = 130; // Number of games first star
$two_bonus                 = 215; // Number of games second star
$three_bonus             = 285; // Number of games third star
$img_url_star_active    = 'http://sgraces.ru/style/img/icons/rating.png'; // link active image star in Rating
$img_url_star             = 'http://sgraces.ru/style/img/icons/rating.png'; // link not active image star in Rating
$car = array(
                    'screen'             => '2010-hennessey-v800-cadillac-cts-v-4',
                    'level'                => '25',
                    'name'                => 'Cadillac CTS-V Hennessey V800',
                    'power'                => '800',
                    'country'            => 'USA',
                    'marka'                => 'Cadillac',
                    'typecar'            => 'Sedan',
                    'model'                => 'CTS',
                    'class'                => 'S',
                    'price_money'        => '0',
                    'price_baks'        => '0',
                    'price_sell'        => '0',
                    'price_sell_baks'    => '0');
$four_bonus             = 385; // Number of games third star
$carto = array(
                    'screen'             => 'Mercedes-Benz_G_63_Mansory_Sahara_Edition',
                    'level'                => '25',
                    'name'                => 'Mercedes-Benz G63 Mansory Sahara Edition',
                    'power'                => '840',
                    'country'            => 'Germany',
                    'marka'                => 'Mercedes',
                    'typecar'            => 'Jeep',
                    'model'                => 'G63',
                    'class'                => 'E',
                    'price_money'        => '0',
                    'price_baks'        => '0',
                    'price_sell'        => '0',
                    'price_sell_baks'    => '0');
###### END configuration modul Casino #####
###### World BY Konor ##################### 
if($user['level']>14)        
{
echo "<table class='wdt msg-table'><tr><td align='left' style='vertical-align: top; width: 10%'><img src='/style/img/images/face-ajl.png'></td>";
echo "<td align='left' style='vertical-align: top'>";
echo "Добро пожаловать в казино! Тут у тебя есть возможность отдохнуть и провести время.</td></tr></table></td></tr></table>";
echo "<table width='100%'>";
echo "<tr><td><img src='/style/img/images/dealer_casino.jpg'></td></tr></table>";
echo "<table class='wdt brown-header'>";
echo "<tr><td align='left'>Казино:</td></tr></table>";
echo '<div class="gray-table">';
if(isset($_GET['jekpot'])){
    if($user['count_game_casino']>=$three_bonus){
        mysql_query("INSERT INTO `garage` SET `id_user` = '".$user['id']."', `screen` = '".$car['screen']."', `name` = '".$car['name']."', `power` = '".$car['power']."', `stock_power` = '".$car['power']."', `country` = '".$car['country']."', `model` = '".$car['model']."', `marka` = '".$car['marka']."', `typecar` = '".$car['typecar']."', `class` = '".$car['class']."', `price_money` = '".$car['price_sell']."', `price_baks` = '".$car['price_sell_baks']."'");
        mysql_query("UPDATE `user` SET `count_game_casino`=0 WHERE `id`=".$user['id']." LIMIT 1");
    }
}
if(isset($_GET['jekpotto'])){
    if($user['count_game_casino']>=$four_bonus){
        mysql_query("INSERT INTO `garage` SET `id_user` = '".$user['id']."', `screen` = '".$carto['screen']."', `name` = '".$carto['name']."', `power` = '".$carto['power']."', `stock_power` = '".$carto['power']."', `country` = '".$carto['country']."', `model` = '".$carto['model']."', `marka` = '".$carto['marka']."', `typecar` = '".$carto['typecar']."', `class` = '".$carto['class']."', `price_money` = '".$carto['price_sell']."', `price_baks` = '".$carto['price_sell_baks']."'");
        mysql_query("UPDATE `user` SET `count_game_casino`=0 WHERE `id`=".$user['id']." LIMIT 1");
    }
}
if($user[$currency]>$cena){
    echo "<table class='wdt gray-table'><tr><td class='white td-cell' align='center' style='height:30px;'><form action ='?start' method='post'><input class='no-btn' type='submit' value='Крутить колесо'></form></td></tr></table>";
} else {
    echo "<table class='wdt gray-table'><tr><td><input class='inactive-btn' type='submit' value='Крутить колесо'></td></tr></table></td></tr><tr></table>";
}
if(isset($_GET['start'])){
    if($user[$currency]>$cena){
    $hans = rand(1,20);
    if($hans == 3){
        $WHERE = 'WHERE `SQL`="baks"'; 
    } else {
        $WHERE = 'WHERE `SQL`!="baks"'; 
    }
    $id = mysql_query("SELECT * FROM `casino_ships` ".$WHERE." ORDER BY RAND() LIMIT 1");
    $id = mysql_fetch_array($id);
    $val = $user[$currency]-$cena;
    $val_g = $user['count_game_casino']+1;
    $pay = mysql_query("UPDATE `user` SET `".$currency."` = ".$val.",`count_game_casino`=".$val_g." WHERE `id`=".$user['id']." LIMIT 1");
    $casino_bonus = eval('$bon = '.$id['MATCH'].';');
    $casino_bonus = $bon;
    mysql_query("UPDATE `user` SET `".$id['SQL']."`=".$casino_bonus." WHERE `id`=".$user['id']);
    echo '<b style="color: yellow; font-size: 12pt; font: Tahoma;">Ваш выигрыш: '.$id['name'];
    }
}
echo '</b><br><b style="color: white; font-size: 12pt; font: Tahoma;">Вы крутили колесо: '.$user['count_game_casino'].' раз </br> Ваш рейтинг казино: </br>';
if($user['count_game_casino']>=$one_bonus){
 echo '<img src='.$img_url_star_active.'>';
} else {
 echo '<img src='.$img_url_star.'>';
} 
if($user['count_game_casino']>=$two_bonus){ 
 echo '<img src='.$img_url_star_active.'>';
} else {
 echo '<img src='.$img_url_star.'>';
}
if($user['count_game_casino']>=$three_bonus)
{
 echo '<img src='.$img_url_star_active.'>';
$post = $car;
 echo "<table class='wdt green-table' border=4><tr>";
echo "<td class='white td-cell green-table-act' align='left' style='width:140px; padding-top: 2px; vertical-align:middle;'><table  style='vertical-align:middle;'><tr><td align='left'> <b>$post[name]</b></td></tr>";
echo "<tr><td align='left'><img src='/style/img/car/$post[screen].png' width='128px' alt=''/><br/>";
echo "<img style='width:128px; margin-top:-15px;' src='/style/img/images/car_shadow.png' alt=''></td></tr></table></td>";
echo "<tr><td><b class='white'>Класс:</b> <b class='class-$post[class] bold-text'>$post[class]</b><br/><b class='orange'>Мощность: $post[power] л.с.</b></td></tr><tr><td></tr></td>";
echo '</table>';
 echo "<table class='wdt gray-table'><tr><td class='white td-cell' align='center' style='height:30px;'><form action ='?jekpot' method='post'><input class='no-btn' type='submit' value='Забрать джекпот'></form></td></tr></table>";
} else {
 echo '<img src='.$img_url_star.'>';
}
 
if($user['count_game_casino']>=$four_bonus)
{
 echo '<img src='.$img_url_star_active.'>';
$postto = $carto;
 echo "<table class='wdt green-table' border=4><tr>";
echo "<td class='white td-cell green-table-act' align='left' style='width:140px; padding-top: 2px; vertical-align:middle;'><table  style='vertical-align:middle;'><tr><td align='left'> <b>$postto[name]</b></td></tr>";
echo "<tr><td align='left'><img src='/style/img/car/$postto[screen].png' width='128px' alt=''/><br/>";
echo "<img style='width:128px; margin-top:-15px;' src='/style/img/images/car_shadow.png' alt=''></td></tr></table></td>";
echo "<tr><td><b class='white'>Класс:</b> <b class='class-$postto[class] bold-text'>$postto[class]</b><br/><b class='orange'>Мощность: $postto[power] л.с.</b></td></tr><tr><td></tr></td>";
echo '</table>';
 echo "<table class='wdt gray-table'><tr><td class='white td-cell' align='center' style='height:30px;'><form action ='?jekpotto' method='post'><input class='no-btn' type='submit' value='Забрать джекпот'></form></td></tr></table>";
} else {
 echo '<img src='.$img_url_star.'>';
}
echo '<table class="wdt brown-header"><tbody><tr><td align="left">Список бонусов:</td></tr></tbody></table>';
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>1. Бензин <img src='/style/img/icons/fuel.png'></b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>2. Баксы <img src='/style/img/icons/baks.png'></b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>3. Монеты <img src='/style/img/icons/money.png'></b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>4. Тур. очки <img src='/style/img/icons/hp.png'></b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>5. Фишки <img src='/style/img/icons/fishka.png'></b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>5. Кроличья лапка</b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>5. Опыт</b></br>";
echo '<table class="wdt brown-header"><tbody><tr><td align="left">Супер приз:</td></tr></tbody></table>';
echo "<table class='wdt gray-table'></table>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>Автомобиль - Cadillac CTS-V Hennessey V800 </b></br>";
echo "<b style='color: white; font-size: 12pt; font: Tahoma;'>Внедорожник - Mercedes-Benz G63 Mansory Sahara Edition </b></br>";
echo '</div>';
echo "<table class='wdt gray-table'><tr><td class='white td-cell' align='center' style='height:30px;'><form action ='/dev/exhibition_casino.php' method='post'><input class='yes-btn' type='submit' value='Выставка'></form></td></tr></table>";
echo "<table class='wdt gray-table'>";
echo "<tr><td class='white td-cell' align='center' style='height:30px;'><form action ='/dev/map.php' method='post'><input class='no-btn' type='submit' value='Назад'></form></td></tr></table>";                                                                                                
include_once '../sys/inc/tfoot.php';
}
else
{
echo "<table class='wdt msg-table'><tr><td align='left' style='vertical-align: top; width: 10%'><img src='/style/img/images/face-ajl.png'></td>";
echo "<td align='left' style='vertical-align: top'>";
echo "Казино доступно с 15 уровня. Бегом в гонку!</td></tr></table></td></tr></table>";
echo "<table class='wdt gray-table'>";
echo "<tr><td class='white td-cell' align='center' style='height:30px;'><form action ='/dev/map.php' method='post'><input class='no-btn' type='submit' value='Назад'></form></td></tr></table>";                                                                                                
include_once '../sys/inc/tfoot.php';
}                    
?>