Файл: gamele.ru/includes/addons/admin-action/edit.php
Строк: 378
<?php
if($_POST['nickname'] != 'кому'){
$NewParams = explode("|",$_POST['nickname']);
$_POST['nickname'] = (($NewParams[0])?$NewParams[0]:$_POST['nickname']);
$GetUser = GetUser(preg_replace("/'/","",$_POST['nickname']));
$ItemDrop = mysql_fetch_assoc(mysql_query("SELECT * FROM `items` WHERE `id` = '".intval($_POST['ItemID'])."'"));
if(!empty($ItemDrop) and !empty($GetUser) and accesses($pers['id'],'editor')){
$prarams = explode("|",$ItemDrop['param']);
foreach ($prarams as $value) {
$stat=explode("@",$value);
switch($stat[0]){
case'2':
$dolg=$stat[1];
break;
}
}
mysql_query("INSERT INTO `invent` (`ItemName`,`img`,`protype`,`pl_id`,`dolg`,`price`,`dprice`,`i_param`,`i_need`) VALUES ('".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."','".$ItemDrop['gif']."','".$ItemDrop['id']."','".$GetUser['id']."','".$dolg."','".$ItemDrop['price']."','".$ItemDrop['dprice']."','".(($NewParams[2])?'0@'.$NewParams[2].'|':'').$ItemDrop['param']."','".$ItemDrop['need']."');");
chmsg("<font class=chattime> ".date("H:i:s")." </font><font color=000000><b><font color=#cc0000>Внимание!</font></b> Вы получили в подарок "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>" от администратора (<b>".$pers['login']."</b>).</font>",$GetUser['login']);
echo"<center>Вы удачно подарили "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>" персонажу <b>".$GetUser['login']."</b>.</center>";
}
}
if($_POST['glavnickname'] != 'кому'){
$NewParams = explode("|",$_POST['glavnickname']);
$_POST['glavnickname'] = (($NewParams[0])?$NewParams[0]:$_POST['glavnickname']);
$GetUser = GetUser(preg_replace("/'/","",$_POST['glavnickname']));
$ItemDrop = mysql_fetch_assoc(mysql_query("SELECT * FROM `items` WHERE `id` = '".intval($_POST['ItemID'])."'"));
if(!empty($ItemDrop) and !empty($GetUser) and accesses($pers['id'],'editor')){
$prarams = explode("|",$ItemDrop['param']);
foreach ($prarams as $value) {
$stat=explode("@",$value);
switch($stat[0]){
case'2':
$dolg=$stat[1];
break;
}
}
mysql_query("INSERT INTO `invent` (`ItemName`,`img`,`protype`,`pl_id`,`cl_id`,`dolg`,`price`,`dprice`,`i_param`,`i_need`,`gift`) VALUES ('".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."','".$ItemDrop['gif']."','".$ItemDrop['id']."','".$GetUser['id']."','".$_POST['clanname']."','".$dolg."','".$ItemDrop['price']."','".$ItemDrop['dprice']."','".(($NewParams[2])?'0@'.$NewParams[2].'|':'').$ItemDrop['param']."','".$ItemDrop['need']."','Подарок от Мастера Создателя');");
chmsg("<font class=chattime> ".date("H:i:s")." </font><font color=000000><b><font color=#cc0000>Внимание!</font></b> Вы получили в подарок "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>" от администратора (<b>".$pers['login']."</b>).</font>",$GetUser['login']);
echo"<center>Вы удачно подарили "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>" персонажу <b>".$GetUser['login']."</b>.</center>";
}
}
if($_POST['bots'] != 'бот'){
$NewParams = explode("|",$_POST['bots']);
$_POST['bots'] = (($NewParams[0])?$NewParams[0]:$_POST['bots']);
$ItemDrop = mysql_fetch_assoc(mysql_query("SELECT * FROM `items` WHERE `id` = '".intval($_POST['ItemID'])."'"));
if(!empty($ItemDrop) and accesses($pers['id'],'editor')){
$prarams = explode("|",$ItemDrop['param']);
foreach ($prarams as $value) {
$stat=explode("@",$value);
switch($stat[0]){
case'2':
$dolg=$stat[1];
break;
}
}
mysql_query("INSERT INTO `invent` (`ItemName`,`img`,`protype`,`pl_id`,`dolg`,`price`,`dprice`,`i_param`,`i_need`,`used`,`curslot`) VALUES ('".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."','".$ItemDrop['gif']."','".$ItemDrop['id']."','".$_POST['bots']."','".$dolg."','".$ItemDrop['price']."','".$ItemDrop['dprice']."','".(($NewParams[2])?'0@'.$NewParams[2].'|':'').$ItemDrop['param']."','".$ItemDrop['need']."','1','".$_POST['slot']."')");
CalcStats($_POST['bots']);
echo"<center>Успешно передана "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>" боту <b>".$GetUser['login']."</b>.</center>";
}
}
if($_POST['deleditor']){
$NewParams = explode("|",$_POST['deleditor']);
$_POST['deleditor'] = (($NewParams[0])?$NewParams[0]:$_POST['deleditor']);
$GetUser = GetUser(preg_replace("/'/","",$_POST['glavnickname']));
$ItemDrop = mysql_fetch_assoc(mysql_query("SELECT * FROM `items` WHERE `id` = '".intval($_POST['ItemID'])."'"));
mysql_query("DELETE FROM `items` WHERE `id`='".intval($_POST['ItemID'])."' LIMIT 1;");
echo"<center>Вы удачно Удалили "<b>".(($NewParams[1])?$NewParams[1]:$ItemDrop['name'])."</b>"</b>.</center>";
}
function blocks($bl){
if($bl!=""){
switch($bl){
case 40:
return" <b><font color=#cc0000>Блокировка 1-ой точки</font></b><br>";
break;
case 70:
return" <b><font color=#cc0000>Блокировка 2-х точек</font></b><br>";
break;
case 90:
return" <b><font color=#cc0000>Блокировка 3-х точек</font></b><br>";
break;
}
}
}
if(!empty($_GET['FilterLevelsClear'])){
$_SESSION['admin_filters'] = '';
}
if(!empty($_POST['FilterLevels'])){
$_SESSION['admin_filters'] = intval($_POST['FilterLevels']);
}
$Filters = '';
if(!empty($_SESSION['admin_filters'])){
$Filters = " AND `level`='".$_SESSION['admin_filters']."'";
}
$count = mysql_num_rows(mysql_query("SELECT * FROM `items`"));
$GetItems = mysql_query("SELECT * FROM `items` WHERE `type`='".preg_replace('/[^w0-9]/','',$_GET["wca"])."'".$Filters."");
$clans=mysql_query("SELECT * FROM `clans`;");
echo'<table cellpadding="3" cellspacing="2" border="0" align="center" width="760">
<tr>
<td align="center"><a href="?useaction=admin-action&addid=edit&wca=w4"><img src="http://image.gamele.ru/gameplay/invent/cat/0.gif" width="44" height="53" title="Ножи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w1"><img src="http://image.gamele.ru/gameplay/invent/cat/1.gif" width="41" height="53" title="Мечи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w2"><img src="http://image.gamele.ru/gameplay/invent/cat/2.gif" width="41" height="53" title="Топоры" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w3"><img src="http://image.gamele.ru/gameplay/invent/cat/3.gif" width="41" height="53" title="Дробящие" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w6"><img src="http://image.gamele.ru/gameplay/invent/cat/4.gif" width="41" height="53" title="Алебарды и копья" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w7"><img src="http://image.gamele.ru/gameplay/invent/cat/6.gif" width="41" height="53" title="Посохи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w20"><img src="http://image.gamele.ru/gameplay/invent/cat/7.gif" width="41" height="53" title="Щиты" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w18"><img src="http://image.gamele.ru/gameplay/invent/cat/10.gif" width="41" height="53" title="Кольчуги" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w19"><img src="http://image.gamele.ru/gameplay/invent/cat/11.gif" width="41" height="53" title="Доспехи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w23"><img src="http://image.gamele.ru/gameplay/invent/cat/8.gif" width="41" height="53" title="Шлемы" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w21"><img src="http://image.gamele.ru/gameplay/invent/cat/14.gif" width="41" height="53" title="Сапоги" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w26"><img src="http://image.gamele.ru/gameplay/invent/cat/9i.gif" width="44" height="53" title="Пояса" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w24"><img src="http://image.gamele.ru/gameplay/invent/cat/12.gif" width="41" height="53" title="Перчатки" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w80"><img src="http://image.gamele.ru/gameplay/invent/cat/13.gif" width="41" height="53" title="Наручи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w25"><img src="http://image.gamele.ru/gameplay/invent/cat/15.gif" width="41" height="53" title="Кулоны" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w22"><img src="http://image.gamele.ru/gameplay/invent/cat/16.gif" width="41" height="53" title="Кольца" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w28"><img src="http://image.gamele.ru/gameplay/invent/cat/17.gif" width="41" height="53" title="Свитки" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w27"><img src="http://image.gamele.ru/gameplay/invent/cat/21.gif" width="41" height="53" title="Зелья" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w85"><img src="http://image.gamele.ru/gameplay/invent/cat/85.gif" width="41" height="53" title="Сумки лекаря" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w61"><img src="http://image.gamele.ru/gameplay/invent/9.gif" width="41" height="53" title="Другое" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w69"><img src="http://image.gamele.ru/gameplay/invent/2.gif" width="41" height="53" title="Рыбалка" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w68"><img src="http://image.gamele.ru/gameplay/invent/4.gif" width="41" height="53" title="Лесоруб" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w66"><img src="http://image.gamele.ru/gameplay/invent/1.gif" width="41" height="53" title="Травы/Серпы" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w71"><img src="http://image.gamele.ru/gameplay/invent/1.gif" width="41" height="53" title="Алхимия/Алхимический инвентарь" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w70"><img src="http://image.gamele.ru/gameplay/invent/7.gif" width="41" height="53" title="Квестовые Вещи" class="cath" border="0" /></a><a href="?useaction=admin-action&addid=edit&wca=w72"><img src="http://image.gamele.ru/gameplay/invent/cat/17.gif" width="41" height="53" title="Профессиональные свитки" class="cath" border="0" /></a></td>
</tr>
<tr>
<td><table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#e0e0e0"><table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr>
<td colspan="2" bgcolor="#F9f9f9"><div align="center"><font class="inv"> В этом разделе <b>'.mysql_num_rows($GetItems).'</b> из <b>'.$count.'</b> вещей.</font><br /><form method="POST">Level: <select name="FilterLevels">';
for($i=0;$i<31;$i++){
echo'<option value="'.$i.'">'.$i.'</option>';
}
echo'</select><input type="submit" class="lbut" value="показать"><a href="?useaction=admin-action&addid=edit&wca='.preg_replace('/[^w0-9]/','',$_GET["wca"]).'&FilterLevelsClear=Yes">очистить</a></form></div></td>
</tr>';
while($row = mysql_fetch_assoc($GetItems)){
$need=explode("|",$row['need']);
$bt=0;$tr_b='';$m=1;
foreach ($need as $value){
$treb=explode("@",$value);
include($_SERVER["DOCUMENT_ROOT"]."/includes/addons/admin-action/edit/sp_treb.php");
}
echo' <form method="post"><tr>
<td bgcolor="#f9f9f9"><div align="center"><img src="http://image.gamele.ru/weapon/'.$row['gif'].'" border="0" /><br />
<img src="http://image.gamele.ru/1x1.gif" width="62" height="1" /></td>
<td width="100%" bgcolor="#ffffff" valign="top"><table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#ffffff" width="100%"><font class=nickname><b>'.((accesses($pers['id'],'editor'))?'<input name="nickname" class="lbut" type="text" onblur="if (value == '') {value='кому'}" onfocus="if (value == 'кому') {value = ''}" value="кому" /><input type="hidden" name="ItemID" value="'.$row['id'].'" /><input type="submit" class="lbut" value="Выдать" />':'').' '.((accesses($pers['id'],'editor'))?'<input name="bots" class="lbut" type="text" onblur="if (value == '') {value='бот'}" onfocus="if (value == 'бот') {value = ''}" value="бот" /><input type="hidden" name="ItemID" value="'.$row['id'].'" /><select name="slot" class="lbut">
<option value="0">Нельзя одеть</option>
<option value="1">Шлем</option>
<option value="2">Ожерелье</option>
<option value="3">Оружие</option>
<option value="4">Пояс</option>
<option value="5">Содержимое карманов пояса</option>
<option value="8">Сапоги</option>
<option value="11">Наручи</option>
<option value="12">Перчатки</option>
<option value="13">Щит</option>
<option value="14">Кольцо</option>
<option value="16">Доспех</option>
<option value="17">Кольчуга</option>
</select><input type="submit" class="lbut" value="Выдать" />':'').' </br> '.((accesses($pers['id'],'clans'))?'<input name="glavnickname" class="lbut" type="text" onblur="if (value == '') {value='кому'}" onfocus="if (value == 'кому') {value = ''}" value="кому" /><input name="clanname" class="lbut" type="text" onblur="if (value == '') {value='ID клана'}" onfocus="if (value == 'ID клана') {value = ''}" value="ID клана" /><input type="hidden" name="ItemID" value="'.$row['id'].'" /><input type="submit" class="lbut" value="Выдать клану" /><input name="deleditor" type="submit" class="lbut" value="Удалить" />':'').' <br>'.$row['name'].' </b> ID вещи: '.$row['id'].'</font><br />
<img src="http://image.gamele.ru/1x1.gif" width="1" height="3" /></td>
<td><br />
<img src="http://image.gamele.ru/1x1.gif" width="1" height="3" /></td>
</tr>
<tr>
<td colspan="2" width="100%"><table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#D8CDAF" width="50%"><div align="center"><font class=invtitle>свойства</font></div></td>
<td bgcolor="#B9A05C"><img src="http://image.gamele.ru/1x1.gif" width="1" height="1" /></td>
<td bgcolor="#D8CDAF" width="50%"><div align="center"><font class=invtitle>требования</font></div></td>
</tr>
<tr>
<td bgcolor="#FCFAF3"><font class=weaponch>'.(($row['slot']==16)?' <b><font color=#cc0000>Можно одевать на кольчуги</font></b><br>':'').blocks($row['block']).' Цена: <b>'.$row['price'].' ER'.(($row['dprice'])?' | '.$row['dprice'].' $':'').''.(($row['dcat']=='99')?' | '.$row['price'].' DPV':'').'</b><br />';
$modstat='';
foreach ($mod as $value){
$modstats=explode("@",$value);
$modstat[$modstats[0]]=$modstats[1];
}
$par=explode("|",$row['param']);
foreach ($par as $value){
$stat=explode("@",$value);
if($stat[1]>0){$plus = "+";}else{$plus ="";}
include($_SERVER["DOCUMENT_ROOT"]."/includes/addons/admin-action/edit/sp_stat.php");
}
$dmod=explode("@",$row['damage_mod']);
include($_SERVER["DOCUMENT_ROOT"]."/inc/sp_dmods.php");
echo'</font></td>
<td bgcolor="#B9A05C"><img src="http://image.gamele.ru/1x1.gif" width="1" height="1" /></td>
<td bgcolor="#FCFAF3"><font class=weaponch>'.$tr_b.'</font></td>
</tr>
</table></td>
</tr>
</table></td>
</tr></form>';
}
echo'</table></td>
</tr>
</table></td>
</tr>
</table>';
?>