Файл: 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 = [
-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 = "выживание";
$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 + 1 . " . "; ?>
</td>
<td style="max-width: 100%;text-align: left;">
<!-- флаг -->
<?= $usrunc['side'] == 0 || $usrunc['side'] == 1 ? '<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');
?>