Изменено поле в БД, вынесены лишние функции их functions в профильные файлы. Оказывается, давно не работал логин и плохо работали сессии. Проверяется. Прочие мелкие баги и чистка самых хвостов.

This commit is contained in:
Igor Barkov (iwork)
2021-08-27 18:55:18 +03:00
parent 9c7fcda600
commit 7434f28fa6
36 changed files with 293 additions and 341 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
<?php
use Battles\ShopItem;
use Battles\Template;
require_once 'functions.php';
@@ -87,7 +88,7 @@ if (isset($_POST['buyFirst'])) {
} else {
$user['money'] -= 5;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
ShopItem::giveNewItem(1930, $user['id']);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб за 5кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб';
}
@@ -113,7 +114,7 @@ if (isset($_POST['buySecond'])) {
} else {
$user['money'] -= 15;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
ShopItem::giveNewItem(1931, $user['id']);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб (x2) за 15кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб (x2)';
}