<?php
session_start();
$mod_title="игра-выкинуть предмет $_GET[item]";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$mexp="";
$mm="";
$mz="";
$ms="";
$hg="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online,$exp) = mysql_fetch_row($cat))
{
$hg=$h;
$mcl=$class;
$level=$lvl;
$mm=$m;
$ms=$s;
$mz=$z;
$mexp=$exp;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
if(empty($_GET['dox']))
{
$namx="";
$query = "SELECT * FROM shop WHERE id='$_GET[item]' ORDER BY id DESC LIMIT $_pg,$_pg2";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name,$text,$s,$m,$z,$exp,$class,$mon,$gold,$h) = mysql_fetch_row($cat))
{
$namx=$name;
$i_h=$h;
$t1="ok";
$t2=$class;
$i_s=$s;
$i_m=$m;
$i_z=$z;
$i_exp=$exp;
$i_mon=$mon;
$i_gold=$gold;
}
echo "
вы действительно хотите<br>
выкинуть предмет $namx?<br>
<a href='?do=game/trash&item=$_GET[item]&dox=go'>да</a>|<a href='?do=game/index'>нет</a><br>";
}
else
{
$i_exp="";
$i_s="";
$i_m="";
$i_z="";
$i_h="";
$namx="";
$query = "SELECT * FROM shop WHERE id='$_GET[item]' ORDER BY id DESC LIMIT $_pg,$_pg2";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name,$text,$s,$m,$z,$exp,$class,$mon,$gold,$h) = mysql_fetch_row($cat))
{
$namx=$name;
$i_h=$h;
$t1="ok";
$t2=$class;
$i_s=$s;
$i_m=$m;
$i_z=$z;
$i_exp=$exp;
$i_mon=$mon;
$i_gold=$gold;
}
if($namx=="")
{
echo "
<span style='color:red'>ошибка:вещь $namx несуществует!</span><br>
";
}
else
{
$mexp=$mexp-$i_exp;
$mm=$mm-$i_m;
$ms=$ms-$i_s;
$mz=$mz-$i_z;
$hnew=$hg-$i_h;
if($mexp>0)
{
}
else
{
$mexp="0";
}
$query="UPDATE users SET s='$ms',m='$mm',z='$mz',exp='$mexp',h='$hnew' WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("<span style='color:red'>ошибка обновления параметров!</span><br>");
$idx="";
$query = "SELECT * FROM inventory WHERE name='$namx' AND login='".$_COOKIE[login]."' LIMIT 0,1";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name) = mysql_fetch_row($cat))
{
$idx=$id;
}
$query="DELETE FROM inventory WHERE name='$namx' AND id='$idx' AND login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("ошибка выкидывания!");
echo "
<span style='color:green'>вещь $namx выкинута успешно!</span><br>
";
}
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>