From 34abf07b4b16bfc245adf448aae3e8d996a2c13b Mon Sep 17 00:00:00 2001 From: lopar Date: Thu, 13 Dec 2018 00:43:58 +0200 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=83=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=D0=BD?= =?UTF-8?q?=D0=B2=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D1=91=D0=BC=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=83=D1=8E=20=D0=B0?= =?UTF-8?q?=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D1=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/admin.php | 13 +------ admin/edit_user.php | 95 +++++++++++++++++++++++++++++++++++++++++++++ inf.php | 43 +------------------- 3 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 admin/edit_user.php diff --git a/admin/admin.php b/admin/admin.php index 71b24e0..cc284fd 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -7,20 +7,15 @@ */ session_start(); -include "../config.php"; -include "../functions.php"; - - +require_once '../functions.php'; if (empty($user['admin'])) { - echo "404 Not Found

Not Found

The requested URL /admin.php was not found on this server.


Apache/2.2.22 (@RELEASE@) Server at Hetzner Datacenter 426
"; + echo "404 Not Found

Not Found

The requested URL {$_SERVER['SCRIPT_NAME']} was not found on this server.


Apache/2.2.22 (@RELEASE@) Server at Hetzner Datacenter 426
"; exit; } -define('ADMINS', microtime()); ?> - @@ -396,10 +391,6 @@ if ($_POST['sbr_par']) { - - - Но нахуя износ новой вещи?! - diff --git a/admin/edit_user.php b/admin/edit_user.php new file mode 100644 index 0000000..39a93a0 --- /dev/null +++ b/admin/edit_user.php @@ -0,0 +1,95 @@ + + * Project name: Battles-Game + */ + +session_start(); +require_once "../functions.php"; + +if (empty($user['admin'])) { + echo "404 Not Found

Not Found

The requested URL {$_SERVER['SCRIPT_NAME']} was not found on this server.


Apache/2.2.22 (@RELEASE@) Server at Hetzner Datacenter 426
"; + exit; +} + +if (isset($_POST['player'])) { + $p = db::c()->query('SELECT `id`, `login` FROM `users` WHERE `id` = "?s" OR `login` = "?s"', $_POST['player'], $_POST['player'])->fetch_assoc(); + $_SESSION['player_id'] = $p['id']; + $_SESSION['player_name'] = $p['login']; +} + +if (isset($_POST['undress_char'])) undressall($_SESSION['player_id']); + +if (isset($_POST['end'])) { + unset($_SESSION['player_id']); + unset($_SESSION['player_name']); +} + +if (isset($_SESSION['player_id'])) + $inv = db::c()->query('SELECT `id`,`name`,`koll`,`img` FROM `inventory` WHERE `owner` = ?i ORDER BY `id` DESC', $_SESSION['player_id']); + +if (input::post('del')) { + $itemdel = db::c()->query('SELECT `type`,`dressed` FROM `inventory` WHERE `id`=?i', input::post('del'))->fetch_assoc(); + if ($itemdel['dressed'] == 1) { + dropitem($itemdel['type']); + if ($itemdel['type'] == 5) { + dropitem(6); + dropitem(7); + } + } + db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', input::post('del')); +} +?> + + + + + ᐰdmin + + + +

Администрирование инвентаря

+ + + + + + + + + + + + + fetch_assoc()): ?> + + + + + + + + + + +
IDНазваниеКоличествоКартинка
+
+ + +
+
'> +
+ '> + +
+
+
+ +
+
+ +
+
+ + \ No newline at end of file diff --git a/inf.php b/inf.php index 90a0131..5466c6a 100644 --- a/inf.php +++ b/inf.php @@ -1,7 +1,6 @@ "; if (!empty($user['stats'])) echo "Число неиспользованных UP-ов: " . $user['stats'] . "
"; if (!empty($user['money'])) echo "Кредитов: " . $user['money'] . "
"; @@ -127,45 +125,6 @@ if ($own['admin'] == 1) { while ($row_user_bank = $user_bank->fetch_assoc()) echo "№ " . $row_user_bank['id'] . ": " . $row_user_bank['cr'] . " кр, " . $row_user_bank['ekr'] . " екр."; } - - //TODO Вынести управляющие элементы во внешнюю админку, подальше от прецедентов. А то были случаи. - if (input::post('del')) { - $itemdel = db::c()->query('SELECT `type`,`dressed` FROM `inventory` WHERE `id`=?i', input::post('del'))->fetch_assoc(); - if ($itemdel['dressed'] == 1) { - dropitem($itemdel['type']); - if ($itemdel['type'] == 5) { - dropitem(6); - dropitem(7); - } - } - db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del); - } - - echo "

Вещи в инвентаре:

"; - echo " - - - - - - - - "; - $inv = db::c()->query('SELECT `id`,`name`,`koll`,`img` FROM `inventory` WHERE `owner` = ?i ORDER BY `id` DESC', $user['id']); - while ($row_inv = $inv->fetch_assoc()) { - echo " - - - - - - - - "; - } - echo "
IDНазваниеКоличествоКартинка
{$row_inv['id']}{$row_inv['name']}{$row_inv['koll']}
-
"; - if (isset($_POST['undress_char'])) undressall($user['id']); } ?>