<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<%call head()
call saycardd("陈六当铺")
Server.ScriptTimeout=999
did=request("did")
num=request("num")
ids=session("id")
if did="" then
  Call Error("ID无效！")
end if

if num="" or IsNumeric(num) = False then
  Call Error("数量无效！")
end if

if int(num)<=0 then
  Call Error("数量无效！")
end if

if num>100000 then
  Call Error("一次最多只能当100000个！")
end if
Select Case did
Case "wq" 
itidtit="木剑"
jiage="80"
danwei="把"
Case "hcj" 
itidtit="回城卷"
jiage="20"
danwei="个"
Case "w1" 
itidtit="光芒剑"
jiage="160"
danwei="把"
Case "w2" 
itidtit="战神剑"
jiage="400"
danwei="把"
Case "w3" 
itidtit="天使剑"
jiage="800"
danwei="把"
Case "w4" 
itidtit="黄金剑"
jiage="1300"
danwei="把"
Case "w5" 
itidtit="毁灭剑"
jiage="1900"
danwei="把"
Case "w6" 
itidtit="蝴蝶剑"
jiage="2500"
danwei="把"
Case "w7" 
itidtit="龙王剑"
jiage="8000"
danwei="把"
Case "w8" 
itidtit="轩辕煞魂斩"
jiage="100000"
danwei="把"
Case "dp" 
itidtit="布衣"
jiage="80"
danwei="件"
Case "d1" 
itidtit="光芒甲"
jiage="160"
danwei="件"
Case "d2" 
itidtit="战神甲"
jiage="300"
danwei="件"
Case "d3" 
itidtit="天使甲"
jiage="600"
danwei="件"
Case "d4" 
itidtit="黄金甲"
jiage="1000"
danwei="件"
Case "d5" 
itidtit="毁灭甲"
jiage="1500"
danwei="件"
Case "d6" 
itidtit="蝴蝶甲"
jiage="2100"
danwei="件"
Case "d7" 
itidtit="龙王甲"
jiage="8000"
danwei="件"
Case "d8" 
itidtit="轩辕圣甲"
jiage="100000"
danwei="件"
Case "kyaa" 
itidtit="布料靴"
jiage="80"
danwei="件"
Case "k1" 
itidtit="光芒靴"
jiage="120"
danwei="件"
Case "k2" 
itidtit="战神靴"
jiage="300"
danwei="件"
Case "k3" 
itidtit="天使靴"
jiage="600"
danwei="件"
Case "k4" 
itidtit="黄金靴"
jiage="1000"
danwei="件"
Case "k5" 
itidtit="毁灭靴"
jiage="1500"
danwei="件"
Case "k6" 
itidtit="蝴蝶靴"
jiage="2100"
danwei="件"
Case "k7" 
itidtit="龙王靴"
jiage="8000"
danwei="件"
Case "k8" 
itidtit="轩辕圣靴"
jiage="100000"
danwei="件"
Case "tou" 
itidtit="布料头盔"
jiage="80"
danwei="件"
Case "t1" 
itidtit="光芒头盔"
jiage="120"
danwei="件"
Case "t2" 
itidtit="战神头盔"
jiage="300"
danwei="件"
Case "t3" 
itidtit="天使头盔"
jiage="600"
danwei="件"
Case "t4" 
itidtit="黄金头盔"
jiage="1000"
danwei="件"
Case "t5" 
itidtit="毁灭头盔"
jiage="1500"
danwei="件"
Case "t6" 
itidtit="蝴蝶头盔"
jiage="2100"
danwei="件"
Case "t7" 
itidtit="龙王头盔"
jiage="8000"
danwei="件"
Case "t8" 
itidtit="轩辕圣盔"
jiage="100000"
danwei="件"
Case "y1" 
itidtit="百草丹"
jiage="80"
danwei="颗"
Case "y2" 
itidtit="大力神丹"
jiage="160"
danwei="颗"
Case "y3" 
itidtit="九转还魂丹"
jiage="400"
danwei="颗"
Case "y4" 
itidtit="少林大还丹"
jiage="800"
danwei="颗"
Case "y5" 
itidtit="江湖强力魔水"
jiage="80000"
danwei="颗"
Case "y6" 
itidtit="情人花"
jiage="80000"
danwei="朵"
Case "bs" 
itidtit="宝石"
danwei="颗"
jiage="80000"
Case "h1"
     itidtit="小虾"
