battles/views/main-game.php

125 lines
6.0 KiB
PHP
Raw Permalink 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
use Battles\{Template, User, InventoryItem};
# Date: 18.02.2022 (16:03)
Template::header('Игра');
?>
<script src="/js/funcs.js"></script>
<script>
$(function () {
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
let Hint3Name = '';
function okno(title, script, name, errk) {
let errkom = '';
let com = '';
if (errk === 1) {
errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>';
}
document.getElementById("hint3").innerHTML = `
<table style="width: 100%; border-spacing: 1px; background-color: #CCC3AA">
<tr>
<td style="text-align: center;">
<b>${title}</b>
</td>
<td style='cursor: pointer; width: 20px; text-align: right; vertical-align: top;' onclick='closehint3();'>
<B style="font-size: large;">x
</td>
</tr>
<tr>
<td colspan=2>
<form action="${script}" method=POST>
<table style="width: 100%; background-color: #fff6dd; border-spacing: 0; border-collapse: collapse;">
<tr>
<input type=hidden name=sd4 value='6'>
<td style="padding: 2px;" colspan=2>
<span class='error'>${errkom}</span> введите название предмета
</td>
</tr>
<tr>
<td style="padding: 2px; text-align: right; width: 50%;">
<input type=text name="${name}" value="${com}">
</td>
<td style="padding: 2px; width: 50%;">
<input type='submit' value=' »» '>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
`;
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100';
document.getElementById("hint3").style.top = '100';
document.getElementById(name).focus();
Hint3Name = name;
}
</script>
<div id=hint3 class=ahint></div>
<div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div>
<table style="width: 100%;background: white;">
<tr>
<td style="vertical-align: top; width: 350px">
<?= User::getInstance()->userInfo()->showUserDoll(0, 1) ?> <!-- Первый столбец -->
<div style="text-align: center;">
<a href='/main.php?edit=<?= mt_rand() ?>&undress=all' class="button">Снять все</a><BR>
<div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;">
<?= User::getInstance()->userInfo()->showUserEffects() ?>
</div>
</div>
<br>
</td>
<td style="vertical-align: top; width: 250px"> <!-- Второй столбец -->
<div>
<?php foreach (User::getInstance()->userInfo()->userInfoStatsTest() as $item => $value): ?>
<br><?= $item ?>: <strong><?= $value ?></strong>
<?php endforeach; ?>
<hr>
</div>
</td>
<td style="vertical-align: top;">
<div class="button-container"> <!--Меню-кнопки-->
<FORM METHOD=POST ACTION="?edit=<?= mt_rand() ?>" name=f1>
<?php if (User::getInstance()->getShadow() === '0.gif' || User::getInstance()->getAdmin() === 1): ?>
<INPUT class="button primary icon user" TYPE="submit" name="setshadow" value="Образы"
title="Образы">
<?php endif; ?>
<div class="button-group">
<?php if (User::getInstance()->getRoom() === 20): ?>
<input class="button icon move" type="submit" name="move_inside" value="Войти внутрь">
<?php elseif (User::getInstance()->getRoom() === 1): ?>
<input class="button primary" type="submit" name="battlefield" value="Поединки">
<input class="button icon move" type="submit" name="move_outside" value="Выйти на улицу">
<?php endif; ?>
<input class="button" type="submit" name="module_quest" value="Активные задания">
<input class="button" type="submit" name="main_page" value="На главную">
</div>
</div>
<div> <!--рюкзак-->
<table style="border: 0; padding: 2px; border-spacing: 1px; width: 100%; background-color: #a5a5a5">
<caption>Рюкзак (масса: <?= InventoryItem::getWeightData() ?>)</caption>
<?php foreach ($iteminfo as $ii): ?>
<tr>
<td style='width: 100px; text-align: center; background-color: #d3d3d3'>
<?= $ii->printImage() ?>
<?= $ii->printControls() ?>
</td>
<td style='vertical-align: top; background-color: #d3d3d3'>
<?= $ii->printInfo() ?>
<?php endforeach;
if (!$data): ?>
</td>
</tr>
<tr>
<th colspan='3' style='text-align: center; background-color: #c7c7c7' scope="col">Пусто</th>
</tr>
<?php endif; ?>
</table>
</div>
</td>
</tr>
</table>