<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!-- #include file=pet_conn.asp -->
<!--#include file="inc/plus_check.asp"-->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
dim menu,savem,rsbank,rssql,chentitle,chenbackasp,stats,errmsg,founderr,action

chentitle="宠物装备交易市场"
Dv_plus.name="petcenter"
'Dv_plus.checklogin()
Dvbbs.LoadTemplates("")
Dvbbs.Stats="宠物装备交易市场"
Dvbbs.Nav()
Dvbbs.Head_var 0,"","宠物中心","petcenter.asp"

if DvBBS.UserId = 0 then
	AlarmErrmsg
else
    dim money,smoney,saveday,allmoney,time1,time2,daikuang,dkdu,daiday,sucmsg
    dim Form_userphoto,Form_FaceUrl,Form_FaceWidth,Form_FaceHeight
    
    Dim Rs,SQL

	set rs=Dvbbs.execute("select userWealth from [Dv_User] where UserID="&DvBBS.UserId)
      	
    money=rs("userWealth")

	    

    rs.close
	
	sql = "SELECT * FROM mypetdata WHERE username='"&DvBBS.MemberName&"' "
	rs.open sql,connpet,1,3
	if rs.eof then
		call showmessage("你还没有宠物啊，快攒钱去买吧~","petshop.asp")
		else

dim tmoney,sword,tmp,necklace,head,body,foot,rndNum
		
if request("action") = ""  or request("action")="showsword" then
	action = "marketroom"
	else
	action = lcase(request("action"))
end if


