game/dn_editor_bots_itms.php

87 lines
3.2 KiB
PHP

<?php
# Admin Only Area
function GetRealIp()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
define('IP', GetRealIp());
const GAME = true;
include_once('_incl_data/__config.php');
include_once('_incl_data/class/__db_connect.php');
$u = User::start();
if (!$u->info['admin']) {
die('<meta http-equiv="refresh" content="0; URL=https://new-combats.com/">');
}
?>
<form method="post" action="?gotonew">
id áîòà: <input name="id_bot" value="<?= $_POST['id_bot'] ?>"><br>
<input type="submit" value="Ïåðåéòè">
</form>
--------------- Áîò -------------<br>
<?php
$pl = mysql_fetch_array(
mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . mysql_real_escape_string($_POST['id_bot']) . '" LIMIT 1')
);
if (isset($pl['id'])) {
if (isset($_GET['save'])) {
mysql_query(
'UPDATE `test_bot` SET
`login` = "' . mysql_real_escape_string($_POST['login']) . '",
`obraz` = "' . mysql_real_escape_string($_POST['obraz']) . '",
`level` = "' . mysql_real_escape_string($_POST['level']) . '",
`sex` = "' . mysql_real_escape_string($_POST['sex']) . '",
`name` = "' . mysql_real_escape_string($_POST['name']) . '",
`agressor` = "' . mysql_real_escape_string($_POST['agressor']) . '",
`expB` = "' . mysql_real_escape_string($_POST['expB']) . '",
`stats` = "' . mysql_real_escape_string($_POST['stats']) . '",
`itemsUse` = "' . mysql_real_escape_string($_POST['itemsUse']) . '",
`p_items` = "' . mysql_real_escape_string($_POST['p_items']) . '" WHERE `id` = "' . $pl['id'] . '"
LIMIT 1'
);
$pl = mysql_fetch_array(
mysql_query(
'SELECT * FROM `test_bot` WHERE `id` = "' . mysql_real_escape_string($_POST['id_bot']) . '" LIMIT 1'
)
);
}
?>
<form method="post" action="?gotonew&save"><input type="hidden" name="id_bot" value="<?= $_POST['id_bot'] ?>">
Ëîãèí: <input name="login" value="<?= $pl['login'] ?>"><br/>
Îáðàç: <input name="obraz" value="<?= $pl['obraz'] ?>"><br/>
Óðîâåíü: <input name="level" value="<?= $pl['level'] ?>"><br/>
Ïîë: <input name="sex" value="<?= $pl['sex'] ?>"> (0 - ìóæ. , 1 - æåí.)<br/>
Èìÿ: <input name="name" value="<?= $pl['name'] ?>"><br/>
Àãðåññèÿ: <input name="agressor" value="<?= $pl['agressor'] ?>"> (0-100%)<br/>
Îïûò (%): <input name="expB" value="<?= $pl['expB'] ?>"><br/>
Ñòàòû:<br/>
<textarea rows="5" cols="75" name="stats"><?= $pl['stats'] ?></textarea>
<br/>
Ïðåäìåòû (íà áîòå, 2605 - èñïîëüçóåò ïðèåìû. Ïåðå÷èñëÿòü ÷ðååç çàïÿòóþ id ïðåäìåòà):<br/>
<textarea rows="5" cols="75" name="itemsUse"><?= $pl['itemsUse'] ?></textarea>
<br/>
Ïðåäìåòû êîòîðûå ïàäàþò ñ áîòà:<br/>
<textarea rows="5" cols="75" name="p_items"><?= $pl['p_items'] ?></textarea>
<br><input type="submit" value="Ñîõðàíèòü"></form>
<?php
} elseif (isset($_POST['id_bot'])) {
echo 'Áîò íå íàéäåí';
}