<!--#include file="../inc/DAL.asp"-->
<!--#include file="Check.asp"-->
<%
dim objXML,xml,strSourceFile,Re
strSourceFile = Server.MapPath("/_SysNotice.xml")
Set objXML =Server.CreateObject("Microsoft.XMLDOM") '创建一个XML对像
objXML.load(strSourceFile) '把XML文件读入内存
Set xml=objXML.documentElement '选取节点 Advertisement

if request.form("Method")="SetNotice" then
	'RW Request.form("PubNotice")
	dim PubNotice,PriNotice
	PubNotice=split(Request.form("PubNotice"),chr(13))
	if ubound(PubNotice)=0 then PubNotice(0)=Request.form("PubNotice")
	PriNotice=split(Request.form("PriNotice"),chr(13))
	if ubound(PriNotice)=0 then PriNotice(0)=Request.form("PriNotice")
	Re=Re&"<?xml version=""1.0""?>"
	Re=Re&"<SysNotice>"
	Re=Re&"<PubTime>"&Clng(Request.form("PubTime"))*1000*60&"</PubTime>"
	Re=Re&"<PriTime>"&Clng(Request.form("PriTime"))*1000*60&"</PriTime>"
	Re=Re&"<PubNotice>"
	for i=0 to ubound(PubNotice)
		Re=Re&"<Notice><![CDATA["&PubNotice(i)&"]]></Notice>"
	next
	Re=Re&"</PubNotice>"
	Re=Re&"<PriNotice>"
	for j=0 to ubound(PriNotice)
		Re=Re&"<Notice><![CDATA["&PriNotice(j)&"]]></Notice>"
	next
	Re=Re&"</PriNotice>"
	Re=Re&"</SysNotice>"
	'rw Re
	CreatFile "/_SysNotice.xml",Re
    RW "<script>alert('修改成功!');location.href='SetNotice.asp';</script>"
end if

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iShow Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>系统公告设置&nbsp;&nbsp;&nbsp;<a href="SetIndexNotice.asp" style="text-decoration:none;">首页公告</a></h2>
    </div>
    <div class="contentbox">
        <form action="#" method="post" >
            <label for="PubTime"><strong>公聊公告间隔时间(分钟):</strong></label>
			<input type="text" id="PubTime" name="PubTime" class="inputbox"  value="<%=Clng(xml.childNodes.item(0).text)/1000/60%>"/>
            <br>
            <label for="PriTime"><strong>私聊公告间隔时间(分钟):</strong></label>
			<input type="text" id="PriTime" name="PriTime" class="inputbox"  value="<%=Clng(xml.childNodes.item(1).text)/1000/60%>"/>
            <br>
            <label for="PubNotice"><strong>公聊公告(支持HTML,每行一个):</strong></label>
            <textarea id="PubNotice" name="PubNotice" rows="5" cols="100"><%
			for i=0 to xml.childNodes.item(2).childNodes.length-1
				RW xml.childNodes.item(2).childNodes.item(i).text&chr(13)
			next
			%></textarea>
            <br>
			<label for="PriNotice"><strong>私聊公告(支持HTML,每行一个):</strong></label>
            <textarea id="PriNotice" name="PriNotice" rows="5" cols="100"><%
			for i=0 to xml.childNodes.item(3).childNodes.length-1
				RW xml.childNodes.item(3).childNodes.item(i).text&chr(13)
			next
			%></textarea>
            <br>
            <input type="hidden" value="SetNotice" name="Method"/>
            <input type="submit" value="提交" class="btn" />
        </form>
    </div>
</div>
</body>
</html>
