Файл: html/huntb/tur/vjv/index.php
Строк: 29
<?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],
];
$name_tur = "выживание";
$min_lvl_tur = $arr_lvl[$user['level']][0];
$max_lvl_tur = $arr_lvl[$user['level']][1];
$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;
}
}
$uchcount = $mc->query("SELECT * FROM `huntb_list` WHERE "
. "`level` >= '" . $arr_lvl[$user['level']][0] . "' &&"
. " `level` <= '" . $arr_lvl[$user['level']][1] . "' &&"
. " `type`='3'")->num_rows;
?>
<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/vjv/in.php')">
Просмотреть
</div>
</center>
</div>
<?php
$footval = "vjv_huntb_index";
require_once ('../../../system/foot/foot.php');
?>