game/modules_data/1_panel.php
2023-01-10 18:30:35 +02:00

76 lines
2.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @var user $u
* @var array $c from _config.php
* @var array $vt
*/
use Core\Db;
if (!defined('GAME') || (int)$u->info['align'] !== 1) {
exit();
}
if ($u->error) {
echo '<b style="color: red">' . $u->error . '</b><br>';
}
//Абилки $item_light
$item_light = [
[5048, 1, 0, 0, 0, 'usefromfile=1|nohaos=1|musor=2|noremont=1|tr_align=1|srok=86400|nosale=1|sudba=1', 1],
];
$vi = [];
$vnr = [0 => 'на сегодня', 1 => ' всего'];
$seet = '';
foreach ($item_light as $item) {
if (!$item[1]) {
continue;
}
$itm = Db::getRow('select * from items_main where id = ?', [$item[0]]);
if (!$itm['id']) {
continue;
}
$vix = 0;
if ($item[4] === 0) {
$vix = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time`>=' . strtotime('now 00:00:00') . ' AND `vars` = "dark_itm' . $itm['id'] . '"',
2);
} else {
$vix = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time`>=' . $vt['timeUse'] . ' AND `vars` = "dark_itm' . $itm['id'] . '" ',
2);
}
$vix = $vix[0];
if ($item[1] - $vix > 0 && $_GET['take_item_light_panel'] == $itm['id']) {
$nitm = $u->addItem($itm['id'], $u->info['id'], $item[5]);
$u->addAction(time(), 'dark_itm' . $itm['id'], '');
echo '<span style="color: red">Предмет &quot;<b>' . $itm['name'] . '</b>&quot; перемещен к Вам в инвентарь!</span><br><br>';
}
//Вывод предметов
$seet0 = '<img ' . $vix . ' title="' . $itm['name'] . '
(Осталось ' . $vnr[$item[4]] . ': ' . ($item[1] - $vix) . ' шт.)" src="https://' . $c['img'] . '/i/items/' . $itm['img'] . '"> ';
if ($item[1] - $vix > 0) {
$seet0 = '<a href="main.php?1_panel=1&take_item_light_panel=' . $itm['id'] . '">' . $seet0 . '</a>';
} else {
$seet0 = '<span style="filter: alpha(opacity=20); -moz-opacity: 0.20; opacity: 0.20;">' . $seet0 . '</span>';
}
$seet .= $seet0;
}
?>
<link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/clu0b.css"/>
<link rel="stylesheet" type="text/css" href="css/windows.css"/>
<script>
let elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
<h3>Светлая Сила с нами, собрат <?= $u->microLogin($u->info['id'], 1) ?></h3>
<div style="text-align: right;">
<input type="button" class="btn" value="Обновить" onclick="location='main.php?1_panel=1';">
<input type="button" class="btn" value="Вернуться" onclick="location='main.php';">
</div>
<div style="text-align: center;">
<div><strong>Абилки:</strong><br/><sup>(Чтобы забрать предмет просто нажмите на его изображение)</sup></div>
<div><?= $seet ?></div>
</div>