⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_announce.asp

📁 政府网站集成OA办公考勤新闻发布网站信息管理会员管理
💻 ASP
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_FrontSetNotice")<>1 then HX_GoBack "对不起,您的权限不够!","" %>
<html>
<title> 管理网站公告</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
    function doSubmit(){
		if (document.a125_gonggao.Title.value==""){
			alert("公告标题不能为空!");
			return false;
		}		
		if (document.a125_gonggao.Content.value==""){
			alert("公告内容不能为空!");
			return false;
		}
		return true;
	}
//-->
</script>
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin='20' leftmargin='0' bottommargin='0'>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" align="center"><a href="Admin_Announce.asp?action=Add">添加公告</a> | <a href="Admin_Announce.asp">管理公告</a></td>
</tr>
</table>
<br>
<%
dim CurPage,StartPageNum,EndPageNum,P,delsql,taxis
Set rs = Server.CreateObject("ADODB.Recordset")

if request("action")="Edit" then
id=request.querystring("id")
rs.Open "Select * From a125_gonggao where id="&id, conn,3,3
%>

<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
 <table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>修改公告</font></td></tr></table>
 <table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<form action="Admin_Announce.asp?Action=Modify" method="POST" name="a125_gonggao" id="a125_gonggao" > 
 <tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'> 
<td width="114" height="23"> 
<div align="center">标题:</div></td>
<td width="365" height="23"> <input type="text" name="Title" size="30" value="<%=rs("Title")%>"> 
<input type=hidden name=id value="<%=rs("id")%>">
<input name="taxis" type="text" id="Order" value="<%=Rs("taxis")%>" size="2" maxlength="5" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: rgb(255,0,0); BORDER-BOTTOM: rgb(0,0,0) 1px solid" >
排序</td>
  </tr>
 <tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'> 
<td height="147"> 
<div align="center">内容:</div></td>
<td> <textarea name="Content" rows="10" cols="70"><%=rs("Content")%></textarea> 
</td>
  </tr>
    <tr bgcolor="#F6F6F6"> 
      <td height="24" colspan=2 align=center> 
        <input type="submit" name="Submit" value="提交" onClick="return doSubmit()"> 
      <input type="reset" name="reset" value="清除"></td>
  </tr>
</table></form>
</td></tr></table><br>
<% end if %>
<% if request("action")="Add" then %> 
<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
 <table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>添加公告</font></td></tr></table>
 <table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<form action="Admin_Announce.asp?Action=Save" method="post" name="a125_gonggao" id="a125_gonggao">
 <tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'> 
<td width="114" height="23"> 
<div align="center">标题:</div></td>
<td width="365"> 
<input name="Title" type="text" id="Title" size="35">

<input name="Order" type="text" id="Order" value="" size="2" maxlength="5"  style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: rgb(255,0,0); BORDER-BOTTOM: rgb(0,0,0) 1px solid" >
排序</td>
    </tr>
 <tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'> 
<td height="147"> 
<div align="center">内容:</div></td>
      
<td> <textarea name="Content" cols="70" rows="10" id="内容"></textarea> 
</td>
    </tr>
    <tr bgcolor="#F6F6F6"> 
      <td height="24" colspan=2 align=center> 
        <input type="submit" name="Add" value="添加" onClick="return doSubmit()"> 
        <input type="reset" name="Reset" value="清除"></td>
    </tr>
    </form>
  </table></td></tr></table><br>

<% end if %>
<%
    if request("action") = "" then
    If Request.QueryString("CurPage") = "" or Request.QueryString("CurPage") = 0 then
    CurPage = 1
    Else
    CurPage = CINT(Request.QueryString("CurPage"))
    End If
    
    if WS_S.MemberPriv("WS_FrontSetadmin")=1 then    
    rs.Open "Select * From a125_gonggao Order By id DESC", conn, 1,1
    else
    rs.Open "Select * From a125_gonggao where writerid="&LOGINUid&" Order By id DESC", conn, 1,1   
    end if     
    
    if rs.eof and rs.bof then
    Response.Write("<p align='center'>暂时没有任何记录!</p>")
    else
    RS.PageSize=20 '设置每页记录数
    Dim TotalPages
    TotalPages = RS.PageCount
    If CurPage>RS.Pagecount Then
    CurPage=RS.Pagecount
    end if
    RS.AbsolutePage=CurPage
    rs.CacheSize = RS.PageSize'设置最大记录数
    Dim Totalcount
    Totalcount =INT(RS.recordcount)
    StartPageNum=1
    do while StartPageNum+10<=CurPage
    StartPageNum=StartPageNum+10
    Loop
    EndPageNum=StartPageNum+9
    If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
