www.pudn.com > wap-wscs.rar > deal.asp, change:2014-08-10,size:4663b


<!--#include file="conn.asp"--> 
<% 
act=request.querystring("act") 
acts=request.querystring("acts") 
pid=request.querystring("id") 
Set usinfo=New userinfo 
userid=usinfo.usinfo(gsid,"userid")'玩家自己的ID 
isgm=usinfo.usinfo(gsid,"isgm")'是否为gm 
Set usinfo=Nothing  
 
If act="add" Then  
	Call myhead("交易确认") 
	pid=request.form("pid")'目标ID 
	gid=request.form("gid")'交易物品 
	If gid="" Then gid=0 
	If pid="" Then pid=0 
	gms=request.form("gms")'交易数量 
	If gms<>"" Then 
	gms=Abs(fix(gms)) 
	Else 
	gms=0 
	End If  
	jb=request.form("jb")'金币 
	If jb<>"" Then 
	jb=Abs(fix(jb)) 
	Else 
	jb=0 
	End If  
	zs=request.form("zs")'钻石 
	If zs<>"" Then 
	zs=Abs(fix(zs)) 
	Else 
	zs=0 
	End If  
	If pid<>"" And int(pid)<>userid Then  
	Set usinfo=New userinfo 
	pid=usinfo.uinfo(pid,"userid")'对方ID 
	Set usinfo=Nothing  
		If pid="err" Then  
		Call echo("交易目标错误,没有这个玩家",1) 
		Else 
			If isdealing(pid) Then  
			Call echo("对方有未处理的交易请求",1) 
			Else 
			pid=pid 
			Call dealqr(userid,pid,gid,gms,jb,zs)'交易确认 自己ID 对方ID 物品ID 物品数量 金币 钻石 
			End If  
		End If  
	Else  
	Call echo("交易目标错误",1) 
	End If  
 
ElseIf act="addok" Then  
	Call myhead("交易处理中") 
		pid=request.form("pid")'目标ID 
		gid=request.form("gid")'交易物品 
		If gid="" Then gid=0 
		gms=request.form("gms")'交易数量 
		If gms<>"" Then 
		gms=Abs(fix(gms)) 
		Else 
		gms=0 
		End If  
		jb=request.form("jb")'金币 
		If jb<>"" Then 
		jb=Abs(fix(jb)) 
		Else 
		jb=0 
		End If  
		zs=request.form("zs")'钻石 
		If zs<>"" Then 
		zs=Abs(fix(zs)) 
		Else 
		zs=0 
		End If  
		If pid<>"" And int(pid)<>userid Then  
		Set usinfo=New userinfo 
		pid=usinfo.uinfo(pid,"userid")'对方ID 
		Set usinfo=Nothing  
			If pid="err" Then  
			Call echo("交易目标错误,没有这个玩家",1) 
			Else 
						If isdealing(pid) Then  
						Call echo("对方有未处理的交易请求",1) 
						Else 
						pid=pid 
						Call dealend(userid,pid,gid,gms,jb,zs)'交易确认 自己ID 对方ID 物品ID 物品数量 金币 钻石 
						End If  
			End If  
		Else  
		Call echo("交易目标错误",1) 
		End If 
 
ElseIf act="yes" Then  
id=request.querystring("did") 
Call myhead("同意交易") 
Call yesdeal(userid,id) 
 
ElseIf act="no" Then  
id=request.querystring("did") 
Call myhead("拒绝交易") 
Call nodeal(userid,id) 
 
ElseIf act="getdown" Then  
Call myhead("撤回交易") 
Call mydealist(userid) 
 
ElseIf act="downdel" Then  
id=request.querystring("did") 
Call myhead("撤回交易") 
Call delmydeal(userid,id) 
 
ElseIf act="updeal" Then  
Call myhead("物品上架") 
Call echo("开发中",1) 
Call updateform(userid) 
 
ElseIf act="updealing" Then  
Call myhead("确认上架") 
		gid=request.form("gid")'交易物品 
		If gid="" Then gid=0 
		gms=request.form("gms")'交易数量 
		If gms<>"" Then 
		gms=Abs(fix(gms)) 
		Else 
		gms=0 
		End If  
		jb=request.form("jb")'金币 
		If jb<>"" Then 
		jb=Abs(fix(jb)) 
		Else 
		jb=0 
		End If  
		zs=request.form("zs")'钻石 
		If zs<>"" Then 
		zs=Abs(fix(zs)) 
		Else 
		zs=0 
		End If  
		Call updeal(userid,gid,gms,jb,zs)'确认 
ElseIf act="updealok" Then  
Call myhead("上架处理中") 
		gid=request.form("gid")'交易物品 
		If gid="" Then gid=0 
		gms=request.form("gms")'交易数量 
		If gms<>"" Then 
		gms=Abs(fix(gms)) 
		Else 
		gms=0 
		End If  
		jb=request.form("jb")'金币 
		If jb<>"" Then 
		jb=Abs(fix(jb)) 
		Else 
		jb=0 
		End If  
		zs=request.form("zs")'钻石 
		If zs<>"" Then 
		zs=Abs(fix(zs)) 
		Else 
		zs=0 
		End If  
		Call updealend(userid,gid,gms,jb,zs)'确认 
Else 
	Call myhead("交易大厅") 
	isdeal=isdealing(userid)'检查交易信息 
	Select Case isdeal 
	Case 1 
	Call echo("你有一条需要处理的交易信息",1) 
	Call mydeal(userid) 
	Case 0 
		If acts="deal" Then  
			If mygoodnum(userid)>0 Then  
			If pid<>"" Then  
			Call dealform(pid,userid) 
			Else 
			Call dealform("",userid) 
			End If 
			Else 
			Call echo("你什么物品都没有,怎么交易呢?",1) 
			End If 
		Else 
		Call echo("玩家摊位物品|"&urlencode("../user/userdeal.asp?id="&userid,"我的摊位"),1) 
		Call alldeal() 
		End If  
	End Select  
End If  
Call echo(urlencode("deal.asp?act=updeal","上架摊位物品"),1) 
Call echo(urlencode("deal.asp?act=getdown","撤回即时交易")&"("&mydealing(userid)&")",1) 
Call echo(urlencode("deal.asp?acts=deal","发起即时交易"),1) 
Call echo(urlencode("../action/deal.asp","交易大厅"),1) 
Call echo(urlencode("../index.asp","返回首页"),1) 
Call myend() 
%>