select case action
	case "sell"				'卖东西啊
		dim itemmoney,itemN,itemNum,itemuesr,itemclass,itemName
		itemmoney = clng(request("itemmoney"))
		itemN = cint(request("itemn"))
		itemNum = Clng(request("itemNum"))
		itemuesr = Dvbbs.MemberName
		itemclass = request("itemclass")
		itemName = request("itemName")
		set rs = connpet.execute("select * from mypetdata where username='"&DvBBS.MemberName&"'")

		if not isnumeric(itemmoney) then
			call showmessage("价钱必须是数字！","petitemmarket.asp?action=givesell")
		elseif clng(itemmoney)<1 then
			call showmessage("赔本的生意啊？没毛病吧？！","petitemmarket.asp?action=givesell")
		elseif not isnumeric(itemNum) then
			call showmessage("数量必须是数字！","petitemmarket.asp?action=givesell")
		elseif clng(itemNum)<1 then
			if itemclass="update" then
				call showmessage("一个都不卖，扰乱市场持续？","petitemmarket.asp?action=givesell")
			else
				call showmessage("0级装备不能卖出！","petitemmarket.asp?action=givesell")
			end if
		elseif itemclass="update" and ((itemn=0 and rs("weopitem")<itemnum) or (itemn=1 and rs("amoritem")<itemnum)) then
			call showmessage("你没有那么多东西卖啊","petitemmarket.asp?action=givesell")
		else
			sql = "INSERT INTO [itemmarket] (itemname, itemMoney, itemNum, itemUesr, ItemClass, ItemN) VALUES ('"&itemname&"', "&itemMoney&", "&itemNum&", '"&DvBBS.MemberName&"', '"&ItemClass&"', "&ItemN&")"
			'response.write SQL
			connpet.execute(SQL)
			select case itemclass
				case "sword"
					connpet.execute("update [mypetdata] set item1=0,item1num=0 where username='"&DvBBS.MemberName&"'")
					call showmessage("您的 "&itemName&" （+"&itemNum&"）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)

				case "necklace"
					connpet.execute("update [mypetdata] set item2=0,item2num=0 where username='"&DvBBS.MemberName&"'")
					call showmessage("您的 "&itemName&" （+"&itemNum&"）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)

				case "head"
					connpet.execute("update [mypetdata] set item3=0,item3num=0 where username='"&DvBBS.MemberName&"'")
					call showmessage("您的 "&itemName&" （+"&itemNum&"）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)

				case "body"
					connpet.execute("update [mypetdata] set item4=0,item4num=0 where username='"&DvBBS.MemberName&"'")
					call showmessage("您的 "&itemName&" （+"&itemNum&"）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)

				case "foot"
					connpet.execute("update [mypetdata] set item5=0,item5num=0 where username='"&DvBBS.MemberName&"'")
					call showmessage("您的 "&itemName&" （+"&itemNum&"）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)

				case "update"
					if itemN=0 then
						connpet.execute("update [mypetdata] set weopitem=weopitem-"&itemnum&" where username='"&DvBBS.MemberName&"'")
						call showmessage("您的 "&itemName&" （"&itemNum&"个）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)
					else
						connpet.execute("update [mypetdata] set amoritem=amoritem-"&itemnum&" where username='"&DvBBS.MemberName&"'")
						call showmessage("您的 "&itemName&" （"&itemNum&"个）已卖出，等人购买！售价 "&itemMoney&" 元！","petitemmarket.asp?action=show"&itemclass)
					end if
			end select
		end if
		rs.close
	case "buy"				'买东西啊~~
		dim buyid,rsbuy
		buyid=cint(request("id"))
		
		set rs = connpet.execute("select * from [itemmarket] where id="&buyid)
		if rs.eof and rs.bof then call showmessage("查无此物，或已经卖出！","petitemmarket.asp?action=show"&request("itemclass"))
		if rs("itemuesr")= Dvbbs.MemberName then call showmessage("此货物原本就是你的，你无法购买！","petitemmarket.asp?action=show"&request("itemclass"))
		if money < rs("itemmoney") then call showmessage("你的钱不够，凑齐了再来买！","petitemmarket.asp?action=show"&request("itemclass"))
		select case request("itemclass")
			case "sword"
				connpet.execute("update [mypetdata] set item1="&cint(rs("itemn"))&",item1num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
				Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
				connpet.execute("DELETE from [itemmarket] where id="&buyid)
				Call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
			case "necklace"
				connpet.execute("update [mypetdata] set item2="&cint(rs("itemn"))&",item2num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
				Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
				connpet.execute("DELETE from [itemmarket] where id="&buyid)
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)
				call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
			case "head"
				connpet.execute("update [mypetdata] set item3="&cint(rs("itemn"))&",item3num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
				Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
				connpet.execute("DELETE from [itemmarket] where id="&buyid)
				call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
			case "body"
				connpet.execute("update [mypetdata] set item4="&cint(rs("itemn"))&",item4num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
				Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
				connpet.execute("DELETE from [itemmarket] where id="&buyid)
				call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
			case "foot"
				connpet.execute("update [mypetdata] set item5="&cint(rs("itemn"))&",item5num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
				Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
				Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
				connpet.execute("DELETE from [itemmarket] where id="&buyid)
				call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
			case "update"
				if request("itemN")=0 then
					connpet.execute("update [mypetdata] set weopitem=weopitem+"&cint(rs("itemnum"))&" where username='"&DvBBS.MemberName&"'")
					Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
					Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
					Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
					Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
					connpet.execute("DELETE from [itemmarket] where id="&buyid)
					call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
				else
					connpet.execute("update [mypetdata] set amoritem=amoritem+"&cint(rs("itemnum"))&" where username='"&DvBBS.MemberName&"'")
					Dvbbs.execute("update [Dv_User] set userWealth=userWealth-"&clng(rs("itemmoney"))&" where username='"&DvBBS.MemberName&"'")
					Call UpdateUserInfo(-clng(rs("itemmoney")),0,0,0,0,0)	'道具Bug修正啦~ 绿光光	 2005-4-8
					Dvbbs.execute("update [Dv_User] set userWealth=userWealth+"&clng(rs("itemmoney"))&" where username='"&rs("itemuesr")&"'")
					Dvbbs.execute("INSERT INTO [Dv_Message] (Incept, Sender, Title, Content, SendTime,flag, isSend) values('"&rs("itemuesr")&"','宠物中心','交易成功','您的商品 "&rs("itemname")&" 被 "&DvBBS.MemberName&" 购买，您在交易中获得 "&rs("itemmoney")&" 元，请查收！','"&now&"','0','1')")
					connpet.execute("DELETE from [itemmarket] where id="&buyid)
					call showmessage("恭喜您购得了"&request("itemname")&"！","petitemmarket.asp")
				end if			
		end select		
	case "nosell"
		dim nosellid
		nosellid=cint(request("id"))
		set rs = connpet.execute("select * from [itemmarket] where id="&nosellid)
		if rs.eof and rs.bof then call showmessage("查无此物，或已经卖出！","petitemmarket.asp?action=show"&request("itemclass"))
		if rs("itemuesr")<> Dvbbs.membername then call showmessage("此货物原本不是你的，你无法取消销售！","petitemmarket.asp?action=show"&request("itemclass"))
		select case request("itemclass")
			case "sword"
				connpet.execute("update [mypetdata] set item1="&cint(rs("itemn"))&",item1num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				connpet.execute("DELETE from [itemmarket] where id="&nosellid)
				call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
			case "necklace"
				connpet.execute("update [mypetdata] set item2="&cint(rs("itemn"))&",item2num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				connpet.execute("DELETE from [itemmarket] where id="&nosellid)
				call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
			case "head"
				connpet.execute("update [mypetdata] set item3="&cint(rs("itemn"))&",item3num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				connpet.execute("DELETE from [itemmarket] where id="&nosellid)
				call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
			case "body"
				connpet.execute("update [mypetdata] set item4="&cint(rs("itemn"))&",item4num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				connpet.execute("DELETE from [itemmarket] where id="&nosellid)
				call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
			case "foot"
				connpet.execute("update [mypetdata] set item5="&cint(rs("itemn"))&",item5num="&clng(rs("itemNum"))&" where username='"&DvBBS.MemberName&"'")
				connpet.execute("DELETE from [itemmarket] where id="&nosellid)
				call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
			case "update"
				if request("itemN")=0 then
					connpet.execute("update [mypetdata] set weopitem=weopitem+"&cint(rs("itemnum"))&" where username='"&DvBBS.MemberName&"'")
					connpet.execute("DELETE from [itemmarket] where id="&nosellid)
					call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
				else
					connpet.execute("update [mypetdata] set amoritem=amoritem+"&cint(rs("itemnum"))&" where username='"&DvBBS.MemberName&"'")
					connpet.execute("DELETE from [itemmarket] where id="&nosellid)
					call showmessage("您的物品 "&request("itemname")&" 回到了您手中！","petitemmarket.asp")
				end if			
		end select		
	
	end select
		
	end if

	rs.close	

%>
<table  border="0" cellspacing="1" cellpadding="5" align="center" class=tableborder4>
  <tr>
	<td height=27 align="center" class=tbhead2><b><font class=HeadFont><%=stats%></font></b></td>
  </tr>
  <tr>
	<td class=tbbg1 valign=top>
	
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="28%" rowspan="2" valign=top><table width="79%"  border="0" align="center" cellpadding="3" cellspacing="3">
<tr><td width="100%"><div align="center">我的资料</div></td>
</tr><tr><td><div align="center">
					<%
            		If IsNumeric(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text) And IsNumeric(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text) And Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text<>"" And Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text<>"" Then
            			If Clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text)=Clng(Dvbbs.Forum_Setting(39)) And Clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text)=Clng(Dvbbs.Forum_Setting(38)) Then
            			response.write "<img src="&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userface").text&">"
            			Else
            			response.write "<img src="&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userface").text&" width=60 height=60>"
            			End If
            		Else
            			response.write "<img src=dv_plus/pet/logo_2.gif>"
            		End If
					%>
					<br><img src=../dv_plus/pet/blank.gif width=2 height=5><br>
</div></td>
</tr><tr>
                    <td> <div align="center">
                        <nobr>现金货币: <%=money%></nobr>
                        </div></td>
</tr></table><br> <table width="90%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr><td><div align="center"></div>
<!-- #include file=petnav.asp --></td>
</tr></table><br><table width="79%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr><td width="100%"><div align="center"><img src="dv_plus/pet/pet/27.gif"></div></td>
</tr></table><br><div align="right"></div></td>
<td><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td><div align="center"><a href="petitemmarket.asp?action=givesell">我要卖东西</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=marketroom">武器柜台</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=shownecklace">项链柜台</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=showhead">头盔柜台</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=showbody">盔甲柜台</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=showfoot">鞋子柜台</a></div></td>
<td><div align="center"><a href="petitemmarket.asp?action=showupdate">升级柜台</a></div></td>
</tr></table></td></tr><tr><td width="72%" valign=top> 
<%
	if action<>"buy" and action<>"sell" and action<>"givesell" then
	dim atkdef
	atkdef=""
	select case action

		case "marketroom"
			sql = "SELECT * FROM itemmarket WHERE itemclass='sword' order by itemnum"
			atkdef="攻击力"
		
		case "shownecklace"
			sql = "SELECT * FROM itemmarket WHERE itemclass='necklace' order by itemnum"
			atkdef="攻击力"

		case "showhead"
			sql = "SELECT * FROM itemmarket WHERE itemclass='head' order by itemnum"
			atkdef="防御力"
		
		case "showbody"
			sql = "SELECT * FROM itemmarket WHERE itemclass='body' order by itemnum"
			atkdef="防御力"

		case "showfoot"
			sql = "SELECT * FROM itemmarket WHERE itemclass='foot' order by itemnum"
			atkdef="防御力"
		
		case "showupdate"
			sql = "SELECT * FROM itemmarket WHERE itemclass='update' order by itemnum"
			atkdef="数量"

	end select
	rs.open sql,connpet,1,1
	if rs.bof and rs.eof then response.write "目前没有人贩卖此类道具</td></tr></table>" :  Set Dv_plus=Nothing : Dvbbs.Footer : response.end
	rs.movefirst
%>
<TABLE class=text1 cellSpacing=1 cellPadding=3 width=530 align=center border=0><TR> 
<TD width=100><DIV align=center>卖主</DIV></TD>
<TD width=100><DIV align=center>名字</DIV></TD>
<TD width=100><DIV align=center>形象</DIV></TD>
<TD width=100><DIV align=center><%=atkdef%></DIV></TD>
<TD width=100><DIV align=center>价格</DIV></TD>
<TD width=100><div align=center>购买选项</div></TD>
</TR>
<%
do while not rs.eof

if atkdef<>"数量" then
%>
<form action="petitemmarket.asp" name="name" method=post>
<TR>
<TD width=100><DIV align="center"><%=rs("itemuesr")%></DIV></TD>
<TD width=100><DIV align="center"><%=rs("ItemName")%></DIV></TD>
<TD width=100><DIV align="center"><IMG height=30 src="dv_plus/pet/pet/<%=rs("ItemClass")%>/<%=rs("itemn")%>.gif" width=30></DIV></TD>
<TD width=100><DIV align="center">＋ <%=rs("itemNum")%></DIV></TD>
<TD width=100><DIV align="center"><%=rs("itemmoney")%></DIV></TD>
<TD width=100><div align="center">
<%if rs("itemuesr") <> Dvbbs.MemberName then%>
<input type="submit" value="购买">
<input type="hidden" name="action" value="buy">
<%else%>
<input type="submit" value="取消销售">
<input type="hidden" name="action" value="nosell">
<%end if%>
</div></TD>
<input type="hidden" name="itemname" value="<%=rs("itemname")%>">
<input type="hidden" name="itemclass" value="<%=rs("itemclass")%>">
<input type="hidden" name="itemNum" value="<%=rs("itemNum")%>">
<input type="hidden" name="itemN" value="<%=rs("itemN")%>">
<input type="hidden" name="id" value="<%=rs("id")%>">
</TR>
</form>
<%else%>
<form action=petitemmarket.asp name="name" method=post>
<TR>
<TD width=100><DIV align="center"><%=rs("itemuesr")%></DIV></TD>
<TD width=100><DIV align="center"><%=rs("ItemName")%></DIV></TD>
<TD width=100><DIV align="center">
<%if rs("itemN") = 0 then%>
<IMG height=40 src="dv_plus/pet/pet/wp.gif" width=40>
<%else%>
<IMG height=40 src="dv_plus/pet/pet/am.gif" width=40>
<%end if%>
</DIV></TD>
<TD width=100><DIV align="center"><%=rs("itemNum")%> 个</DIV></TD>
<TD width=100><DIV align="center"><%=rs("itemmoney")%></DIV></TD>
<TD width=100><div align="center">
<%if rs("itemuesr") <> DvBBS.MemberName then%>
<input type="submit" value="购买">
<input type="hidden" name="action" value="buy">
<%else%>
<input type="submit" value="取消销售">
<input type="hidden" name="action" value="nosell">
<%end if%>
</div></TD>
<input type="hidden" name="itemname" value="<%=rs("itemname")%>">
<input type="hidden" name="itemclass" value="<%=rs("itemclass")%>">
<input type="hidden" name="itemNum" value="<%=rs("itemNum")%>">
<input type="hidden" name="itemN" value="<%=rs("itemN")%>">
<input type="hidden" name="id" value="<%=rs("id")%>">
</TR>
</form>
<%
end if 

rs.movenext
loop
rs.close

	elseif action = "givesell" then

	SQL = "SELECT * FROM mypetdata WHERE username='"&DvBBS.MemberName&"'"
	set rs = connpet.execute(SQL)


	'用很无聊的循环使用变量得到每种道具的名字……
	dim rs3,swordname,necklacename,headname,bodyname,footname
	set rs3 = connpet.execute("select * from petitemshop where itemclass='sword' and itemnum="&rs("item1"))
	swordname = rs3("itemname")
	rs3.close
	set rs3 = connpet.execute("select * from petitemshop where itemclass='necklace' and itemnum="&rs("item2"))
	necklacename = rs3("itemname")
	rs3.close
	set rs3 = connpet.execute("select * from petitemshop where itemclass='head' and itemnum="&rs("item3"))
	headname = rs3("itemname")
	rs3.close
	set rs3 = connpet.execute("select * from petitemshop where itemclass='body' and itemnum="&rs("item4"))
	bodyname = rs3("itemname")
	rs3.close
	set rs3 = connpet.execute("select * from petitemshop where itemclass='foot' and itemnum="&rs("item5"))
	footname = rs3("itemname")
	rs3.close
%>
	<div align=center>
	<table class=text1 cellSpacing=1 cellPadding=3 width=530 align=center border=0 width="100%">
	<tr>
		<td width="25%" height="30" align=center>宠物装备/道具</td>
		<td width="25%" height="30" align=center>加强值/数量</td>
		<td width="25%" height="30" align=center>定价(总价)</td>
		<td width="25%" height="30" align=center>卖出</td>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img height=30 src="dv_plus/pet/pet/sword/<%=rs("item1")%>.gif" alt="<%=swordname%>"></td>
		<td width="25%" height="30" align=center>＋ <%=rs("item1Num")%></td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemnum" value="<%=rs("item1Num")%>">
		<input type="hidden" name="itemname" value="<%=swordname%>">
		<input type="hidden" name="itemclass" value="sword">
		<input type="hidden" name="itemn" value="<%=rs("item1")%>">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img height=30 src="dv_plus/pet/pet/necklace/<%=rs("item2")%>.gif" alt="<%=necklacename%>"></td>
		<td width="25%" height="30" align=center>＋ <%=rs("item2Num")%></td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemnum" value="<%=rs("item2Num")%>">
		<input type="hidden" name="itemname" value="<%=necklacename%>">
		<input type="hidden" name="itemclass" value="necklace">
		<input type="hidden" name="itemn" value="<%=rs("item2")%>">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img height=30 src="dv_plus/pet/pet/head/<%=rs("item3")%>.gif" alt="<%=headname%>"></td>
		<td width="25%" height="30" align=center>＋ <%=rs("item3Num")%></td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemnum" value="<%=rs("item3Num")%>">
		<input type="hidden" name="itemname" value="<%=headname%>">
		<input type="hidden" name="itemclass" value="head">
		<input type="hidden" name="itemn" value="<%=rs("item3")%>">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img height=30 src="dv_plus/pet/pet/body/<%=rs("item4")%>.gif" alt="<%=bodyname%>"></td>
		<td width="25%" height="30" align=center>＋ <%=rs("item4Num")%></td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemnum" value="<%=rs("item4Num")%>">
		<input type="hidden" name="itemname" value="<%=bodyname%>">
		<input type="hidden" name="itemclass" value="body">
		<input type="hidden" name="itemn" value="<%=rs("item4")%>">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img height=30 src="dv_plus/pet/pet/foot/<%=rs("item5")%>.gif" alt="<%=footname%>"></td>
		<td width="25%" height="30" align=center>＋ <%=rs("item5Num")%></td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemnum" value="<%=rs("item5Num")%>">
		<input type="hidden" name="itemname" value="<%=footname%>">
		<input type="hidden" name="itemclass" value="foot">
		<input type="hidden" name="itemn" value="<%=rs("item5")%>">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img src="dv_plus/pet/pet/wp.gif" width="40" height="40" border="0" alt="武器升级材料"></td>
		<td width="25%" height="30" align=center><input type="text" name="itemnum" size="5"> 共<font color=red><%=rs("weopitem")%></font>个</td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemname" value="武器升级材料">
		<input type="hidden" name="itemclass" value="update">
		<input type="hidden" name="itemn" value="0">
		</form>
	</tr>
	<tr><form action="petitemmarket.asp" method="post">
		<td width="25%" height="30" align=center><img src="dv_plus/pet/pet/am.gif" width="40" height="40" border="0" alt="防具升级材料"></td>
		<td width="25%" height="30" align=center><input type="text" name="itemnum" size="5"> 共<font color=red><%=rs("amoritem")%></font>个</td>
		<td width="25%" height="30" align=center><input type="text" name="itemmoney"></td>
		<td width="25%" height="30" align=center><input type="submit" value="贩卖"></td>
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="itemname" value="防具升级材料">
		<input type="hidden" name="itemclass" value="update">
		<input type="hidden" name="itemn" value="1">
		</form>
	</tr>
	</table>
	</div>
<%
rs.close
end if
%>
<br>
<br>
</td>
</tr></table>
</td></tr></table>
<% End If  :   Set Dv_plus=Nothing : Dvbbs.Footer %>
