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

📄 man_note.asp

📁 党委网站 党委网站党委网站党委网站党委网站党委网站
💻 ASP
字号:
<%
if session("username")="" or session("usertype")="" then
response.Write"<script>"
response.Write"parent.location.href='default.asp';"
response.Write"</script>"
end if
%>
<!--#include file="conn.asp"-->
<%
if request("act")="del" then
conn.execute "delete * from net_note where id="&request("id")&""
response.Redirect("man_note.asp?page="&request("page")&"")
response.End()
end if
%>
<%
if request("selectm")<>"" then
sql="select * from net_note where type="&request("selectm")&" order by id desc"
else
sql="select * from net_note order by id desc"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息管理</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>
  <TR> 
    <TD style="HEIGHT: 16px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="77%">查看公告提示</td>
        </tr>
      </table></TD>
  </TR>
  <TR> 
    <TD height=12 colSpan=2><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td bgcolor="#CCCCCC" height="1"></td>
              </tr>
            </table></td>
        </tr>
      </table></TD>
  </TR>
  <TR> 
    <TD height="140" colSpan=2 vAlign=top> <div align="center"> 
        <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
          <tr> 
            <td height="30" bgcolor="#DBDBDB"> <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <%
				Const MaxPerPage=12
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
       			if Not isempty(request("page")) then
      			currentPage=Cint(request("page"))
   				else
      			currentPage=1
   				end if 
			set rs=server.CreateObject("adodb.recordset")
            rs.open sql,conn,1,1
		   	if err.number<>0 then
				response.write "数据库中无数据"
				end if
				
  				if rs.eof And rs.bof then
       				response.Write("<tr>")
					  response.Write("<td>")
					  response.Write("<div align=center>暂时没有内容!</div>")
					  response.Write("</td>")
					  response.Write("</tr>")
   				else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"man_note.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"man_note.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"man_note.asp"
	      				end if
	   				end if
   				   	end if

   				sub showContent
       				dim i

	   			i=0%>
                <tr> 
                  <td width="42%" height="30" bgcolor="#FFFFFF"> <div align="center">信息标题</div></td>
                  <td width="24%" bgcolor="#FFFFFF"><div align="center">信息类别</div></td>
                  <td width="18%" bgcolor="#FFFFFF"><div align="center">发布时间</div></td>
                  <td width="16%" bgcolor="#FFFFFF"><div align="center">编辑操作</div></td>
                </tr>
                <%do while not rs.eof%>
                <tr> 
                  <td height="25" bgcolor="#FFFFFF"><div align="center"><a href=edit_note.asp?id=<%=rs("id")%>><%=rs("title")%></a></div></td>
                  <td bgcolor="#FFFFFF"><div align="center"><%if rs("type")=1 then%><a href="man_note.asp?selectm=1">最新公告</a><%else%><a href="man_note.asp?selectm=0">滚动提示</a><%end if%>/[<a href="man_note.asp">全</a>] 
                    </div></td>
                  <td bgcolor="#FFFFFF"><div align="center"><%=rs("datetime")%></div></td>
                  <td bgcolor="#FFFFFF"><div align="center">[<a href="edit_note.asp?id=<%=rs("id")%>">编辑</a>] 
                      [<a href="man_note.asp?act=del&page=<%=currentpage%>&id=<%=rs("id")%>">删除</a>]</div></td>
                </tr>
                <%
		i=i+1
		if i>=MaxPerPage then Exit Do
		rs.movenext
		loop
		rs.close
		set rs=nothing%>
              </table></td>
          </tr>
        </table>
        <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
          <tr> 
            <td><hr align="center" width="100%" size="1" noshade></td>
          </tr>
          <tr> 
            <td><div align="center"> 
                <%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If
				
				Response.Write "<form method=Post action="&filename&"?selectm="&selectm&">"  
				Response.Write "<p align='center' class='contents'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='contents'>首页 上一页</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1&selectm="&selectm&" class='contents'>首页</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&selectm="&selectm&" class='contents'>上一页</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='contents'>下一页 尾页</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&selectm="&selectm&" class='contents'>"  
					Response.Write "下一页</a> <a href="&filename&"?page="&n&"&selectm="&selectm&" class='contents'>尾页</a>"  
				End If  
					Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
					Response.Write "<font class='contents'> 共有"&totalnumber&"个问题 " 
					Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=input_main value="&currentpage&">"  
					Response.Write "&nbsp;<input type='submit'  class='sub' value='GO' name='cndok' ></form>"  
				End Function  
			%>
              </div></td>
          </tr>
        </table>
      </div></TD>
  </TR>
</TABLE>
</body>
</html>


⌨️ 快捷键说明

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