<!--#include file="../include/hf_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%call checkmanage("05")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">
<%
action=request("ok")

if action="" then 
    Set rs = conn.Execute("select * from hfvipsetup") 
	%>
	<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
	<form action=user_xieyi.asp method=post name=setup>
	<tr class=backs><td colspan=2 class=td height=18>会员注册协议 &nbsp;</td></tr>
	<tr><td width=20% align=center>会员注册协议</td><td>
<%
if rs("reg_xieyi")="" or isnull(rs("reg_xieyi")) then
	response.write "<script language='javascript'>"
	response.write "alert('您还没有添加会员注册协议，请单击“确定”开始添加。！');"
	response.write "location.href='user_xieyi.asp?ok=edit';"
	response.write "</script>"
	response.end
else
response.write rs("reg_xieyi")
end if
%>
	</td></tr>

<tr><td colspan=2><INPUT name="ok" TYPE="hidden" value="edit"><INPUT name=action TYPE="submit" value="修改内容"> &nbsp;</td></tr>
</form>
</table>
	<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
end if

if action="edit" then 
    Set rs = conn.Execute("select * from hfvipsetup") 
	%>
	<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
	<form action=user_xieyi.asp method=post name=setup>
	<tr class=backs><td colspan=2 class=td height=18>会员注册协议 &nbsp;</td></tr>
	<tr><td width=20% align=center>会员注册协议</td><td><TEXTAREA alt="请填写会员注册协议内容<br>支持html代码" NAME="reg_xieyi" ROWS="15" COLS="60" style="overflow:auto;"><%
if rs("reg_xieyi")="" or isnull(rs("reg_xieyi")) then
else
response.write replace(rs("reg_xieyi"),"<BR>",vbCRLF)
end if
%></TEXTAREA></td></tr>

<tr><td colspan=2><INPUT name="ok" TYPE="hidden" value="ok"><INPUT name=action TYPE="submit" value="保存设置"> &nbsp;</td></tr>
</form>
</table>
	<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
end if

if action="ok" then

	if request.form("reg_xieyi")="" then
	response.write "<script language='javascript'>"
	response.write "alert('出错了，没有填写会员注册协议的内容！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if


     Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from hfvipsetup"
	 rs.open sql,conn,1,3

 	 reg_xieyi=replace(request.form("reg_xieyi"),vbCRLF,"<BR>")
 	 reg_xieyi=replace(reg_xieyi," ","&nbsp;")
 	 rs("reg_xieyi")=reg_xieyi

	rs.update
	url="user_xieyi.asp"
	rs.close	
	set rs=nothing
	conn.close
	set conn=nothing

	response.write "<script language='javascript'>"
	response.write "alert('操作成功，您设置的信息已保存！');"
	response.write "location.href='"&url&"';"			
	response.write "</script>"
end if%>