<%@ LANGUAGE = VBScript.Encode %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<TITLE>网站公告添加</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</HEAD>
<!--#include file="../Include/conn.asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/Version.asp" -->
<!--#include file="CheckAdmin.asp"-->
<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方客服中心 http://www.ip126.com
'微信公众号 ip126com
'QQ:530051328 mail:bbfhq@163.com
'=====================================
%>
<%
if Instr(session("AdminPurview"),"|37,")=0 then 
  response.write ("<font color='red')>你不具有该管理模块的操作权限，请返回！</font>")
  response.end
end if
'========判断是否具有管理权限
%>
<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此记录吗？"))
     return true;
   else
     return false;
}
</script>
<%Result=request.querystring("Result")
if Request.QueryString("no")="yes" then
 id= Trim(Request("id"))
 Set Rs = Server.CreateObject("ADODB.Recordset")
 Rs.Open "DELETE FROM TianTianCMS_Notice Where id="&id,Conn,2,3,1
 Set Rs= Nothing
 Response.Redirect "Admin_AddAffiche.asp"
end if

if Request.QueryString("mark")="southidc" then
If request.form("title")="" Then
Response.Write("<script language=""JavaScript"">alert(""错误：您没输入标题，请返回检查！！"");history.go(-1);</script>")
response.end
end if

If request.form("content")="" Then
Response.Write("<script language=""JavaScript"">alert(""错误：您没输入公吿内容，请返回检查！！"");history.go(-1);</script>")
response.end
end if

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

rs.addnew
if request.form("html")="on" then
rs("content")=request.form("content")
else
rs("content")=htmlencode2(request.form("content"))
end if
rs("title")=request.form("title")
rs("time")=date()
rs.update
rs.close
response.redirect "Admin_AddAffiche.asp"
end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select  * from TianTianCMS_Notice"
rs.open sql,conn,1,1
%>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <strong><br>
      </strong>
      <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
        <tr>
          <th>网站公告列表</th>
        </tr>
        <tr>
          <td height="24" align="center" nowrap="nowrap"  class="forumrow"><a href="Admin_AddAffiche.asp" onclick='changeAdminFlag(&quot;添加&quot;)'>公告列表</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href='Admin_editAffiche.asp?Result=add'>添加公告</a></td>
        </tr>
      </table>
      <br>
      <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
        <form name="editForm" method="post" action="AdminEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
          <tr>
            <th width="100%" height="22">【管理网站公告】</th>
          </tr>
          <tr <%if ID=1 then response.write ("style=display:none")%>>
            <td align="right" class="forumRow"><div align="center">
              <table width="100%" border="0" cellspacing="2" cellpadding="3">
                <tr bgcolor="#ECF5FF">
                  <td width="25%" height="25" bgcolor="#ECF5FF"><div align="center">中文标题</div></td>
				  <td width="25%"><div align="center">英文标题</div></td>
                  <td width="19%"><div align="center">创建时间</div></td>                 
                  <td width="10%"><div align="center">活动状态</div></td>
				  <td width="10%"><div align="center">是否固顶</div></td>
				   <td width="8%"><div align="center">操作</div></td>
                </tr>
                <% do while not Rs.eof %>
                <tr bgcolor="#CCFFFF">
                  <td height="22" bgcolor="#EAFEFE"><div align="center"> <%=rs("TitleCH")%></div></td>
                   <td bgcolor="#EAFEFE"><div align="center"> <%=rs("TitleEN")%></div></td>
                  <td bgcolor="#EAFEFE"><div align="center"><%=rs("time") %></div></td>                  
                  <td bgcolor="#EAFEFE"><div align="center">
                    <%if rs("Acti")=1 then%>
                    活动
                    <%else%>
                    隐藏
                    <%end if%>
                  </div></td>
                  <td bgcolor="#EAFEFE"><div align="center">
                    <%if rs("topgg")=1 then%>
                    是
                    <%else%>
                    否
                    <%end if%>
                  </div></td>
                 <td bgcolor="#EAFEFE"><div align="center"><a href='Admin_editAffiche.asp?id=<%=Rs("id")%>&Result=Modify'>修改</a></div></td>
                </tr>
                <%Rs.MoveNext 
loop 
%>
              </table>
            </div></td>
          </tr>
        </form>
      </table>
      <br> 
      <br> </td>
  </tr>
</table>
<%rs.close%>
