<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../../showchat.asp"-->
<script language="JavaScript"> 
if(window.top==window.self){var i=1;while (i<=50){window.alert("你想作什么呀，黑我？这里是不行的，去别处玩去吧！哈！慢慢点50次！！");i=i+1;}top.location.href="../../exit.asp"}
</script>
<LINK href="../../css.css" rel=stylesheet>
<body bgcolor='<%=bgcolor%>' background='../../bg.gif' oncontextmenu=self.event.returnValue=false>
<%
cwjh_name=Session("cwjh_name")
cwjh_grade=Session("cwjh_grade")
cwjh_jhdj=Session("cwjh_jhdj")
if cwjh_name="" then Response.Redirect "../../error.asp?id=440"
if Instr(LCase(Application("cwjh_useronlinename"&session("nowinroom")))," "&LCase(cwjh_name)&" ")=0 then
	Response.Write "<script Language=Javascript>alert('你不能进行操作，进行此操作必须进入聊天室！');location.href = 'wugong.asp';</script>"
	Response.End
end if
input=trim(request.form("input"))
a=trim(request("a"))
if not isnumeric(input) then 
	Response.Write "<script language=JavaScript>{alert('提示：["&input&"]输入错误，请使用数字！');location.href = 'wugong.asp';}</script>"
	Response.End 
end if
input=int(abs(input))
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("cwjh_usermdb")
'金币转武功
rs.open "select 金币 from 用户 where 姓名='"&cwjh_name&"'",conn,2,2
if rs("金币")<input then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
 	Response.Write "<script language=JavaScript>{alert('你没有这么多的金币无法转换！');location.href = 'wugong.asp';}</script>"
	response.end
end if
conn.execute "update 用户 set 金币=金币-" & input & ",武功=武功+"&int(input*1000)&" where 姓名='"&cwjh_name&"'"
rs.close
set rs=nothing
conn.close
set conn=nothing
says="<font color=red>【交易市场】["&cwjh_name&"]</font><font color=green>把"&input&"个金币兑现成了"&int(input*1000)&"点武功!</font>"
call showchat(says)
Response.Write "<script Language=Javascript>alert('"&cwjh_name&"您转换"&input*1000&"点武功！');location.href = 'wugong.asp';</script>"
%>