danwei="条"
jiage="80"
   Case "h2"
     itidtit="鲤鱼"
danwei="条"
jiage="160"
   Case "h3"
     itidtit="螃蟹"
danwei="只"
jiage="300"
   Case "h4"
     itidtit="大水鱼"
danwei="只"
jiage="500"
   Case "j1"
     itidtit="锡"
danwei="块"
jiage="80"
   Case "j2"
     itidtit="铜"
danwei="块"
jiage="160"
   Case "j3"
     itidtit="银"
danwei="块"
jiage="240"
   Case "j4"
     itidtit="金"
danwei="块"
jiage="480"
Case "ml" 
itidtit="木料"
jiage="20"
danwei="棵"
 End Select

ids=session("useid")

jinq=jiage*num
if request("caozuo")="" then
Response.Write "您要当的是"&num&""&danwei&""&itidtit&",一共银两"&jinq&"两,要当吗？<br/>你说：<br/><a href='dan1.asp?caozuo=ok&amp;did="&did&"&amp;num="&num&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>成了!多少就多少!</a><br/><a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>这么丁点钱,不当了!</a><br/>"
else %>
<!--#INCLUDE file="conn1.asp"-->
<%
Server.ScriptTimeout=999
set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select "&did&" from wupin where cstr(ids)="&myid
rs.open strsQL,liao,1,1
if clng(num)>rs(""&did&"") then
msg="您只有"&rs(""&did&"")&""&danwei&""&itidtit&",哪有这么多卖！是不是想钱想傻了啊！"
else
sql="update wupin set "&did&"="&did&"-"&num&",yz=yz+"&jinq&" where cstr(ids)="&myid
  liao.Execute(sql)
msg="您卖了"&num&""&danwei&""&itidtit&",得到银两"&jinq&"两！"
end if
Response.Write ""&msg&"<br/><a href='dan.asp?sid="&sid&"&amp;saytk="&saytk&"'>继续交易</a><br/>"
 rs.Close
	Set rs=Nothing
liao.Close
      Set liao=Nothing
end if
Response.Write "--------<br/><a href='bang.asp?sid="&sid&"&amp;saytk="&saytk&"'>魔法</a>|<a href='myzb.asp?sid="&sid&"&amp;saytk="&saytk&"'>装备</a>|<a href='mysx.asp?sid="&sid&"&amp;saytk="&saytk&"'>属性</a>|<a href='mywp.asp?sid="&sid&"&amp;saytk="&saytk&"'>行囊</a><br/>随身地图:<br/><a href='tie.asp?sid="&sid&"&amp;saytk="&saytk&"'>商店</a>|<a href='ke.asp?sid="&sid&"&amp;saytk="&saytk&"'>客栈</a>|<a href='yao.asp?sid="&sid&"&amp;saytk="&saytk&"'>药铺</a><br/><a href='index1.asp?pid=1&amp;sid="&sid&"&amp;saytk="&saytk&"'>原始森林</a><br/><a href='index1.asp?pid=2&amp;sid="&sid&"&amp;saytk="&saytk&"'>魔鬼山洞</a><br/><a href='index1.asp?pid=3&amp;sid="&sid&"&amp;saytk="&saytk&"'>丰富矿山</a><br/><a href='index1.asp?pid=4&amp;sid="&sid&"&amp;saytk="&saytk&"'>浩瀚北海</a><br/>--------<br/>"
%>
<a href="index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">江湖首页</a><br/>
<a href="/bbs/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">社区首页</a><br/>
<%call head1()%>