398 lines
23 KiB
PHP
398 lines
23 KiB
PHP
|
<?php
|
|||
|
session_start();
|
|||
|
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
|
|||
|
include("config.php");
|
|||
|
include("functions.php");
|
|||
|
if($user['battle'] != 0) { header('location: fbattle.php'); die(); }
|
|||
|
|
|||
|
$roww = mysql_fetch_array(mysql_query("SELECT * FROM `trade` WHERE `baer` = {$user['id']} ORDER BY `baer` DESC LIMIT 1"));
|
|||
|
|
|||
|
if($_GET['undate']) {
|
|||
|
mysql_query('DELETE FROM `trade` WHERE `baer` = "'.$user['id'].'" ORDER BY `baer` DESC LIMIT 1');
|
|||
|
addchp('<font color=red>Внимание!</font> Персонаж "'.$user['login'].'" отказался от вашего предложения о продаже предметов.', '{[]}'.$roww['login'].'{[]}');
|
|||
|
header('Location: main.php');
|
|||
|
}
|
|||
|
|
|||
|
?>
|
|||
|
<HTML>
|
|||
|
<HEAD>
|
|||
|
<link rel=stylesheet type="text/css" href="css/main.css">
|
|||
|
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
|
|||
|
<META Http-Equiv=Cache-Control Content=no-cache>
|
|||
|
<meta http-equiv=PRAGMA content=NO-CACHE>
|
|||
|
<META Http-Equiv=Expires Content=0>
|
|||
|
<script src='js/commoninf.js'></script>
|
|||
|
<script>
|
|||
|
var Hint3Name = '';
|
|||
|
function findlogin(title, script, name){
|
|||
|
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
|
|||
|
'<form action="'+script+'" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><td colspan=2>'+
|
|||
|
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="'+name+'"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
|
|||
|
document.all("hint3").style.visibility = "visible";
|
|||
|
document.all("hint3").style.left = 100;
|
|||
|
document.all("hint3").style.top = 100;
|
|||
|
document.all(name).focus();
|
|||
|
Hint3Name = name;
|
|||
|
Hint3Closed = false;
|
|||
|
}
|
|||
|
|
|||
|
function returned2(s) {
|
|||
|
if(top.oldlocation != '') {
|
|||
|
top.frames['main'].location = top.oldlocation+'?'+s+'tmp='+Math.random(); top.oldlocation = '';
|
|||
|
} else {
|
|||
|
top.frames['main'].location = 'main.php?edit='+Math.random();
|
|||
|
}
|
|||
|
}
|
|||
|
<?
|
|||
|
$step = 1;
|
|||
|
if($step == 1) { $idkomu = 0; }
|
|||
|
?>
|
|||
|
function closehint3() {
|
|||
|
document.all("hint3").style.visibility = "hidden";
|
|||
|
Hint3Name = '';
|
|||
|
}
|
|||
|
|
|||
|
var transfersale = true;
|
|||
|
<?
|
|||
|
|
|||
|
if(@!$_REQUEST['razdel']) { $_REQUEST['razdel'] = 1; }
|
|||
|
|
|||
|
if(@$_REQUEST['FindLogin']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT `id`, `level`, `room`, `align`, (SELECT `id` FROM `online` WHERE `date` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` ='".mysql_escape_string($_REQUEST['FindLogin'])."'"));
|
|||
|
$step = 3;
|
|||
|
}
|
|||
|
|
|||
|
if(@$_REQUEST['to_id']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT `id`, `level`, `room`, `align`, (SELECT `id` FROM `online` WHERE `online`.`date` >= ".(time()-60)." AND `online`.`id` = `users`.`id`) AS `online` FROM `users` WHERE `id` ='".mysql_escape_string($_REQUEST['to_id'])."'"));
|
|||
|
$step = 3;
|
|||
|
}
|
|||
|
|
|||
|
if(@$step == 3) {
|
|||
|
$step = 0;
|
|||
|
$id_person_x = $res['id'];
|
|||
|
if(@!$id_person_x) $mess='Персонаж не найден';
|
|||
|
elseif ($id_person_x==$user['id']) $mess='Незачем передавать самому себе';
|
|||
|
elseif ($res['align']==4) $mess='Со склонностью хаос передачи предметов запрещены';
|
|||
|
elseif ($user['align']==4) $mess='Со склонностью хаос передачи предметов запрещены';
|
|||
|
elseif ($res['online']<1) $mess='Персонаж не онлайн';
|
|||
|
elseif ($res['room']!=$user['room']) $mess='Вы должны находиться в одной комнате с тем кому хотите передать вещи';
|
|||
|
elseif ($res['level']<4) $mess='К персонажам до 4-го уровня передачи предметов запрещены';
|
|||
|
elseif ($user['level']<4) $mess='Персонажам до 4-го уровня передачи предметов запрещены';
|
|||
|
else {
|
|||
|
$idkomu=$id_person_x;
|
|||
|
$komu = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` ='".$idkomu."';"));
|
|||
|
$mess = $_REQUEST['FindLogin'];
|
|||
|
$step = 3;
|
|||
|
}
|
|||
|
}else $mess='К персонажам до 4-го уровня передачи предметов запрещены';
|
|||
|
|
|||
|
if ($step==3) {
|
|||
|
if ($_REQUEST['setkredit']>0 && $_REQUEST['to_id'] && $_REQUEST['sd4']==$user['id'] ) {
|
|||
|
$_REQUEST['setkredit'] = round($_REQUEST['setkredit'],2);
|
|||
|
if ($user['money']<$_REQUEST['setkredit']) $mess="Недостаточно денег";
|
|||
|
else {
|
|||
|
if ((mysql_query("UPDATE `users` set money=money-".strval($_REQUEST['setkredit'])." where id='".$user['id']."'")) && (mysql_query("UPDATE `users` set money=money+".strval($_REQUEST['setkredit'])." where id='".$idkomu."'"))) {
|
|||
|
$mess='Удачно переданы '.strval($_REQUEST['setkredit']).' кр к персонажу '.$komu['login'];
|
|||
|
addchp ('<font color=red>Внимание!</font> Персонаж "'.$user['login'].'" передал вам <B>'.strval($_REQUEST['setkredit']).' кр</B>. ','{[]}'.$komu['login'].'{[]}');
|
|||
|
mysql_query("INSERT INTO `delo`(`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$_SESSION['uid']}','Переведены кредиты ".strval($_REQUEST['setkredit'])." от \"".$user['login']."\" к \"".$komu['login']."\"','1','".time()."');");
|
|||
|
mysql_query("INSERT INTO `delo`(`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$idkomu}','Переведены кредиты ".strval($_REQUEST['setkredit'])." от \"".$user['login']."\" к \"".$komu['login']."\"','1','".time()."');");
|
|||
|
$user['money']-=$_REQUEST['setkredit'];
|
|||
|
}
|
|||
|
else {
|
|||
|
$mess='Произошла ошибка!';
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
if ($_REQUEST['setobject'] && $_REQUEST['to_id'] && !$_REQUEST['gift'] && $_REQUEST['sd4']==$user['id'] && $_GET['s4i']==$user['sid']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `id` = '{$_REQUEST['setobject']}' AND dressed=0 AND `setsale` = 0 AND `present` = '' AND `artefact` = 0 LIMIT 1;"));
|
|||
|
if (!$res['id']) $mess="Предмет не найден в рюкзаке";
|
|||
|
elseif ($res['dressed']!=0) $mess="Сначала необходимо снять предмет с себя.";
|
|||
|
elseif ($user['money'] < 1*$res['koll']) $mess='Недостаточно денег на оплату передачи';
|
|||
|
else {
|
|||
|
$kols = ''; $sum = 1;
|
|||
|
$value=$res;
|
|||
|
if($value['koll']) {
|
|||
|
$sum = 1*$value['koll'];
|
|||
|
$kols = '(x'.$value[''].')';
|
|||
|
}
|
|||
|
if (@$value['present']) $mess='Нельзя передавать подарки';
|
|||
|
else{
|
|||
|
$mto = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '$idkomu' AND `dressed` = 0 AND `setsale` = 0; "));
|
|||
|
$u = $user;
|
|||
|
$user['id'] = $idkomu;
|
|||
|
$allmass = get_meshok_to($idkomu);
|
|||
|
$user = $u;
|
|||
|
|
|||
|
$newmass=$mto[0]+$res['massa'];
|
|||
|
if ($newmass<=$allmass) {
|
|||
|
if ((mysql_query("UPDATE `users` SET `money` = `money`-$sum WHERE `id` = '".$user['id']."' LIMIT 1")) && (mysql_query("update `inventory` set `owner` = ".$komu['id']." where `id`='".$res['id']."' and `owner`= '".$user['id']."';"))) {
|
|||
|
if (($user['room'] < 501) || ($user['room'] > 560)) {
|
|||
|
mysql_query("INSERT INTO `delo`(`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$_SESSION['uid']}','Передан предмет \"".$res['name']."\" $kols id:(cap".$res['id'].") [".$res['duration']."/".$res['maxdur']."] от \"".$user['login']."\" к \"".$komu['login']."\", налог $sum кр.','1','".time()."');");
|
|||
|
mysql_query("INSERT INTO `delo`(`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$idkomu}','Передан предмет \"".$res['name']."\" $kols id:(cap".$res['id'].") [".$res['duration']."/".$res['maxdur']."] от \"".$user['login']."\" к \"".$komu['login']."\", налог $sum кр.','1','".time()."');");
|
|||
|
}
|
|||
|
$mess='Удачно передано "'.$value['name'].'" '.$kols.' к персонажу '.$komu['login'];
|
|||
|
addchp ('<font color=red>Внимание!</font> Персонаж "'.$user['login'].'" передал вам "'.$value['name'].' '.$kols.'". ','{[]}'.$komu['login'].'{[]}');
|
|||
|
$user['money']-=$sum;
|
|||
|
}
|
|||
|
else {
|
|||
|
$mess='Произошла ошибка!';
|
|||
|
}
|
|||
|
}
|
|||
|
else {
|
|||
|
$mess='У персонажа "'.$komu['login'].'" переполнен рюкзак!';
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
if ($_REQUEST['setobject'] && $_REQUEST['to_id'] && $_REQUEST['gift'] && $_REQUEST['sd4']==$user['id'] && $_GET['s4i']==$user['sid']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `id` = '{$_REQUEST['setobject']}' AND dressed=0 AND `setsale` = 0 AND `present` = '' AND `artefact` = 0 LIMIT 1;"));
|
|||
|
if (!$res['id']) $mess="Предмет не найден в рюкзаке";
|
|||
|
elseif ($res['dressed']!=0) $mess="Сначала необходимо снять предмет с себя.";
|
|||
|
else {
|
|||
|
$value=$res;
|
|||
|
if (@$value['present']) $mess='Нельзя передавать подарки';
|
|||
|
else{
|
|||
|
$mto = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '$idkomu' AND `dressed` = 0 AND `setsale` = 0; "));
|
|||
|
|
|||
|
$u = $user;
|
|||
|
$user['id'] = $idkomu;
|
|||
|
$allmass=get_meshok_to($idkomu);
|
|||
|
$user = $u;
|
|||
|
|
|||
|
$newmass=$mto[0]+$res['massa'];
|
|||
|
if ($newmass<=$allmass) {
|
|||
|
if (mysql_query("update `inventory` set `present` = '{$user['login']}' ,`owner` = ".$komu['id']." where `id`='".$res['id']."' and `owner`= '".$user['id']."';")) {
|
|||
|
addchp ('<font color=red>Внимание!</font> Персонаж "'.$user['login'].'" подарил вам "'.$value['name'].'"</B>. ','{[]}'.$komu['login'].'{[]}');
|
|||
|
if (($user['room'] < 501) || ($user['room'] > 560)) {
|
|||
|
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','Подарен предмет \"".$res['name']."\" id:(cap".$res['id'].") [".$res['duration']."/".$res['maxdur']."] от \"".$user['login']."\" к \"".$komu['login']."\"','1','".time()."');");
|
|||
|
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$idkomu}','Подарен предмет \"".$res['name']."\" id:(cap".$res['id'].") [".$res['duration']."/".$res['maxdur']."] от \"".$user['login']."\" к \"".$komu['login']."\"','1','".time()."');");
|
|||
|
}
|
|||
|
$mess='Удачно подарен предмет "'.$value['name'].'" персонажу '.$komu['login'];
|
|||
|
}
|
|||
|
else {
|
|||
|
$mess='Произошла ошибка!';
|
|||
|
}
|
|||
|
}
|
|||
|
else {
|
|||
|
$mess='У персонажа "'.$komu['login'].'" переполнен рюкзак!';
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if ($_REQUEST['cost'] > 0 && $_REQUEST['to_id']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `artefact` = 0 AND `id` = '{$_REQUEST['id_th']}' LIMIT 1;"));
|
|||
|
if (!$res['id']) $mess="Предмет не найден в рюкзаке";
|
|||
|
elseif ($res['dressed']!=0) $mess="Сначала необходимо снять предмет.";
|
|||
|
else {
|
|||
|
$value=$res;
|
|||
|
if (@$value['present']) $mess='Нельзя передавать подарки';
|
|||
|
else{
|
|||
|
$row = $res;
|
|||
|
$row['count'] = 1;
|
|||
|
$re .= "<table width=100%><tr><td align=center><img src=\"i/sh/{$row['img']}\" /><br /></td>";
|
|||
|
$re .= "<td valign=top>";
|
|||
|
showitem ($row);
|
|||
|
$re .= "</td></tr></table>";
|
|||
|
$re = str_replace(array("\r", "\r\n", "\n"), "", $re);
|
|||
|
$mess = 'Предложение персонажу '.$komu['login'].' сделано.';
|
|||
|
mysql_query("update `inventory` set `tradesale` = ".$_REQUEST['cost']." where `id`='".$res['id']."' and `owner`= '".$res['owner']."';");
|
|||
|
mysql_query("INSERT INTO `trade`(`to_id` ,`login` ,`txt` ,`kr` ,`id` ,`baer` ) VALUES
|
|||
|
('{$_SESSION['uid']}','{$user['login']}','".$re."',{$_REQUEST['cost']},'{$_REQUEST['id_th']}',{$_REQUEST['to_id']});");
|
|||
|
addchp('<font color=red>Внимание!</font> Персонаж "'.$user['login'].'", предлагает Вам совершить сделку. <a href="javascript:void(0);" onclick="cht_s()">подтвердить</a>/<a href="javascript:void(0);" onclick="chts()">отказать</a>. ','{[]}'.$komu['login'].'{[]}');
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
if ($_REQUEST['transfersale'] && $_REQUEST['to_id']) {
|
|||
|
$res = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `owner` = '{$_REQUEST['to_id']}' AND `id` = '{$_REQUEST['transfersale']}' AND `artefact` = 0 LIMIT 1;"));
|
|||
|
if($user['money'] < $res['tradesale']) {
|
|||
|
$mess ='<font color=red><b>Недостаточно денег</b></font>';
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
mysql_query("update `inventory` set `owner` = ".$user['id']." where `id`='".$res['id']."' and `owner`= '".$res['owner']."';");
|
|||
|
mysql_query("update `users` set `money`=`money`-{$res['tradesale']} where `id`='".$user['id']."'");
|
|||
|
mysql_query("update `users` set `money`=`money`+{$res['tradesale']} where `id`='{$_REQUEST['to_id']}'");
|
|||
|
if (($user['room'] < 501) || ($user['room'] > 560)) {
|
|||
|
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','Продажа за {$res['tradesale']}кр ID:".$res['id']." к ".$idkomu."',1,'".time()."');");
|
|||
|
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$idkomu}','Продажа за {$res['tradesale']}кр ID:".$res['id']." от ".$_SESSION['uid']."',1,'".time()."');");
|
|||
|
}
|
|||
|
$mess='Удачно куплено "'.$res['name'].'" персонажу '.$komu['login'];
|
|||
|
$mess2='Удачно куплено "'.$res['name'].'" персонажeм '.$user['login'];
|
|||
|
addchp ('<font color=red>Внимание!</font> '.$mess2,'{[]}'.$komu['login'].'{[]}');
|
|||
|
$user['money']-=$res['tradesale'];
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
function findmoney(title, script, name, obj){
|
|||
|
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
|
|||
|
'<form action="'+script+'" method=get><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=id_th value="'+obj+'"><INPUT TYPE=hidden name=to_id value="<? echo @$komu['id']; ?>"><td colspan=2>'+
|
|||
|
'Укажите cумму:<small></TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="'+name+'"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
|
|||
|
document.all("hint3").style.visibility = "visible";
|
|||
|
document.all("hint3").style.left = 100;
|
|||
|
document.all("hint3").style.top = 100;
|
|||
|
document.all(name).focus();
|
|||
|
Hint3Name = name;
|
|||
|
}
|
|||
|
|
|||
|
var tologin = '<? echo @($step==3?$komu['login']:''); ?>';
|
|||
|
|
|||
|
function Sale(to_id, name, n, txt, transfer_kredit) {
|
|||
|
var s = prompt("Продать \""+txt+"\" к \""+tologin+"\". Укажите цену:", '');
|
|||
|
if(s != null && s!= '') {
|
|||
|
if(confirm("Продать \""+txt+"\" к \""+tologin+"\" за "+parseFloat(s)+" кр. Вы заплатите "+transfer_kredit+"кр. за передачу! Ваш партнер по сделке должен открыть у себя окно обмена. Продолжить?")) {
|
|||
|
location = "/main.php?to_id="+to_id+"&setobject="+name+"&n="+n+"&s4i=<?=$user['sid']?>&sale="+s+"&sd4=<? echo @$user['id']; ?>&0.760742158507544";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function transfer(to_id, login, txt, kredit, id, destiny){
|
|||
|
document.getElementById("hint3").innerHTML = '<table width=500 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>Продажа предмета</td></tr><tr><td>'+
|
|||
|
'<form action="give.php" method=get><table width=100% cellspacing=0 cellpadding=5 bgcolor=FFF6DD><tr><td><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><INPUT TYPE=hidden name=FindLogin value=0><INPUT TYPE=hidden name=to_id value="'+to_id+'"><INPUT TYPE=hidden name=transfersale value="'+id+'">'+
|
|||
|
'<b>'+login+'</b> <a href="inf.php?'+to_id+'" target=_blank><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11></a> предлагает Вам купить предмет:<BR>'+
|
|||
|
txt+'<BR>за <font color=red><b>'+kredit+' кр.</b></font><BR>Проводим сделку?</TD></TR><TR><TD align=center><INPUT TYPE=submit '+(destiny?" onclick='return confirm(\"Этот предмет может использовать только "+destiny+" Вы уверены, что хотите его купить?\")'":"")+' value=" ДА "> <INPUT TYPE=button value=" НЕТ " onclick="location.href=\'main.php\'"></TD></TR></TABLE></FORM></td></tr></table>';
|
|||
|
document.getElementById("hint3").style.visibility = "visible";
|
|||
|
document.getElementById("hint3").style.left = 100;
|
|||
|
document.getElementById("hint3").style.top = 60;
|
|||
|
}
|
|||
|
|
|||
|
function reloadit() {
|
|||
|
if(tologin != '') {
|
|||
|
location = "give.php?FindLogin=0&to_id=<? echo $idkomu; ?>&sd4=<? echo $user['id']; ?>&0.760742158507544";
|
|||
|
}
|
|||
|
}
|
|||
|
</script>
|
|||
|
</HEAD>
|
|||
|
<body bgcolor=e2e0e0><div id=hint3 class=ahint></div><div id=hint4 class=ahint></div>
|
|||
|
<H3>Передача предметов/кредитов другому игроку</H3>
|
|||
|
<TABLE width=100% cellspacing=0 cellpadding=0>
|
|||
|
<TR><TD>
|
|||
|
<? if ($step==3) {
|
|||
|
echo 'К кому передавать:<font color=red>'.nick3($komu['id']).'</font>';// <SCRIPT>drwfl("'.@$komu['login'].'",'.@$komu['id'].',"'.@$komu['level'].'","'.@$komu['align'].'","'.@$komu['klan'].'")</SCRIPT>';
|
|||
|
?> <INPUT TYPE=button value="Сменить" onClick="findlogin('Передача предметов','give.php','FindLogin')"><BR><?
|
|||
|
}else{
|
|||
|
mysql_query("DELETE FROM `trade` WHERE `baer` = {$user['id']} LIMIT 1");
|
|||
|
$rwx = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner` = '".$roww['to_id']."' AND `tradesale` > 0 AND `id` = '".$roww['id']."' AND `artefact` = 0 LIMIT 1;"));
|
|||
|
if (!$roww['id'] OR !$rwx['id']) {
|
|||
|
?> <SCRIPT>findlogin('Передача предметов','give.php','FindLogin');</SCRIPT><? }
|
|||
|
else
|
|||
|
{
|
|||
|
?> <SCRIPT>transfer(<?=$roww['to_id']?>, '<?=$roww['login']?>', '<?=str_replace(array("\r", "\r\n", "\n"),"",$roww['txt'])?>', <?=$roww['kr']?>, <?=$roww['id']?>, '');</SCRIPT><?
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
</td><TD align=right>
|
|||
|
<INPUT TYPE=button value="Подсказка" style="background-color:#A9AFC0" onClick="window.open('help/transfer.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
|
|||
|
<INPUT TYPE="button" onClick="location.href='main.php'" value="Вернуться" title="Вернуться">
|
|||
|
</td></tr><tr><td colspan=2 align=right><? if ($step!=4) {?> <FONT COLOR=red><B><? echo $mess; ?></B></FONT> <? } ?></td></tr></table>
|
|||
|
|
|||
|
<TABLE width=100% cellspacing=0 cellpadding=0>
|
|||
|
<FORM ACTION="give.php" METHOD=POST>
|
|||
|
<TR>
|
|||
|
<TD valign=top align=left width=40%>
|
|||
|
<?
|
|||
|
if ($step==3) { ?>
|
|||
|
<INPUT TYPE=hidden name=to_id value="<? echo $idkomu; ?>">
|
|||
|
<INPUT TYPE=hidden name=sd4 value="<? echo $user['id']; ?>">
|
|||
|
<BR>У вас на счету: <FONT COLOR=339900><B><? echo $user['money']; ?></B></FONT> кр.<BR>
|
|||
|
|
|||
|
Передать кредиты, минимально 0.01кр.<BR>
|
|||
|
Укажите передаваемую сумму: <INPUT TYPE=text NAME=setkredit maxlength=8 size=6> <INPUT TYPE=submit VALUE="Передать">
|
|||
|
<?
|
|||
|
}
|
|||
|
?>
|
|||
|
</TD>
|
|||
|
</FORM>
|
|||
|
|
|||
|
<FORM ACTION="give.php" METHOD=POST>
|
|||
|
<INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>">
|
|||
|
<TD valign=top align=right>
|
|||
|
|
|||
|
<?
|
|||
|
if ($step==3) {
|
|||
|
|
|||
|
|
|||
|
if (@$_GET['razdel'] == '0') { $_SESSION['razdel'] = 0; }
|
|||
|
if (@$_GET['razdel'] == 1) { $_SESSION['razdel'] = 1; }
|
|||
|
if (@$_GET['razdel'] == 2) { $_SESSION['razdel'] = 2; }
|
|||
|
|
|||
|
?>
|
|||
|
<TABLE border=0 width=100% cellspacing="0" cellpadding="0" bgcolor="#A5A5A5">
|
|||
|
<TR><TD>
|
|||
|
<TABLE border=0 width=100% cellspacing="0" cellpadding="3" bgcolor=#d4d2d2><TR>
|
|||
|
<TD align=center bgcolor="<?=($_SESSION['razdel']==null)?"#A5A5A5":"#C7C7C7"?>"><A HREF="?to_id=<? echo $idkomu; ?>&edit=1&razdel=0&sd4=<? echo $user['id']; ?>">Обмундирование</A></TD>
|
|||
|
<TD align=center bgcolor="<?=($_SESSION['razdel']==1)?"#A5A5A5":"#C7C7C7"?>"><A HREF="?to_id=<? echo $idkomu; ?>&edit=1&razdel=1&sd4=<? echo $user['id']; ?>">Заклятия</A></TD>
|
|||
|
<TD align=center bgcolor="<?=($_SESSION['razdel']==2)?"#A5A5A5":"#C7C7C7"?>"><A HREF="?to_id=<? echo $idkomu; ?>&edit=1&razdel=2&sd4=<? echo $user['id']; ?>">Прочее</A></TD>
|
|||
|
</TR></TABLE>
|
|||
|
</TD></TR>
|
|||
|
<TR>
|
|||
|
<TD align=center><B>Рюкзак (масса: <?php
|
|||
|
|
|||
|
$d = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `setsale` = 0; "));
|
|||
|
|
|||
|
echo $d[0];
|
|||
|
?>/<?=get_meshok()?>)</B></TD>
|
|||
|
</TR>
|
|||
|
<TR><TD align=center><!--Рюкзак-->
|
|||
|
<TABLE BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
|
|||
|
<?php
|
|||
|
if ($_SESSION['razdel']==null) {
|
|||
|
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `type` < 12 AND `setsale` = 0 AND `present` = '' AND `artefact` = 0 ORDER by `update` DESC; ");
|
|||
|
}
|
|||
|
if ($_SESSION['razdel']==1) {
|
|||
|
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `type` = 12 AND `setsale` = 0 AND `present` = '' AND `artefact` = 0 ORDER by `update` DESC; ");
|
|||
|
}
|
|||
|
if ($_SESSION['razdel']==2) {
|
|||
|
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `type` > 12 AND `setsale` = 0 AND `present` = '' AND `artefact` = 0 ORDER by `update` DESC; ");
|
|||
|
}
|
|||
|
|
|||
|
while($row = mysql_fetch_array($data)) {
|
|||
|
$row['count'] = 1;
|
|||
|
if (@$i==0) { $i = 1; $color = '#C7C7C7';} else { $i = 0; $color = '#D5D5D5'; }
|
|||
|
$mn = 1;
|
|||
|
if($data['koll']) {
|
|||
|
$mn = 1*$data['koll'];
|
|||
|
}
|
|||
|
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
|
|||
|
?>
|
|||
|
<BR>
|
|||
|
<? echo "<A HREF=\"give.php?to_id=".$idkomu."&id_th=".$row['id']."&setobject=".$row['id']."&s4i=".$user['sid']."&sd4=".$user['id']."&tmp=".rand(0,50000000)."\"".'onclick="return confirm(\'Передать предмет '.$row['name'].'?\')">передать за '.$mn.' кр.</A>';
|
|||
|
echo "<br><A HREF=\"give.php?to_id=".$idkomu."&id_th=".$row['id']."&setobject=".$row['id']."&gift=1&s4i=".$user['sid']."&sd4=".$user['id']."&tmp=".rand(0,50000000)."\"".'onclick="return confirm(\'Подарить предмет '.$row['name'].'?\')">подарить</A>';
|
|||
|
echo "<br><A HREF=#".' onClick="findmoney(\'Продажа предмета\',\'give.php\',\'cost\','.$row['id'].')">продать</A>';
|
|||
|
?>
|
|||
|
|
|||
|
</TD>
|
|||
|
<?php
|
|||
|
echo "<TD valign=top>";
|
|||
|
showitem ($row);
|
|||
|
echo "</TD></TR>";
|
|||
|
}
|
|||
|
if (mysql_num_rows($data) == 0) {
|
|||
|
echo "<tr><td align=center bgcolor=#C7C7C7>Пусто</td></tr>";
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</TABLE>
|
|||
|
</TD></TR>
|
|||
|
</TABLE><?php
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
|
|||
|
</TD></TR>
|
|||
|
</FORM>
|
|||
|
</TABLE>
|
|||
|
|
|||
|
</BODY>
|
|||
|
</HTML>
|