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

📄 list.asp

📁 公司通讯录 Jaddress 1.0
💻 ASP
字号:
<head>
<LINK href="style.css" rel=stylesheet>
</head>
<!--#include file="db.asp"-->
<%
dim conn,rs,CurPage,sql
id=request("id")
key=request("key")
If Request.QueryString("CurPage") = "" or Request.QueryString("CurPage") = 0 then
CurPage = 1
Else
CurPage = CINT(Request.QueryString("CurPage"))
End If
display = CurPage
if id=0 then
sql="Select * From address where name like '%"&key&"%' or sort like '%"&key&"%'"
else
if key="" then
sql="Select * From address where cmp='"&id&"'"
else 
sql="Select * From address where cmp='"&id&"' and name like '%"&key&"%' or cmp='"&id&"' and sort like '%"&key&"%'"
end if
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<body topMargin=0 vlink="#000000" marginheight="0" leftMargin=0 rightMargin=0>
<p align="center">
  <%if rs.eof and rs.bof then%> 
  暂时没有记录                 
<%else  
  
RS.PageSize=17  
'Calculate Total Pages  
Dim TotalPages  
TotalPages = RS.PageCount  
  
If CurPage>RS.Pagecount Then   
CurPage=RS.Pagecount  
end if  
  
RS.AbsolutePage=CurPage  
  
'Set Cache Size = No of Records on Each Page  
rs.CacheSize = RS.PageSize  
  
'Calculate Max Records  
Dim Totalcount  
Totalcount =INT(RS.recordcount)  
  
StartPageNum=1  
do while StartPageNum+17<=CurPage  
StartPageNum=StartPageNum+17  
Loop  
      
EndPageNum=StartPageNum+16  
  
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount  
  
%>  
<div align="right">
  <table border="0" cellspacing="0" width="100%"> 
    <tr> 
      <td width="20%" align="center" bgcolor="#006699"><font color="#FFFFFF">部门及职位</font> 
      </td> 
      <td width="10%" align="center" bgcolor="#006699"><font color="#FFFFFF">姓名</font> 
      </td> 
      <td width="15%" align="center" bgcolor="#006699"><font color="#FFFFFF">电子邮件</font> 
      </td> 
      <td width="20%" align="center" bgcolor="#006699"><font color="#FFFFFF">办公电话</font> 
      </td> 
      <td width="10%" align="center" bgcolor="#006699"><font color="#FFFFFF">分机</font> 
      </td> 
      <td width="15%" align="center" bgcolor="#006699"><font color="#FFFFFF">手机或传呼</font> 
      </td> 
      <td width="10%" align="center" bgcolor="#006699"><font color="#FFFFFF">传真</font> 
      </td> 
    </tr> 
  <%I=0  
p=RS.PageSize*(Curpage-1)  
do while (Not RS.Eof) and (I<RS.PageSize)  
p=p+1
%><%if I mod 2 = 0 then%>   
<tr bgcolor="#E8F3FF">
<%else 
%> 
    <tr bgcolor="#EBEBEB"> 
    <%end if%>
      <td width="20%" align="center"><%=rs("sort")%>
      </td> 
      <td width="10%" align="center"><%=rs("name")%>          
      </td> 
      <td width="15%" align="center"><%=rs("email")%>          
      </td> 
      <td width="20%" align="center"><%=rs("tel")%>          
      </td> 
      <td width="10%" align="center"><%=rs("telf")%>          
      </td> 
      <td width="15%" align="center"><%=rs("mob")%>          
      </td> 
      <td width="10%" align="center"><%=rs("cz")%>          
      </td> 
    </tr> 
     <%I=I+1  
RS.MoveNext  
Loop%>  
    <tr> 
      <td width="100%" align="center" colspan="12"><p align="right">  
 <a href="list.asp?CurPage=<%=StartPageNum-1%>&key=<%=key%>&id=<%=id%>" target="_self">上一页</a>       
      <% For I=StartPageNum to EndPageNum                                          
      if I<>CurPage then %> <a href="list.asp?CurPage=<%=I%>&key=<%=key%>&id=<%=id%>" target=_self><%=I%>                                        
</a> <% else %>    
      <%=I%> <% end if %> <% Next %>                                        
      <% if EndPageNum<RS.Pagecount then %><a href="list.asp?CurPage=<%=EndPageNum+1%>&key=<%=key%>&id=<%=id%>" target=_self >更多...</a>                                         
      <%end if%><b>|</b> <a href="list.asp?key=<%=key%>&id=<%=id%>" target=_self >最 新</a>&nbsp;</p>                                 
      </td> 
    </tr> 
  </table> 
</div>
  <%end if
  rs.close  
set rs=nothing%>

⌨️ 快捷键说明

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