game/adminion/item_edit_data.php
2022-12-30 21:03:50 +02:00

34 lines
1.1 KiB
PHP

<?php
# Admin Only Area
/*
ßäðî äëÿ îáðàáîòêè äàííûõ.
Îáðàáîòêà ïîåäèíêîâ, îáðàáîòêà çàÿâîê, îáðàáîòêà áîòîâ, îáðàáîòêà ïåùåð, îáðàáîòêà òóðíèðîâ, îáðàáîòêà âðåìåííûõ ãåíåðàöèé
*/
const GAME = true;
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
$u = User::start();
if (!$u->info['admin']) {
header('location: https://new-combats.com/');
exit();
}
$itm = mysql_fetch_array(
mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = ' . (int)$_GET['edit_item_data'])
);
if (isset($itm['id'])) {
if (isset($_POST['newdata'])) {
mysql_query(
'UPDATE `items_main_data` SET `data` = "' . mysql_real_escape_string(
$_POST['newdata']
) . '" WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1'
);
die('<script>window.close();</script>');
}
echo '<form method="post" action="item_edit_data.php?edit_item_data=' . $itm['items_id'] . '"><b>Íîìåð ïðåäìåòà: ' . $itm['items_id'] . '</b><br><textarea name="newdata" rows="20" cols="100">' . $itm['data'] . '</textarea><br><input type="submit" value="Ñîõðàíèòü"></form>';
}