Вход Регистрация
Файл: html/huntb/tur/stenka/index.php
Строк: 32
<?php
require_once '../../../system/func.php';
if (isset(
$user['level']) && $user['level'] < 2) {
    
?>
    <script>showContent("/main.php?msg=" + decodeURI("Не доступно до 2 уровня ."));</script>
    <?php
}
$timeN = 5;
$timeP = 10800;
$max_users_tur = 32;

//диапазоны уровней получение по лвл в качестве индекса
$arr_lvl = [
    -
1 => [-1, 0],
    
0 => [-1, 0],
    
1 => [1, 2],
    
2 => [1, 2],
    
3 => [3, 4],
    
4 => [3, 4],
    
5 => [5, 6],
    
6 => [5, 6],
    
7 => [7, 8],
    
8 => [7, 8],
    
9 => [9, 10],
    
10 => [9, 10],
    
11 => [11, 12],
    
12 => [11, 12],
    
13 => [13, 14],
    
14 => [13, 14],
    
15 => [15, 16],
    
16 => [15, 16],
    
17 => [17, 18],
    
18 => [17, 18],
    
19 => [19, 20],
    
20 => [19, 20],
    
21 => [21, 22],
    
22 => [21, 22],
    
23 => [23, 24],
    
24 => [23, 24],
    
25 => [25, 26],
    
26 => [25, 26],
    
27 => [27, 28],
    
28 => [27, 28],
    
29 => [29, 30],
    
30 => [29, 30],
    
31 => [31, 32],
    
32 => [31, 32],
    
33 => [33, 34],
    
34 => [33, 34],
    
35 => [35, 36],
    
36 => [35, 36],
    
37 => [37, 38],
    
38 => [37, 38],
    
39 => [39, 40],
    
40 => [39, 40],
    
41 => [41, 42],
    
42 => [41, 42],
    
43 => [43, 44],
    
44 => [43, 44],
    
45 => [45, 46],
    
46 => [45, 46],
    
47 => [47, 48],
    
48 => [47, 48],
    
49 => [49, 50],
    
50 => [49, 50],
];
if (
$user['side'] == 0 || $user['side'] == 1) {
    
$user_rasa = 0;
} else {
    
$user_rasa = 1;
}
$name_tur = "стенка";
$time_save = ceil(((time() + $timeP) % 3600) / 60);
$time_start_tur = 0;
for (
$i = 0; $i <= 60; $i += $timeN) {
    if (
$time_save <= $i) {
        
$time_start_tur = ((time() + $timeP) - (time() + $timeP) % 3600) + ($i * 60);
        break;
    }
}
$ucharrU = $mc->query("SELECT * FROM `huntb_list` WHERE "
                
. "`level` >= '" . $arr_lvl[$user['level']][0] . "' &&"
                
. " `level` <= '" . $arr_lvl[$user['level']][1] . "' &&"
                
. " `rasa` = '$user_rasa' &&"
                
. " `type`='5' ORDER BY `time_start` ASC ")->num_rows;
$ucharrA = $mc->query("SELECT * FROM `huntb_list` WHERE "
                
. "`level` >= '" . $arr_lvl[$user['level']][0] . "' &&"
                
. " `level` <= '" . $arr_lvl[$user['level']][1] . "' &&"
                
. " `rasa` != '$user_rasa' &&"
                
. " `type`='5' ORDER BY `time_start` ASC ")->num_rows;
$uchcount = $ucharrU + $ucharrA;
?>

<div>
    <center>
        <div>
            <b>-Стенка на стенку-</b>
        </div>
    </center>
    <div>
        Золотой приз-взнос <img class="ico_head_all" src="/images/icons/zoloto.png">1
    </div>
    <div>
        Игроки:
        <code class="players"></code>
        <?= $uchcount; ?>/<?= $max_users_tur; ?>
    </div>
    <div>
        Время:
        <code class="time_next_battle">
            <?= sprintf("%02d:%02d", ($time_start_tur / 3600) % 24, ($time_start_tur % 3600) / 60); ?>
        </code>
    </div>
    <center>
        <div class="button_alt_01" onclick="showContent('/huntb/tur/stenka/in.php')">
            Просмотреть
        </div>
    </center>
</div>
<?php
$footval 
= "stenka_huntb_index";
require_once (
'../../../system/foot/foot.php');
?>
Онлайн: 1
Реклама