Зимние правки. MVC/

Signed-off-by: lopar <lopar.4ever@gmail.com>
This commit is contained in:
lopar
2022-08-09 22:57:43 +03:00
parent 0f62ee20e7
commit b9b4c01cf0
104 changed files with 2254 additions and 2086 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
# Date: 19.02.2022 (4:20)
use Battles\{GameConfigs, Rooms, Template, User};
Template::header(Rooms::$roomNames[User::getInstance()->getRoom()]);
?>
<link href="/css/secondary.css" rel="stylesheet"/>
<script src="/js/main.js"></script>
<?php Template::buildingTop(Rooms::$roomNames[User::getInstance()->getRoom()], 'strah') ?>
<div><?= $_POST['action'] ? $bank->getStatus() : '' ?></div>
<div class="appblock appblock-main">
<span class="wrap">На счету: <span class="num"><?= User::getInstance()->money()->getBank() ?></span></span>
<hr>
<span class="wrap">На руках: <span class="num"><?= User::getInstance()->money()->get() ?></span></span>
</div>
<div class="appblock">
<span class="legend">Работа со счётом</span>
<form method="post">
<label>
<input size="10" name="summa" placeholder="Сумма">
</label>
<input type="hidden" name="action" value="depositMoney">
<input type="submit" value="Положить деньги">
</form>
<form method="post">
<label>
<input size="10" name="summa" placeholder="Сумма">
</label>
<input type="hidden" name="action" value="withdrawMoney">
<input type="submit" value="Снять деньги">
</form>
</div>
<div class="appblock">
<span class="legend">Перевод кредитов</span>
<form method="post">
<label>
<input size="10" name="summa" placeholder="Сумма">
</label>
<label>
<input size="10" name="to-id" placeholder="Cчёт">
</label><br>
<input type="hidden" name="action" value="sendMoney">
<input type="submit" value="Перевести кредиты">
</form>
<span class="wrap">Комиссия: <?= GameConfigs::BANK_COMISSION * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
</div>
+37
View File
@@ -0,0 +1,37 @@
<?php
# Date: 19.02.2022 (2:47)
use Battles\Hostel;
if (isset($_POST['act']) && $_POST['act'] === 'pay' && !empty($host->getHid())): ?>
<fieldset class="hostelClientState">
<legend>Предварительная оплата</legend>
<div style="text-align: center;">
<p class="NORMAL" style="margin: 5px 0">
Аренда оплачена по: <strong><?= date('h:i d.m.y', $host->getTime()) ?></strong>
<small>(<?= timeOut($host->getTime() - time()) ?>)</small>
</p>
</div>
<table style="margin: 0 auto;" class="periods">
<caption style="text-align: left;">Выберите срок предоплаты.</caption>
<tbody>
<tr class="caption">
<th scope="col">Сутки</th>
<?php foreach (range(1, 4) as $item): ?>
<td title="<?= 7 * $item ?> дн."><?= 7 * $item ?></td>
<?php endforeach; ?>
</tr>
<tr class="value">
<th scope="col">Сумма</th>
<?php foreach (range(1, 4) as $item): ?>
<td title="<?= 7 * $item ?> дн.">
<a href="?pays=<?= $item ?>"><?= Hostel::PRICEPERTYPE[$host->getType()][$item - 1] ?></a>
</td>
<?php endforeach; ?>
</tr>
</tbody>
</table>
<div style="color: red; font-size: 9px; padding-top: 3px;">
<strong>Внимание!</strong> При расторжении договора или смене тарифа, внесенная плата не возвращается
</div>
</fieldset>
<?php endif; ?>
+192
View File
@@ -0,0 +1,192 @@
<?php
# Date: 19.02.2022 (2:39)
use Battles\{Rooms, User, UserEffect, Template, Hostel};
Template::header(Rooms::$roomNames[User::getInstance()->getRoom()]);
?>
<script src="/js/ajaxLoad.js"></script>
<?php if ($host->getHid()): ?>
<script>
$(document).ready(function () {
$("#retariff option[value='<?= $host->getType() ?>']").remove();
});
</script>
<?php endif; ?>
<link rel="stylesheet" href="/css/hostel.css"/>
<div class="contentContainer">
<div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div>
<div class="buttonContainer">
<?php if (UserEffect::hasEffect(User::getInstance()->getId(), 8)): ?>
<input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';"/>
<?php else: ?>
<input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';"/>
<?php endif; ?>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';"/>
<input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';"/>
</div>
<div id="hostelLeft">
<div id="hostelInteractive">
<?php if (!$host->getHid()): ?>
<fieldset class="hostelClientState">
<legend>Станьте нашим клиентом</legend>
<form method="post" style="text-align: center; width: 100%;">
<input type="hidden" name="act" value="settariff"/>
<p>Выберите подходящий для Вас вариант обслуживания:</p>
<div style="text-align: center; width: 100%;">
<label>
<select name="tariff" class="tariff">
<option selected disabled>Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
</label>
<input type="submit" class="button" value="Выбрал" name="select"/>
<?php if ($host->getStatus()['type'] === 'error'): ?>
<br>
<span style="color: red; font-weight: bold;">
<?= $host->getStatus()['message'] ?>
</span>
<br>
<?php endif; ?>
</div>
</form>
</fieldset>
<?php else: ?>
<fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья :
<strong><?= Hostel::BASENAME[$host->getType()] ?></strong></p>
<p>Аренда оплачена по: <?= date('h:i d.m.y', $host->getTime()); ?>
(<small><?= timeOut($host->getTime() - time()); ?></small>)</p>
<div style="text-align: center; width: 100%;">
<label>Сменить вариант аренды<select name="retariff" id="retariff">
<option selected disabled>Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select></label>
<input type="submit" class="button" value="Сменить" name="deselect"/>
</div>
</form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;"
onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a
href="javascript: void(0);"
onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})"
style="float: right; margin-right: 3px;">Внести предоплату</a>
<?php if ($host->getStatus()['type'] === 'error'): ?>
<br>
<span style="color: red; font-weight: bold;">
<?= $host->getStatus()['message'] ?>
</span>
<br>
<?php endif; ?>
</fieldset>
<?php endif; ?>
</div>
<fieldset class="hostelRules" style="overflow: hidden;">
<legend>Правила проживания</legend>
<div style="overflow: auto; height: 168px !important; margin: 0; padding: 0;">
<div style="margin: 0; padding: 0; height: 100%;">
<h2>И что я получу за свои кровные?</h2>
У нас ты можешь:
<ul>
<li>хранить свое барахло и прочий хлам.
</ul>
<h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле.
<ul>
<li>Устраивать беспорядки в комнатах не позволено.
<li>Прислуга у нас проверенная - пожитки твои не тронут.
</ul>
<h2>И сколько стоит всё это удовольствие?</h2>
<ul>
<li>Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<li>Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<li>Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
</ul>
<h2>Как всем этим пользоваться?</h2>
Всё просто. Плати и живи.
<br/>Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида
вещей, фильтр поможет разобраться.
<h2>Что ещё мне нужно знать?</h2>
<ul>
<li>При смене размера комнаты, ты теряешь оставшееся оплаченное время.
<li>При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для
погашения задолжености.
<li>Если долг будет разумный, то подарки забирать с полки не будем.
<li>Быстро сориентироваться с шмотом поможет фильтр предметов.
<li>Если что потеряешь - твои проблемы.
</ul>
</div>
</div>
</fieldset>
</div>
<div id="hostelRight">
<fieldset>
<legend>Тарифы и услуги</legend>
<br/>
<table style='border-collapse: collapse;' class="tarifsList">
<caption>Сумка</caption>
<tbody>
<tr>
<th scope="row" class="tarifListLabel">Вместимость</th>
<td class="tarifListValue">15 ед.</td>
</tr>
<tr>
<th scope="row" class="tarifListLabel">Стоимость (7 сут.)</th>
<td class="tarifListValue">8.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table style='border-collapse: collapse;' class="tarifsList">
<caption>Сундук</caption>
<tbody>
<tr>
<th scope="row" class="tarifListLabel">Вместимость</th>
<td class="tarifListValue">30 ед.</td>
</tr>
<tr>
<th scope="row" class="tarifListLabel">Стоимость (7 сут.)</th>
<td class="tarifListValue">15.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table style='border-collapse: collapse;' class="tarifsList">
<caption>Комната</caption>
<tbody>
<tr>
<th scope="row" class="tarifListLabel">Вместимость</th>
<td class="tarifListValue">50 ед.</td>
</tr>
<tr>
<th scope="row" class="tarifListLabel">Стоимость (7 сут.)</th>
<td class="tarifListValue">25.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table style="border-collapse: collapse;" class="tarifsList">
<caption>Амбар</caption>
<tbody>
<tr>
<th scope="row" class="tarifListLabel">Вместимость</th>
<td class="tarifListValue">100 ед.</td>
</tr>
<tr>
<th scope="row" class="tarifListLabel">Стоимость (7 сут.)</th>
<td class="tarifListValue">40.00 кр.</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>
+27
View File
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="ru">
<meta charset="utf-8">
<link href="/css/main.css" rel="stylesheet">
<link href="/css/btn.css" rel="stylesheet">
<title>Игра</title>
<h1>Battles v.0.7.0222</h1>
<div>
<p>Оставь надежду всяк сюда входящий.</p>
<form method='post' action="/enter.php">
Авторизация<br>
<label>
<input name='username' placeholder='Логин'>
</label>
<label>
<input name='password' placeholder='Пароль' type="password">
</label>
<br>
<input type=submit value='Войти в игру' class="button big">
</form>
</div>
<br>
<div class="button-group minor-group">
<a class="button pill" href="/register.php">Зарегистрироваться</a>
<a class="button" href="/rememberpassword.php">Восстановить пароль</a>
<a class="button danger icon tag pill" href='//src.lopar.space/lopar/battles/issues' target="_blank">Сообщить об ошибке</a>
</div>
+125
View File
@@ -0,0 +1,125 @@
<?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>
+21
View File
@@ -0,0 +1,21 @@
<?php
# Date: 18.02.2022 (15:52)
use Battles\Template;
Template::header('Образ персонажа');
?>
<div style="text-align: right;">
<input type=button value="Вернуться" onClick="location.href='main.php?edit=<?= mt_rand() ?>';" class="button">
</div>
<table style="padding:5px; margin:auto;">
<caption style="font-weight: bold; color: red;">Внимание! Образ персонажа выбирается только один раз.</caption>
<tr><th scope="col">
<tr>
<?php foreach (range(1, 10) as $item): ?>
<td><a href="?edit=1&obraz=m<?= $item ?>"><img alt="m<?= $item ?>" src="i/shadow/m<?= $item ?>.gif"></a>
<?php endforeach; ?>
<tr>
<?php foreach (range(1, 10) as $item): ?>
<td><a href="?edit=1&obraz=f<?= $item ?>"><img alt="f<?= $item ?>" src="i/shadow/f<?= $item ?>.gif"></a>
<?php endforeach; ?>
</table>
+29
View File
@@ -0,0 +1,29 @@
<?php
# Date: 22.02.2022 (23:56)
use Battles\Template;
Template::header('Регистрация персонажа');
?>
<a href="/"> ← на главную</a>
<?php if ($_COOKIE[GAMEDOMAIN] ?? null): ?>
<h3>Не больше одной регистрации в час!</h3>
<?php else: ?>
<h1>Регистрация</h1>
<form method="post">
<label>
<input required name="login" placeholder='Имя персонажа'> Имя персонажа.
</label><br>
<label>
<input required name="email" type=email placeholder='Электронная почта'> Электронная почта.
</label><br>
<label>
<input required name="psw" type=text placeholder='Пароль'> Пароль.
</label><br>
<label for="bday">Дата рождения:</label><br>
<input required id="bday" name="birthday" type='date' min=1970-01-01 max=2010-01-01><br>
<input required id="law" name="law" type=checkbox> <label for="law">Это мой единственный персонаж!</label><br>
<input required id="law2" name="law2" type=checkbox> <label for="law2">Я согласен на любые
условия, давайте играть!</label><br>
<input type=submit value=Зарегистрироваться>
</form>
<?php endif; ?>
+53
View File
@@ -0,0 +1,53 @@
<?php
# Date: 19.02.2022 (3:54)
use Battles\{Item, InventoryItem, Shop, ShopItem, User, Template};
Template::header('Магазин');
?>
<link href='/css/shop.css' rel='stylesheet'>
<script src="/js/main.js"></script>
<h1>Государственный магазин</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div class="status"><?= ShopItem::$status ?></div>
<div class="row shop">
<div class="left column">
<h3><?= Shop::id(Shop::GENERAL_SHOP)->getCategoryName() ?></h3>
<div>
<?php if (Shop::id(Shop::GENERAL_SHOP)->categoryType === -1): ?>
Вы можете продать ваши предметы за сущие копейки.
<?php endif; ?>
</div>
<!--Магазин-->
<?= Shop::id(Shop::GENERAL_SHOP)->getItemsList() ?>
</div>
<div class="right column">
<div>
<strong>
Масса всех вещей: <?= InventoryItem::getWeightData() ?> <br>
Деньги: <?= User::getInstance()->money()->get() ?>.
</strong>
</div>
<hr>
<div>Отделы магазина</div>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_WEAPON ?>&rnd=<?= mt_rand() ?>">Оружие</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_HELMET ?>&rnd=<?= mt_rand() ?>">Шлемы</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_ARMOR ?>&rnd=<?= mt_rand() ?>">Броня</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_LEGS ?>&rnd=<?= mt_rand() ?>">Поножи</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_BOOTS ?>&rnd=<?= mt_rand() ?>">Сапоги</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_GLOVES ?>&rnd=<?= mt_rand() ?>">Перчатки</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_SHIELD ?>&rnd=<?= mt_rand() ?>">Щиты</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_BELT ?>&rnd=<?= mt_rand() ?>">Пояса</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_RING ?>&rnd=<?= mt_rand() ?>">Кольца</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_AMULET ?>&rnd=<?= mt_rand() ?>">Амулеты</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_CONSUMABLE ?>&rnd=<?= mt_rand() ?>">Расходники</a>
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_OTHER ?>&rnd=<?= mt_rand() ?>">Разное</a>
<a class="waretype alltypes" href="?rnd=<?= mt_rand() ?>">Все товары</a>
<a class="waretype sell" href="?otdel=sale&rnd=<?= mt_rand() ?>">Продать вещи</a>
<div id="hint3" class="ahint"></div>
<div>
<small>Если у вас не хватит денег на покупку, деньги будут автоматически сняты с вашего банковского
счёта
с вычетом банковской комиссии за услуги.</small>
</div>
</div>
</div>