<!--#include file="Admin.asp" -->
<!--#include file="cf.asp" -->
<!-- #include file="./conn.asp" -->
<%
Function SafeRequest(ParaName,ParaType) 
'--- 传入参数 --- 
'ParaName:参数名称-字符型 
'ParaType:参数类型-数字型(1表示以上参数是数字，0表示以上参数为字符) 

Dim ParaValue 
ParaValue=Request(ParaName) 
If ParaType=1 then 
If not isNumeric(ParaValue) then 
'Response.write "参数" & ParaName & "必须为数字型！<br><br>" 
Response.write "大哥大姐们,偶是菜鸟,多多照顾小弟嘛.<br><br>"
Response.write "波一个.大哥一定教偶也玩黑客啊!<br><br>"
Response.write "黑偶小站没什么意思,教我黑腾讯好不好?!<br><br>"
Response.write "有漏洞一定给小弟说哦,向测试漏洞的大哥致敬!偶Q:232706573!<br><br>"
Response.end 
End if 
Else 
ParaValue=replace(ParaValue,"'","''") 
	ParaValue = Replace(ParaValue, "select", "sel&#101;ct")
	ParaValue = Replace(ParaValue, "join", "jo&#105;n")
	ParaValue = Replace(ParaValue, "union", "un&#105;on")
	ParaValue = Replace(ParaValue, "where", "wh&#101;re")
	ParaValue = Replace(ParaValue, "insert", "ins&#101;rt")
	ParaValue = Replace(ParaValue, "delete", "del&#101;te")
	ParaValue = Replace(ParaValue, "update", "up&#100;ate")
	ParaValue = Replace(ParaValue, "like", "lik&#101;")
	ParaValue = Replace(ParaValue, "drop", "dro&#112;")
	ParaValue = Replace(ParaValue, "create", "cr&#101;ate")
	ParaValue = Replace(ParaValue, "modify", "mod&#105;fy")
	ParaValue = Replace(ParaValue, "rename", "ren&#097;me")
	ParaValue = Replace(ParaValue, "alter", "alt&#101;r")
	ParaValue = Replace(ParaValue, "cast", "ca&#115;t")
	ParaValue = Replace(ParaValue, "and", "an&#100;")
	ParaValue = Replace(ParaValue, "or", "o&#114;")
End if 
SafeRequest=ParaValue 
End function
%>
<%if request.querystring("action")="addsave" then
set rs=server.createobject("adodb.recordset")
rs.open "[gonggao]",conn,1,3
d_title=Replace(Request.Form("title"),"'","''")
	sContent = ""
	For i = 1 To Request.Form("gonggao").Count
		sContent = sContent & Request.Form("gonggao")(i)
	Next
rs.addnew
rs("title")=d_title
rs("d_bz")=sContent
rs("d_date")=Request.Form("d_date")
rs("d_data")=Request.Form("d_data")
rs.update
rs.close
set rs=nothing%>
发表成功！<a href="admin_gonggao.asp">返回</a><%
end if%>
<%
if  request.querystring("action")="editsave" then
set rs=server.createobject("adodb.recordset")
id=saferequest("id",1)
rs.open "[gonggao] where d_id="&id,conn,1,3
d_title=Replace(Request.Form("title"),"'","''")
sContent = ""
	For i = 1 To Request.Form("gonggao").Count
		sContent = sContent & Request.Form("gonggao")(i)
	Next
rs("title")=d_title
rs("d_bz")=sContent
rs("d_date")=Request.Form("d_date")
rs("d_data")=Request.Form("d_data")
rs.update
rs.close
%>
修改成功！<a href="admin_gonggao.asp">返回</a> <%end if%>
<%
if  request.querystring("action")="del" then
set rs=server.createobject("adodb.recordset")
id=saferequest("id",1)
rs.open "[gonggao] where d_id="&id,conn,1,3
rs.delete
rs.close%>
删除成功！<a href="admin_gonggao.asp">返回</a><%
end if
%>
<%sql="select * from gonggao order by d_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<link href="../include/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="include/data.js"></script>
<style type="text/css">
<!--
.style1 {	color: #000000;
	font-size: 12px;
}
-->
</style>
<br>
<br><%if request.querystring("action")="" then%>
<table width="95%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr> 
          <td colspan="5" bgcolor="#E8E8E8">公告管理</td>
        </tr>
        <tr align="center" bgcolor="#E8E8E8"> 
          <td class="chinese" width="8%" bgcolor="#F5F5F5">编号</td>
          <td class="chinese" width="56%" bgcolor="#F5F5F5">标题</td>
          <td class="chinese" width="13%" bgcolor="#F5F5F5">发布日期</td>
          <td class="chinese" width="12%" bgcolor="#F5F5F5">结束日期</td>
          <td class="chinese" width="11%" bgcolor="#F5F5F5">操作</td>
        </tr>
        <%if not rs.eof then
do while not rs.eof
%>
        <tr> 
          <td bgcolor="#FFFFFF" class="chinese" align="center"><%=rs("d_id")%></td>
          <td bgcolor="#FFFFFF" class="chinese"><%d_bz=rs("title")
		  if len(d_bz)>35 then d_bz=left(rs("d_bz"),35)+"..."%><%=d_bz%></td>
          <td align="center" bgcolor="#FFFFFF" class="chinese"><%=rs("d_date")%></td>
          <td align="center" bgcolor="#FFFFFF" class="chinese"><%=rs("d_data")%></td>
          <td bgcolor="#FFFFFF" class="chinese" align="center"><a href="?action=edit&id=<%=rs("d_id")%>">修改</a> <a href="?action=del&id=<%=rs("d_id")%>">删除</a></td>
        </tr>
        <%i=i+1
