Вход Регистрация
Файл: html/huntb/tur/vjv/in.php
Строк: 74
<?php
require_once '../../../system/func.php';

if (isset(
$user['level']) && $user['level'] < 2) {
    
?>
    <script>showContent("/main.php?msg=" + decodeURI("Не доступно до 2 уровня ."));</script>
    <?php
    
exit(0);
}
$timeN 5;
$timeP 10800;
$max_users_tur 32;
//диапазоны уровней получение по лвл в качестве индекса
$arr_lvl = [
    -
=> [-10],
    
=> [-10],
    
=> [12],
    
=> [12],
    
=> [34],
    
=> [34],
    
=> [56],
    
=> [56],
    
=> [78],
    
=> [78],
    
=> [910],
    
10 => [910],
    
11 => [1112],
    
12 => [1112],
    
13 => [1314],
    
14 => [1314],
    
15 => [1516],
    
16 => [1516],
    
17 => [1718],
    
18 => [1718],
    
19 => [1920],
    
20 => [1920],
    
21 => [2122],
    
22 => [2122],
    
23 => [2324],
    
24 => [2324],
    
25 => [2526],
    
26 => [2526],
    
27 => [2728],
    
28 => [2728],
    
29 => [2930],
    
30 => [2930],
    
31 => [3132],
    
32 => [3132],
    
33 => [3334],
    
34 => [3334],
    
35 => [3536],
    
36 => [3536],
    
37 => [3738],
    
38 => [3738],
    
39 => [3940],
    
40 => [3940],
    
41 => [4142],
    
42 => [4142],
    
43 => [4344],
    
44 => [4344],
    
45 => [4546],
    
46 => [4546],
    
47 => [4748],
    
48 => [4748],
    
49 => [4950],
    
50 => [4950],
];

$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;
    }
}

$min_lvl_tur $arr_lvl[$user['level']][0];
$max_lvl_tur $arr_lvl[$user['level']][1];

$ucharr $mc->query("SELECT * FROM `huntb_list` WHERE "
                
"`level` >= '" $arr_lvl[$user['level']][0] . "' &&"
                
" `level` <= '" $arr_lvl[$user['level']][1] . "' &&"
                
" `type`='3' ORDER BY `time_start` ASC ")->fetch_all(MYSQLI_ASSOC);
?>

<div>
    <center>
        <div>
            - Золотой приз-взнос <img class="ico_head_all" src="/images/icons/zoloto.png">1 -
        </div>
    </center>
    <hr class="hr_01" style="background-color: #e5cb95">
    <div>
        Турнир начинается в 
        <code class="time_next_battle">
            <?= sprintf("%02d:%02d", ($time_start_tur 3600) % 24, ($time_start_tur 3600) / 60); ?>
        </code>
        при наличии 
        <b>минимум 6</b>
        бойцов или раньше если набирается 
        <b><?= $max_users_tur?></b> 
        бойца.
    </div>
    <hr class="hr_01" style="background-color: #e5cb95">
    <?php if (count($ucharr)) { ?>
        <?php for ($i 0$i count($ucharr); $i++) { ?>
            <?php $usrunc $mc->query("SELECT * FROM `users` WHERE `id` >= '" $ucharr[$i]['user_id'] . "' LIMIT 1")->fetch_array(MYSQLI_ASSOC); ?>
            <table onmouseover="this.style.backgroundColor = '#ddca9f'" onmouseout="this.style.backgroundColor = ''" style="width: 100%;margin-bottom: 8px;padding-left: 20px;padding-right: 20px;" onclick="this.style.backgroundColor = '#ddca9f';showContent('/profile/<?= $usrunc['id']; ?>')">
                <tr>
                    <td style="width: 30px;text-align: center;">
                        <?= $i " . "?>
                    </td>
                    <td style="max-width: 100%;text-align: left;">
                        <!-- флаг -->
                        <?= $usrunc['side'] == || $usrunc['side'] == '<img width="19px" height="19px" src="/img/icon/icoevil.png" alt="">' '<img width="19px" height="19px" src="/img/icon/icogood.png" alt="">'?>
                        <!-- ник -->
                        <?= $usrunc['name'] == $user['name'] ? "<font><b>" $usrunc['name'] . "</b></font>" "<font>" $usrunc['name'] . "</font>"?>
                        <?= "[" $usrunc['level'] . "]" ?>
                    </td> 
                </tr>  
            </table>
        <?php ?>
    <?php } else { ?>
        <div style="padding-left: 30px">нет бойцов</div>            
    <?php ?>
    <hr class="hr_01" style="background-color: #e5cb95">
    <center>
        <?php if ($mc->query("SELECT * FROM `huntb_list` WHERE `user_id`='" $user['id'] . "' && `type`='3'")->num_rows>0) { 
            
$footval "vjv_huntb_in_registered";
            
?>
            <div class="button_alt_01" onclick="showContent('/huntb/tur/vjv/remove.php')">
                Отказаться
            </div>
        <?php } else { 
            
$footval "vjv_huntb_in";
            
?>
            <div class="button_alt_01" onclick="showContent('/huntb/tur/vjv/add.php')">
                Зарегистрироваться
            </div>
        <?php ?>
    </center>
</div>
<?php
require_once ('../../../system/foot/foot.php');
?>
Онлайн: 0
Реклама