<!--#include file="conn.asp"-->
<!--#include file="../../inc/filter.asp"-->
<%
Rem 获得推荐私服列表
sub get_tjsf_list()
	dim list
	list=""

	set rs_list=Server.CreateObject("ADODB.RecordSet")
	rs_list.open "select * from [fksf_tjsf]",conn,1,1
	for i=1 to rs_list.recordcount
%>
		<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;">
					<td align="center"><a href="<%=rs_list("sfurl")%>" target="_blank"><%=rs_list("sfname")%></a></td>
					<td align="center"><%=rs_list("sfip")%></td>
					<td align="center"><%=rs_list("kfdate")%></td>
					<td align="center"><%=rs_list("kfQQ")%></td>
					<td align="center"><a href="tjsf_update_form.asp?id=<%=rs_list("id")%>">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="tjsf_delete.asp?id=<%=rs_list("id")%>">删除</a></td></tr>
<%
		rs_list.movenext()
	next
	rs_list.close()
	set rs_list=nothing
end sub
%>

<%
Rem 套装价格管理入口
sub tjsf_access()
	action=trim(request("action"))
	
	if(action="") then
		response.write("<script language=javascript>")
		response.write("alert('判断参数不能为空');")
		response.write("window.location='main_body.asp';")
		response.write("</script>")
	else
		if(ChkBadWord(action)<>0) then
			response.write("<script language=javascript>")
			response.write("alert('判断参数包含非法字符');")
			response.write("window.location='main_body.asp';")
			response.write("</script>")
		else
			if(action="update") then
				call tjsf_update()'操作套装价格更新
			else
				if(action="insert") then
					call tjsf_insert()'操作套装价格添加
				else
					if(action="delete") then
						call tjsf_delete()'操作套装价格删除
					end if
				end if
			end if
		end if
	end if
end sub
%>


<%
Rem 推荐私服更新
sub tjsf_update()
	id=trim(request("id"))
	sfname=trim(request("sfname"))
	sfurl=trim(request("sfurl"))
	sfip=trim(request("sfip"))
	kfdate=trim(request("kfdate"))
	kfQQ=trim(request("kfQQ"))
	
	if(id="" or sfname="" or sfurl="" or sfip="" or kfdate="" or kfQQ="") then
		response.Write("<script language=javascript>")
		response.Write("alert('参数不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		if(ChkBadWord(id)<>0 or ChkBadWord(sfname)<>0 or ChkBadWord(sfurl)<>0 or ChkBadWord(sfip)<>0 or ChkBadWord(kfdate)<>0 or ChkBadWord(kfQQ)<>0) then
			response.Write("<script language=javascript>")
			response.Write("alert('参数包含非法字符');")
			response.Write("history.go(-1);")
			response.Write("</script>")
		else
			set rs_tjsf=Server.CreateObject("ADODB.RecordSet")
			rs_tjsf.open "select * from [fksf_tjsf] where id="&id,conn,1,3
			if(rs_tjsf.eof) then
				rs_tjsf.close()
				set rs_tjsf=nothing
				response.Write("<script language=javascript>")
				response.Write("alert('本系统无该推荐私服');")
				response.Write("window.location='main_body.asp';")
				response.Write("</script>")
			else
				rs_tjsf("sfname")=sfname
				rs_tjsf("sfurl")=sfurl
				rs_tjsf("sfip")=sfip
				rs_tjsf("kfdate")=kfdate
				rs_tjsf("kfQQ")=kfQQ
				rs_tjsf.update()
				rs_tjsf.close()
				set rs_tjsf=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
%>

<%
Rem 推荐私服添加
sub tjsf_insert()
	sfname=trim(request("sfname"))
	sfurl=trim(request("sfurl"))
	sfip=trim(request("sfip"))
	kfdate=trim(request("kfdate"))
	kfQQ=trim(request("kfQQ"))
	
	if(sfname="" or sfurl="" or sfip="" or kfdate="" or kfQQ="") then
		response.Write("<script language=javascript>")
		response.Write("alert('参数不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		if(ChkBadWord(sfname)<>0 or ChkBadWord(sfurl)<>0 or ChkBadWord(sfip)<>0 or ChkBadWord(kfdate)<>0 or ChkBadWord(kfQQ)<>0) then
			response.Write("<script language=javascript>")
			response.Write("alert('参数包含非法字符');")
			response.Write("history.go(-1);")
			response.Write("</script>")
		else
			set rs_tjsf=Server.CreateObject("ADODB.RecordSet")
			rs_tjsf.open "select * from [fksf_tjsf] where sfname='"&sfname&"'",conn,1,3
			if(not rs_tjsf.eof) then
				rs_tjsf.close()
				set rs_tjsf=nothing
				response.Write("<script language=javascript>")
				response.Write("alert('该推荐私服已存在');")
				response.Write("window.location='main_body.asp';")
				response.Write("</script>")
			else
				rs_tjsf.addnew()
				rs_tjsf("sfname")=sfname
				rs_tjsf("sfurl")=sfurl
				rs_tjsf("sfip")=sfip
				rs_tjsf("kfdate")=kfdate
				rs_tjsf("kfQQ")=kfQQ
				rs_tjsf.update()
				rs_tjsf.close()
				set rs_tjsf=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
%>

<%
Rem 友情链接删除
sub tjsf_delete()
	id=trim(request("id"))
	
	if(id="") then
		response.Write("<script language=javascript>")
		response.Write("alert('参数不能为空');")
		response.Write("history.go(-1);")
		response.Write("</script>")
	else
		if(ChkBadWord(id)<>0) then
			response.Write("<script language=javascript>")
			response.Write("alert('参数包含非法字符');")
			response.Write("history.go(-1);")
			response.Write("</script>")
		else
			conn.execute("delete from [fksf_tjsf] where id="&id)
			response.Write("<script language=javascript>")
			response.Write("alert('推荐私服删除成功');")
			response.Write("window.location='main_body.asp';")
			response.Write("</script>")
		end if
	end if
end sub
%>
