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

📄 list.asp

📁 办公系统的公文处理
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息列表</title>
<!--#include file="css.css"-->
</head>

<body topmargin="1">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="40" class="unnamed18"> 
      <div align="center"><font color="#FF00FF"><!--#include file="top.asp"--></font></div></td>
  </tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="140" rowspan="2" valign="top" bgcolor="#98a5d0"><!--#include file="left.asp"--></td>
    <td valign="top" bgcolor="#98A5D0"></td>
  </tr>
  <tr> 
    <td width="560" valign="top" bgcolor="#98A5D0"> 
      <table width="589" border="0" cellpadding="0" cellspacing="0" class="unnamed10">
        <tr>
          <td width="589">
		  <% anguage="vbscript" 
dim conn 
dim connstr 
dim totalPut 
dim CurrentPage 
dim TotalPages 
dim i,j 
dim sql 
dim rs 
on error resume next 
'打开数据库 
set rs=server.createobject("adodb.recordset") 
'定义每页文章显示数 
const MaxPerPage=10 
if not isempty(request("page")) then 
currentPage=cint(request("page")) 
else 
currentPage=1 
end if 
sql="select * from news order by 置顶 desc,id desc"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,3,2
if rs.eof and rs.bof then 
response.write "<p align='center'  valign='middle' class='unnamed18'>  没 有 任 何 文 件</p>" 
else 
'数据库中文章数totalput 
totalPut=rs.recordcount 
if currentpage<1 then 
currentpage=1 
end if 
'统计总页数currentpage 
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,"list.asp" 
else 
if (currentPage-1)*MaxPerPage<totalPut then 
rs.move (currentPage-1)*MaxPerPage 
dim bookmark 
bookmark=rs.bookmark 

showContent 
showpage totalput,MaxPerPage,"list.asp" 
else 
currentPage=1 

showContent 
showpage totalput,MaxPerPage,"list.asp" 
end if 
end if 
end if 

sub showContent 

 '选择显示数据库内容 



%> 
		  <br>
            <table  width="579" height="20" border="0" align="center" cellspacing="1" class="unnamed12">
        <tr class="unnamed14" bgcolor="#FF9966" height="30"> 
          <td width="435" > <div align="center">内     容</div></td>
          <td width="73" > <div align="center">签收状态</div></td>
          <td width="61" > <div align="center">签收情况</div></td>
         
        </tr>
<% dim i 
i=0 
j=0
		
do while not rs.eof 
			
           
%>
 <tr class="unnamed12" bgcolor="<%if j mod 2=0 then %>#ffcc99<%else%>#ffffff<%end if%>"> 
          <td width="435"  height="30" > <a href=qtdisp.asp?disp_id=<%=rs("id")%> target="_blank"><%=left(rs("标题"),20)%></a> <%if rs("附件")<>" " then%> <img src="images/fujian.gif" align="absbottom"> <%end if%></td>
          <td width="73"  height="30"> <div align="center"> 
              <%  if rs("签收状态")=true then%>
              <font color="#FF0000">签收完毕</font> 
                 <%else%>
                 <font color="#0000FF">签收中</font> 
              <%  end if %>
            </div></td>
          <td width="61" height="30"> <div align="center"><a href="qtlooker.asp?look_id=<%=rs("id")%>" target="_blank">签收详情</a></div></td>
        
        </tr>
		

 
 <% 
 '当显示记录大于maxperpage时结束这页 
i=i+1 
j=j+1
if i>=MaxPerPage then exit do 
rs.movenext 

loop 

%>
</table>
<%
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&">" 
response.write "<p align='center'  > <font color='#000080' class='unnamed12'>>>分页</font> " 
'显示页数链接的条件 
if CurrentPage<2 then 
response.write "<font color='#000080' class='unnamed12'>首页 上一页</font> " 
else 
response.write "<a href="&filename&"?page=1& class='unnamed12'>首页</a> " 
response.write "<a href="&filename&"?page="&CurrentPage-1&" class='unnamed12'>上一页</a> " 
end if 
if n-currentpage<1 then 
response.write "<font color='#000080' class='unnamed12'>下一页 尾页</font>" 
else 
response.write "<a href="&filename&"?page="&(CurrentPage+1) 
response.write "><font color='#000080' class='unnamed12'>下一页</font></a> <a href="&filename&"?page="&n&"><font color='#000080' class='unnamed12'>尾页</font></a>" 
end if
response.write "<font color='#000080' class='unnamed12'> 页次:</font><strong><font color=red class='unnamed12'>"&CurrentPage&"</font><font color='#000080'class='unnamed12'>/"&n&"</strong>页</font>" 
response.write "<font color='#000080' class='unnamed12'> 共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/页</font>" 
response.write " <font color='#000080' class='unnamed12'>转到:</font><input type='text' name='page' size=4 maxlength=10 class='unnamed12't value="&tpage&">" 
response.write "<input class='unnamed12' type='submit' value=' Goto ' name='cndok'></p></form>" 
end function 
 rs.close 
 set rs=nothing 
conn.close 
set conn=nothing 
 %>

</table>
</td>
  </tr>
      </table>
    </td>
  </tr>
</table>

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="bottom.asp"--></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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