<!--#include file="conn.asp"-->
<!--#include file="../../inc/filter.asp"-->
<%
Rem 网站配置入口
sub config_access()
	action=trim(request("action"))
	if(action="") then
		response.Write("<script language=javascript>")
		response.Write("alert('传递判断参数不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		if(ChkBadWord(action)<>0) then
			response.Write("<script language=javascript>")
			response.Write("alert('传递判断参数包含非法字符');")
			response.Write("history.go(-1);")
			response.Write("</script>")
		else
			if(action="config") then
				call system_config()'操作网站基本配置
			else
				if(action="ver") then
					call system_ver()'操作游戏版本介绍
				else
					if(action="bank") then
						call system_bank()'操作汇款方式修改
					else
						if(action="down") then
							call system_down()'操作补丁下载地址配置
						end if
					end if
				end if
			end if
		end if
	end if
end sub
%>

<%
Rem 保存补丁下载地址配置
sub system_down()
	dim sContent1,i,downid,webname
	For i = 1 To Request.Form("content1").Count 
		sContent1 = sContent1 & Request.Form("content1")(i) 
	Next
	if(sContent1="") then
		response.Write("<script language=javascript>")
		response.Write("alert('补丁下载地址不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		set rs_downid=Server.CreateObject("ADODB.RecordSet")'获得的网站中下载地址的新闻ID
		rs_downid.open "select * from [fksf_config] where id=1",conn,1,1
		if(rs_downid.eof) then
			rs_downid.close()
			set rs_downid=nothing
			response.Write("<script language=javascript>")
			response.Write("alert('网站版本错误，请尽快与开发商联系');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		else
			webname=rs_downid("webname")
			downid=rs_downid("downid")
			rs_downid.close()
			set rs_downid=nothing
			set rs_down=Server.CreateObject("ADODB.RecordSet")'查找下载地址的新闻
			rs_down.open "select * from [fksf_news] where id="&downid,conn,1,3
			if(rs_down.eof) then
				'如果不存在就创建
				rs_down.addnew()
				rs_down("classname")="下载"
				rs_down("subject")=webname&"补丁下载地址"
				rs_down("content")=sContent1
				rs_down("publishdate")=now()
				rs_down.update()
				set rs_down=nothing
				'查询新创建的下载地址的新闻ID
				set rs_down1=Server.CreateObject("ADODB.RecordSet")
				rs_down1.open "select * from [fksf_news] where classname='下载'",conn,1,1
				downid=rs_down1("id")
				rs_down1.close()
				set rs_down1=nothing
				'将新获得的新闻ID插入系统表中
				set rs_downid1=Server.CreateObject("ADODB.RecordSet")
				rs_downid1.open "select * from [fksf_config] where id=1",conn,1,3
				rs_downid1("downid")=downid
				rs_downid1.update()
				rs_downid1.close()
				set rs_downid1=nothing
			else
				'如果存在
				rs_down("subject")=webname&"补丁下载地址"
				rs_down("content")=sContent1
				rs_down("publishdate")=now()
				rs_down.update()
				rs_down.close()
				set rs_down=nothing
			end if
			response.Write("<script language=javascript>")
			response.Write("alert('添加补丁下载地址成功');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		end if
	end if
end sub
%>

<%
Rem 保存汇款方式
sub system_bank()
	dim sContent1,i,bankid,webname
	For i = 1 To Request.Form("content1").Count 
		sContent1 = sContent1 & Request.Form("content1")(i) 
	Next
	if(sContent1="") then
		response.Write("<script language=javascript>")
		response.Write("alert('汇款方式不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		set rs_bankid=Server.CreateObject("ADODB.RecordSet")'获得的网站中汇款方式的新闻ID
		rs_bankid.open "select * from [fksf_config] where id=1",conn,1,1
		if(rs_bankid.eof) then
			rs_bankid.close()
			set rs_bankid=nothing
			response.Write("<script language=javascript>")
			response.Write("alert('网站版本错误，请尽快与开发商联系');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		else
			webname=rs_bankid("webname")
			bankid=rs_bankid("bankid")
			rs_bankid.close()
			set rs_bankid=nothing
			set rs_bank=Server.CreateObject("ADODB.RecordSet")'查找游戏版本介绍的新闻
			rs_bank.open "select * from [fksf_news] where id="&bankid,conn,1,3
			if(rs_bank.eof) then
				'如果不存在就创建
				rs_bank.addnew()
				rs_bank("classname")="汇款"
				rs_bank("subject")=webname&"汇款方式"
				rs_bank("content")=sContent1
				rs_bank("publishdate")=now()
				rs_bank.update()
				set rs_bank=nothing
				'查询新创建的汇款方式的新闻ID
				set rs_bank1=Server.CreateObject("ADODB.RecordSet")
				rs_bank1.open "select * from [fksf_news] where classname='汇款'",conn,1,1
				bankid=rs_bank1("id")
				rs_bank1.close()
				set rs_bank1=nothing
				'将新获得的新闻ID插入系统表中
				set rs_bankid1=Server.CreateObject("ADODB.RecordSet")
				rs_bankid1.open "select * from [fksf_config] where id=1",conn,1,3
				rs_bankid1("bankid")=bankid
				rs_bankid1.update()
				rs_bankid1.close()
				set rs_bankid1=nothing
			else
				'如果存在
				rs_bank("subject")=webname&"汇款方式"
				rs_bank("content")=sContent1
				rs_bank("publishdate")=now()
				rs_bank.update()
				rs_bank.close()
				set rs_bank=nothing
			end if
			response.Write("<script language=javascript>")
			response.Write("alert('添加私服汇款方式成功');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		end if
	end if
end sub
%>

<%
Rem 保存游戏版本介绍
sub system_ver()
	dim sContent1,i,verid,webname
	For i = 1 To Request.Form("content1").Count 
		sContent1 = sContent1 & Request.Form("content1")(i) 
	Next
	if(sContent1="") then
		response.Write("<script language=javascript>")
		response.Write("alert('游戏版本介绍不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		set rs_verid=Server.CreateObject("ADODB.RecordSet")'获得的网站中游戏版本介绍的新闻ID
		rs_verid.open "select * from [fksf_config] where id=1",conn,1,1
		if(rs_verid.eof) then
			rs_verid.close()
			set rs_verid=nothing
			response.Write("<script language=javascript>")
			response.Write("alert('网站版本错误，请尽快与开发商联系');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		else
			webname=rs_verid("webname")
			verid=rs_verid("verid")
			rs_verid.close()
			set rs_verid=nothing
			set rs_ver=Server.CreateObject("ADODB.RecordSet")'查找游戏版本介绍的新闻
			rs_ver.open "select * from [fksf_news] where id="&verid,conn,1,3
			if(rs_ver.eof) then
				'如果不存在就创建
				rs_ver.addnew()
				rs_ver("classname")="介绍"
				rs_ver("subject")=webname&"版本介绍"
				rs_ver("content")=sContent1
				rs_ver("publishdate")=now()
				rs_ver.update()
				set rs_ver=nothing
				'查询新创建的版本介绍的新闻ID
				set rs_ver1=Server.CreateObject("ADODB.RecordSet")
				rs_ver1.open "select * from [fksf_news] where classname='介绍'",conn,1,1
				verid=rs_ver1("id")
				rs_ver1.close()
				set rs_ver1=nothing
				'将新获得的新闻ID插入系统表中
				set rs_verid1=Server.CreateObject("ADODB.RecordSet")
				rs_verid1.open "select * from [fksf_config] where id=1",conn,1,3
				rs_verid1("verid")=verid
				rs_verid1.update()
				rs_verid1.close()
				set rs_verid1=nothing
			else
				'如果存在
				rs_ver("subject")=webname&"版本介绍"
				rs_ver("content")=sContent1
				rs_ver("publishdate")=now()
				rs_ver.update()
				rs_ver.close()
				set rs_ver=nothing
			end if
			response.Write("<script language=javascript>")
			response.Write("alert('添加私服版本介绍成功');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		end if
	end if
end sub
%>

<%
Rem 保存网站基本配置
sub system_config()
	webname=trim(request("site_name"))
	webtitle=trim(request("site_title"))
	weburl=trim(request("site_url"))
	serviceQQ=trim(request("serviceQQ"))
	
	if(webname="" or webtitle="" or weburl="" or serviceQQ="") then
		response.Write("<script language=javascript>")
		response.Write("alert('网站配置参数不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		if(ChkBadWord(webname)<>0 or ChkBadWord(webtitle)<>0 or ChkBadWord(weburl) or ChkBadWord(serviceQQ)<>0) then
			response.Write("<script language=javascript>")
			response.Write("alert('网站配置参数包含非法字符');")
			response.Write("history.go(-1);")
			response.Write("</script>")
		else
			set rs_config=Server.CreateObject("ADODB.RecordSet")
			rs_config.open "select * from [fksf_config] where id=1",conn,1,3
			if(rs_config.eof) then
				response.Write("<script language=javascript>")
				response.Write("alert('网站版本错误，请尽快与开发商联系');")
				response.Write("window.location='main_body.asp';")
				response.Write("</script>")
				rs_config.close()
				set rs_config=nothing
			else
				rs_config("webname")=webname
				rs_config("webtitle")=webtitle
				rs_config("weburl")=weburl
				rs_config("serviceQQ")=serviceQQ
				rs_config.update()
				rs_config.close()
				set rs_config=nothing
				response.Write("<script language=javascript>")
				response.Write("alert('网站配置成功');")
				response.Write("window.location='main_body.asp';")
				response.Write("</script>")
			end if
		end if
	end if
end sub
%>