<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#INCLUDE file="conn1.asp"-->
<%call head()
call saycardd("江湖银行")%><%
sid=request("sid")
ids=myid
num=clng(request("num"))
yznum=clng(num/10)
if num>myjb then
Response.Write "您没有这么多金币呀<br/>---------<br/><a href='zhyz.asp?sid="&sid&"&amp;saytk="&saytk&"'>返回重写</a><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()
Response.end 
end if
if num>1000000 then
Response.Write "最多可以用1000000金币兑换100000两银子(不限次数)!<br/>---------<br/><a href='zhyz.asp?sid="&sid&"&amp;saytk="&saytk&"'>返回重写</a><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()
Response.end 
end if
set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select * from jfpost where cstr(ids)="&myid
rs.open strsQL,liao,1,2
if rs.recordcount<1 then
rs.addnew
rs("ids")=myid
rs("usejf")=rs("usejf")+yznum
rs.update
rs.Close
set rs=Nothing

set rs3=Server.CreateObject("ADODB.Recordset")
strsQL="select * from wupin where cstr(ids)="&myid
rs3.open strsQL,liao,1,2
if rs3.recordcount<1 then
rs3.addnew
rs3("ids")=myid
rs3("yz")=rs1("yz")+yznum
rs3.update
else
rs3("yz")=rs3("yz")+yznum
rs3.update
end if
 rs3.Close
set rs3=Nothing

sql="update users set myjb=myjb-"&num&" where id="&myid&""
conn.Execute(sql)

msg="转换成功!"
else
usejf1=clng(rs("usejf"))
if rs("usejf")>=100000 then
msg="100000两银子,不能再兑换银子!"
elseif usejf1+yznum>100000 then
msg=""&usejf1&"两银子,只能再兑换"&(100000-usejf1)&"两银子!"
else

sql="update users set myjb=myjb-"&num&" where id="&myid&""
conn.Execute(sql)

set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select * from jfpost where cstr(ids)="&myid
rs.open strsQL,liao,1,2
rs("usejf")=rs("usejf")+yznum
rs.update
 rs.Close
set rs=Nothing

set rs3=Server.CreateObject("ADODB.Recordset")
strsQL="select * from wupin where cstr(ids)="&myid
rs3.open strsQL,liao,1,2
if rs3.recordcount<1 then
rs3.addnew
rs3("ids")=myid
rs3("yz")=rs1("yz")+yznum
rs3.update
else
rs3("yz")=rs3("yz")+yznum
rs3.update
end if
 rs3.Close
set rs3=Nothing

msg="转换成功!"
end if %>
<%
msg="转换成功!"
end if
liao.Close
      Set liao=Nothing
%>
<%=msg%><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()%>