<!--#include file="Inc.asp"-->
<%
'================================
'当前版本号：3.0
'程序作者：杜杜
'杜杜 版权所有
'Http://vvbbs.3126.com
'================================
Dim sql,rs,connwc,connwcstr,wcdb,rusernmoney
wcdb="wc_game/wc_high-score.mdb"
connwcstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(wcdb)
set rs=Server.CreateObject("ADODB.recordset")
set connwc=server.createobject("adodb.connection")
connwc.open connwcstr
If Not IsObject(Conn) Then ConnectionDatabase
select case request("act")
case "buy_in"
	call buy_in
case "cash_in"
	call cash_in
case else
end select
sub buy_in
'	if dvbbs.userid=0 then
'		response.write("islogged=0&isnum=0&grtzero=0&allmoney=0&buyamt=0")
'		Exit Sub
'	end if
	Dim buyamt
	buyamt=Request.Form("buyamt")
	'buyamt=Request.querystring("buyamt")
	response.write("islogged=1")
	if IsNumeric(buyamt)=true then
		buyamt=int(buyamt)
		if buyamt>0 then

'	If IsSqlDataBase = 1 Then
'		rs.ActiveConnection = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
'	Else
		rs.ActiveConnection = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("Data/#vvskybbs.asp")
'	End If
			rs.Source = "SELECT Coin FROM [KK_user] where Name='"&BBS94KK.MyName&"'"
			'rs.ActiveConnection = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & db)
			rs.Open()
				rusernmoney=rs("Coin")
			rs.close
if rusernmoney>=buyamt then
			conn.execute("update [KK_user] set Coin=Coin-"&buyamt&" where Name='"&BBS94KK.MyName&"'")
			response.write("&isnum=1&grtzero=1&allmoney=1&buyamt="&buyamt)
else
response.write("&islogged=0&isnum=0&grtzero=0&allmoney=0&buyamt=0")
end if
		else
			response.write("&isnum=1&grtzero=0&allmoney=0&buyamt=0")
		end if
	else
		response.write("&isnum=0&grtzero=0&allmoney=0&buyamt=0")
	end if
end sub
sub cash_in
Dim refchk
refchk=request.serverVariables("Http_REFERER")
if refchk<>"" then
'response.end
response.redirect "http://www.vvbbs.be/bbs/"
end if
'	if dvbbs.userid=0 then
'		response.write("islogged=0&isnum=0&grtzero=0&buyamt=0")
'		Exit Sub
'	end if
	Dim buyamt
	buyamt=Request.Form("buyamt")
	'buyamt=Request.querystring("buyamt")
	response.write("islogged=1")
	if IsNumeric(buyamt)=true then
		buyamt=int(buyamt)
		if buyamt>0 then
			conn.execute("update [KK_user] set Coin=Coin+"&buyamt&" where Name='"&BBS94KK.MyName&"'")
			response.write("&isnum=1&grtzero=1&buyamt="&buyamt)
		else
			response.write("&isnum=1&grtzero=0&buyamt=0")
		end if
	else
		response.write("&isnum=0&grtzero=0&buyamt=0")
	end if
end sub
%>