%>
<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
 <table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>公告列表</font></td></tr></table>
 <table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
    <tr bgcolor='#A1BBE0' class='td4'>
    <td width="258" height="20"><div align="center">公告标题</div></td>
    <td width="128" height="20"><div align="center">时 间</div></td>
    <td width="128" height="20"><div align="center">排 序</div></td>    
    <td width="110" height="23"><div align="center">操 作</div></td>
  </tr>
 <%
    I=0
    p=RS.PageSize*(Curpage-1)
    do while (Not RS.Eof) and (I<RS.PageSize)
    p=p+1
%>
  <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F7F8F8'"> 
    
<td height="19" align=left bordercolorlight="#C0C0C0">&nbsp;<img src="../images/a125_doc.gif">&nbsp;<%=left(rs("Title"),18)%>...</td>
    <td  align="center"><%=rs("time")%></td>
    <td  align="center"><input name="Order" type="text" id="Order" value="<%=Rs("taxis")%>" size="2" maxlength="5" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: rgb(255,0,0); BORDER-BOTTOM: rgb(0,0,0) 1px solid" ></td>
    <td height="23" align=middle bordercolorlight="#c0c0c0" bgcolor="#FFFFFF"><div align="center"><a href="Admin_Announce.asp?Action=Edit&id=<%=rs("id")%>">修改</a> 
| <a href="Announce_Modify.asp?id=<%=rs("id")%>"></a><a href="Admin_Announce.asp?Action=Del&id=<%=rs("id")%>">删除</a><a href="Announce_Modify.asp?id=<%=rs("id")%>"></a></div></td>
  </tr>
<%
    I=I+1
    RS.MoveNext
    Loop
%>
  <tr bgcolor="#FFFFFF"> 
    <td height="23" colspan=4 align="center" bordercolorlight="#C0C0C0">页次: <font color="#CC0000"><%=CurPage%></font>/<%=TotalPages%> 
      页数: <a href="Admin_Announce.asp?CurPage=<%=StartPageNum-1%>">&lt;&lt;</a> 
      <% For I=StartPageNum to EndPageNum
      if I<>CurPage then %>
      <a href="Admin_Announce.asp?CurPage=<%=I%>"><%=I%></a> 
      <% else %>
      <%=I%>
      <% end if %>
      <% Next %>
      <% if EndPageNum<RS.Pagecount then %>
      <a href="Admin_Announce.asp?CurPage=<%=EndPageNum+1%>">下页</a> 
      <%end if%>
|<a href="Admin_Announce.asp">刷 新</a></td>
  </tr>
</table></td></tr></table><br>
</body>
</html>
<%
    end if
    rs.close
    set rs=nothing
    end if
%> 

<%
    if request("Action")="Save" then
    Title=WS_s.HX_Replace(request("Title"))
    Content=WS_s.HX_Replace(request("Content"))
    If Title="" Then
    Response.Write "<script>alert(""请输公告标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If Content="" Then
    Response.Write "<script>alert(""请输公告内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    sql="select * from a125_gonggao "
    rs.open sql,conn,3,2
    rs.addnew
    rs("Title")=Title
    rs("Content")=Content
    rs("time")=Date()
    rs("admin")=LOGINUSERNAME
    rs("department")=LOGdepartment
    rs("writerid")=LOGINUid   
    rs.update
    rs.close 
    response.redirect "Admin_Announce.asp"
    end if
%>
<%
    if request("Action")="Modify" then
    id=request.form("id")
    Title=WS_s.HX_Replace(request.form("Title"))
    taxis=WS_s.HX_Replace(request.form("taxis"))
    Content=WS_s.HX_Replace(request.form("Content"))
    If Title="" Then
    Response.Write "<script>alert(""请输公告标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If Content="" Then
    Response.Write "<script>alert(""请输公告内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    rs.open "select * from a125_gonggao where id="&id,conn,3,2
    rs("Title")=Title
    rs("Content")=Content
    rs("Time")=Date()

    'if request("SetMarquee")=1 then
    'rs("Marquee")=1
    'else
    'rs("Marquee")=0
    'end if
    rs("taxis")=taxis
    rs.update 
    rs.close 
    response.Redirect("Admin_Announce.asp")
    end if 
%>
<%
    if request("Action")="Del" then
    id=Request.QueryString("id")
    delsql="delete from a125_gonggao where id="&id
    conn.execute(delsql)
    conn.close
    Set conn=nothing
    response.redirect"Admin_Announce.asp"
    end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -