game/adminion/shop_editor.php

144 lines
4.8 KiB
PHP
Raw Normal View History

<?php
# Admin Only Area
2022-06-06 21:30:34 +00:00
include('_incl_data/__config.php');
define('GAME',true);
include('_incl_data/class/__db_connect.php');
$u = User::start();
2022-06-06 21:30:34 +00:00
if(!$u->info['admin']) {
2022-06-06 21:30:34 +00:00
header('location: /index.php');
die();
}
$sid = round((int)$_GET['sid']);
$r = round((int)$_GET['r']);
?>
<!doctype html>
<html>
<head>
<meta charset="windows-1251">
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title>
<link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
</head>
<body>
2022-12-30 19:03:37 +00:00
<form method="post" action="/adminion/shop_editor.php?sid=<?=$sid.'&r='.$r?>">
2022-06-06 21:30:34 +00:00
<table width="1000" border="0" align="center" cellpadding="10" cellspacing="0">
<tr>
<td align="center"><p><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<select name="shop_id" id="shop_id" onChange="MM_jumpMenu('parent',this,0)">
<?
if( isset($_POST['additemnow']) ) {
mysql_query('INSERT INTO `items_shop` (
`item_id`,`kolvo`,`sid`,`r`,`real`
) VALUES (
"'.mysql_real_escape_string($_POST['item_add']).'","1000000000","'.$sid.'","'.$r.'","1"
)');
}
$sp = mysql_query('SELECT `sid` FROM `items_shop` GROUP BY `sid`');
while( $pl = mysql_fetch_array($sp) ) {
echo '<option ';
if( $pl['sid'] == $sid ) {
echo ' selected="selected" ';
}
echo ' value="/shop_editor.php?sid='.$pl['sid'].'&r='.$r.'">'.$pl['sid'].'</option>';
}
?>
</select>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<select name="r_id" id="r_id" onChange="MM_jumpMenu('parent',this,0)">
<?
$sp = mysql_query('SELECT `r` FROM `items_shop` WHERE `sid` = "'.mysql_real_escape_string($sid).'" GROUP BY `r`');
while( $pl = mysql_fetch_array($sp) ) {
echo '<option ';
if( $pl['r'] == $r ) {
echo ' selected="selected" ';
}
echo ' value="/shop_editor.php?sid='.$sid.'&r='.$pl['r'].'">'.$pl['r'].'</option>';
}
?>
</select>
</p>
2022-12-30 19:03:37 +00:00
<p><a href="/adminion/shop_editor.php?sid=<?=$sid?>&r=<?=$r?>"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a><br>
2022-06-06 21:30:34 +00:00
<br>
</p>
<hr>
</td>
</tr>
<tr>
<td align="center"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (id <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>): <input type="text" value="" name="item_add"> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <input type="submit" name="additemnow" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <?=$sid?>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <?=$r?>"><br><br><hr></td>
</tr>
<tr>
<td>
<?
$sp = mysql_query('SELECT * FROM `items_shop` WHERE `sid` = "'.$sid.'" AND `r` = "'.$r.'"');
while( $pl = mysql_fetch_array($sp) ) {
$itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$pl['item_id'].'" LIMIT 1'));
$del = 0;
if( isset($_POST['del'.$pl['iid'].'x'])) {
$del = 1;
mysql_query('DELETE FROM `items_shop` WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
}
if($del == 0) {
if(isset($_POST['itm_'.$pl['iid'].'_b1'])) {
$pl['kolvo'] = $_POST['itm_'.$pl['iid'].'_x'];
$pl['price_1'] = $_POST['itm_'.$pl['iid'].'_p1'];
$pl['price_2'] = $_POST['itm_'.$pl['iid'].'_p2'];
$itm['price1'] = $_POST['itm_'.$pl['iid'].'_b1'];
$itm['price2'] = $_POST['itm_'.$pl['iid'].'_b2'];
mysql_query('UPDATE `items_shop` SET
`kolvo` = "'.mysql_real_escape_string($pl['kolvo']).'",
`price_1` = "'.mysql_real_escape_string($pl['price_1']).'",
`price_2` = "'.mysql_real_escape_string($pl['price_2']).'"
WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
mysql_query('UPDATE `items_main` SET
`price1` = "'.mysql_real_escape_string($itm['price1']).'",
`price2` = "'.mysql_real_escape_string($itm['price2']).'"
WHERE `id` = "'.$itm['id'].'" LIMIT 1');
}
?>
<table name="itm_<?=$pl['iid']?>" id="itm_<?=$pl['iid']?>" width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td width="200" align="center" valign="middle">
<img src="https://img.new-combats.com/i/items/<?=$itm['img']?>"><br>
<EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>: <input value="<?=$pl['kolvo']?>" type="text" name="itm_<?=$pl['iid']?>_x"><br>
#<?=$pl['item_id']?>
<br>
<input type="submit" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
</td>
<td valign="top">
<a href="https://new-combats.com/item/<?=$itm['id']?>"><?=$itm['name']?></a><br>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <input value="<?=$itm['price1']?>" type="text" name="itm_<?=$pl['iid']?>_b1"> <EFBFBD><EFBFBD>.<br>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <input value="<?=$itm['price2']?>" type="text" name="itm_<?=$pl['iid']?>_b2"> <EFBFBD><EFBFBD><EFBFBD>.<hr>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <input value="<?=$pl['price_1']?>" type="text" name="itm_<?=$pl['iid']?>_p1"> <EFBFBD><EFBFBD>.<br>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <input value="<?=$pl['price_2']?>" type="text" name="itm_<?=$pl['iid']?>_p2"> <EFBFBD><EFBFBD><EFBFBD>.<hr>
<br><br><br><br><input type="submit" name="del<?=$pl['iid']?>x" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!)">
</td>
</tr>
</table><hr><?
}
}
?>
</td>
</tr>
</table>
</form>
</body>
</html>