<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#INCLUDE file="conn1.asp"-->

<%call head()
call saycardd("王五药铺")

ids=session("id")
wpid=request("wid")


if wpid="1" then
yname="百草丹"
xyyz="100"
tname="y1"

elseif wpid="2" then
yname="大力神丹"
xyyz="200"
tname="y2"

elseif wpid="3" then
yname="九转还魂丹"
xyyz="500"
tname="y3"

elseif wpid="4" then
xyyz="1000"
yname="少林大还丹"
tname="y4"
elseif wpid="5" then
xyyz="100000"
yname="江湖强力魔水"
tname="y5"
end if
if request("caozuo")<>"ok" then
Response.Write "王五："&yname&"每颗"&xyyz&"两，您要多少<br/>"
call xlanlj("yao1.asp?sid="&sid&"&amp;saytk="&saytk&"")%>
我说：拿<input name="num" size="3" format="*N"/>颗给我吧！<br/>
<%if saytk>1 then 
call xltjlj("wid",""&wpid&"")
call xltjlj("caozuo","ok")
call xlanlj1("确定")
else%>
<anchor>确定
<go method="post" href="yao1.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">
<postfield name="wid" value="<%=wpid%>"/>
<postfield name="num" value="$(num)"/>
<postfield name="caozuo" value="ok"/>
</go></anchor><br/>
<%end if 
else
Server.ScriptTimeout=999
set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select yz from wupin where cstr(ids)="&myid&""
rs.open strsQL,liao,1,1

num=clng(request("num"))
xycp=clng(xyyz)*num
if clng(xycp)>rs("yz") then
msg="您的银两不够"&xyyz&"购买"&num&"颗"&yname&"！快去赚一点吧！"
else
sql="update wupin set "&tname&"="&tname&"+"&num&" where cstr(ids)="&myid
  liao.Execute(sql)
sql="update wupin set yz=yz-"&xycp&" where cstr(ids)="&myid
  liao.Execute(sql)
msg="您花"&xycp&"两银两购买了"&num&"颗"&yname&".<br/><a href='yao.asp?sid="&sid&"&amp;saytk="&saytk&"'>继续交易</a>"
end if
Response.Write ""&msg&"<br/>=========<br/>"
 rs.Close
	Set rs=Nothing
end if
     liao.Close
      Set liao=Nothing
%>
<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()%>