rs.movenext
loop
else
If rs.EOF And rs.BOF Then%>
        <tr> 
          <td bgcolor="#FFFFFF" class="chinese" colspan=5 align="center">当前还没有
          公告！</td>
        </tr>
        <%end if
end if%>
</table>
	  <%rs.close
	  set rs=nothing
	  else
	  %>
	  <br>      <%if request.querystring("action")="add" then%>
	  <table width="95%" height="321" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr>
          <td width="100%" bgcolor="#E8E8E8">添加公告</td>
        </tr>
        
        <tr>
          <td height="310" align="center" bgcolor="#FFFFFF" class="chinese"><table width="90%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#C0C0C0"  style="border-collapse: collapse">
            <form name="form1" method="post" action="?action=addsave">
           <tr>
              <td width="15%" height="26">公告标题：</td>
              <td width="85%"><label>
                <input name="title" type="text" id="title" size="72" maxlength="100" />
              </label></td>
            </tr>
			<tr>
              <td height="233">公告内容：</td>
              <td height="233"><textarea name="gonggao"  style="display:none"></textarea>
			  <iframe ID="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=gonggao&style=s_mini" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe> 
                <br />
              支持HTML代码，请正确书写，勿用&lt;table&gt;&lt;tr&gt;&lt;td&gt;等制表符！</td>
            </tr>
            <tr>
              <td width="15%" height="26">发布日期：</td>
              <td width="85%"><label>
                <input name="d_date" type="text" id="d_date" maxlength="20" onFocus="CalendarWebControl.show(this,false,this.value);" />
              格式（2008-08-08）</label></td>
            </tr>
            <tr>
              <td height="26">结束如期：</td>
              <td><label>
                <input name="d_data" type="text" id="d_data" maxlength="20" onFocus="CalendarWebControl.show(this,false,this.value);" />
              格式（2008-08-08）</label></td>
            </tr>
            <tr>
              <td height="24" colspan="2"><div align="center">
                <input type="submit" name="Submit" value="提交">
                &nbsp;&nbsp;&nbsp;
                <input type="reset" name="Submit" value="重置">
              </div></td>
            </tr> </form>
          </table></td>
        </tr>
        
</table>
      <br><%end if
	  if request.querystring("action")="edit" then%>
      <table width="95%" height="196" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr>
          <td width="100%" bgcolor="#E8E8E8">修改公告</td>
        </tr>
        <tr>
          <td height="310" align="center" bgcolor="#FFFFFF" class="chinese">
		                      <%id=saferequest("id",1)
					sql="select * from gonggao where d_id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
gonggao=rs("d_bz")
if rs.bof and rs.eof then %>
无此公告 
<%else%>
<table width="90%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#C0C0C0"  style="border-collapse: collapse">
            <form name="form1" method="post" action="?action=editsave&id=<%=id%>">
              <tr>
                <td width="15%" height="26">公告标题：</td>
                <td width="85%"><label>
                  <input name="title" type="text" id="title" value="<%=rs("title")%>" size="72" maxlength="100" />
                </label></td>
              </tr>
              <tr>
                <td height="233">公告内容：</td>
                <td height="233"><textarea name="gonggao" style="display:none"><%=Server.HtmlEncode(gonggao)%></textarea>
				<iframe ID="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=gonggao&style=s_mini" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe>
                  
<br />
                支持HTML代码，请正确书写，勿用&lt;table&gt;&lt;tr&gt;&lt;td&gt;等制表符！</td>
              </tr>
              <tr>
                <td width="15%" height="26">发布日期：</td>
                <td width="85%"><label>
                  <input name="d_date" type="text" id="d_date" value="<%=rs("d_date")%>" maxlength="20" onFocus="CalendarWebControl.show(this,false,this.value);" />
                  格式（2008-08-08）</label></td>
              </tr>
              <tr>
                <td height="26">结束如期：</td>
                <td><label>
                  <input name="d_data" type="text" id="d_data" value="<%=rs("d_data")%>" maxlength="20" onFocus="CalendarWebControl.show(this,false,this.value);" />
                  格式（2008-08-08）</label></td>
              </tr>
              <tr>
                <td height="24" colspan="2"><div align="center">
                    <input type="submit" name="Submit2" value="提交" />
                  &nbsp;&nbsp;&nbsp;
                  <input type="reset" name="Submit2" value="重置" />
                </div></td>
              </tr>
            </form>
		    </table>
			<%rs.close%>
		  <%end if%></td>
        </tr>
</table>
<%end if
end if
%>

      <hr size="1" width="760">
      <p align="center" class="style1">Powered by <B><A href="<%=url%>" 
target=_blank><%=titlename%></A></B> &copy 2005-2006 , <B><A 
href="http://Www.oyaya.Cn">Www.oyaya.Cn</A></B> <B>(</B><A href="mailto:oyayaweb@163.com"><B>满载而归</B></A><B>)</B></p>
      <p>　</p>