Зачем-то инкапсулирем.

This commit is contained in:
lopar
2021-02-01 21:20:23 +02:00
parent 7dd6368b84
commit 2ccb5ef128
63 changed files with 345 additions and 345 deletions
+6 -6
View File
@@ -13,11 +13,11 @@ try {
}
$do = $_GET['do'] ?? null;
if ($do == "clear" && $user->admin == 1) {
if ($do == "clear" && $user->getAdmin() == 1) {
db::c()->query('UPDATE `zayavka` SET `coment` = "?s" WHERE `id` = ?i', '<em>Вырезано цензурой!</em>', $_GET['zid']);
}
if (!empty($_GET['del']) && $user->admin == 1) { //удаление заявки на бой.
if (!empty($_GET['del']) && $user->getAdmin() == 1) { //удаление заявки на бой.
$zayavka = db::c()->query('SELECT `id` FROM `zayavka` WHERE `id` = ?i', $_GET['zid'])->fetch_assoc();
if (isset($zayavka['id'])) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = ?i', $zayavka['id']);
@@ -635,7 +635,7 @@ Template::header('zayavka');
<TD>
<?php
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
if ($user->room != 1 && $get != 'current') {
if ($user->getRoom() != 1 && $get != 'current') {
exit('В этой комнате невозможно подавать заявки!');
}
if (!$get) {
@@ -712,11 +712,11 @@ Template::header('zayavka');
$timeFigth = fread($f, filesize($Path));
fclose($f);
if ($timeFigth < time() && ($user->getLevel() <= 14)) {
if ($get == 'trainstart' && $user->health > $user->maxHealth * 0.33 && ($user->getLevel() <= 7 || $user->admin == 1)) {
if ($get == 'trainstart' && $user->getHealth() > $user->getMaxHealth() * 0.33 && ($user->getLevel() <= 7 || $user->getAdmin() == 1)) {
unlink("/tmp/zayavka/" . $user->id . ".txt");
$zay->delzayavka($user->id, $user->zayavka, 2, 0);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->id . "','','" . $user->maxHealth . "');");
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->getId() . "','','" . $user->getMaxHealth() . "');");
$bot = mysql_insert_id();
$teams = [];
@@ -742,7 +742,7 @@ Template::header('zayavka');
$timeFigth = fread($f, filesize($Path));
fclose($f);
if ($user->admin == 1) {
if ($user->getAdmin() == 1) {
echo " или <input type=button onclick=\"location.href='zayavka.php?trainstart';\" value=\"Начать тренировочный бой\">";
}