game/modules_data/1_panel.php

76 lines
2.7 KiB
PHP

<?php
/**
* @var User $u
* @var array $c from _config.php
* @var array $vt
*/
use Insallah\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>