|
|
| 本系统为定制型留言板,屏蔽的内容是鉴于客户信息的保密性和商业信息的机密性,只有本公司的管理人员可以查看,给您带来的不便还望谅解。 |
<% Language="VBScript"
dim conn
dim connstr
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim sql
dim rs
on error resume next
'打开数据库
set conn=Server.CreateObject("ADODB.Connection")
dbpath=Server.MapPath("lydata/guest.mdb")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&dbpath
set rs=Server.CreateObject("ADODB.Recordset")
'定义每页文章显示数
const MaxPerPage=5
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
sql="select * from ly order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
mb_demo=replace(rs("mb_demo"),chr(10)+chr(13)," ")
if rs.eof and rs.bof then
response.write " 还没有任何留言 "
else totalPut=rs.recordcount '数据库中留言数totalput
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
showpage totalput,MaxPerPage,"viewguest.ASP"
showContent
showpage totalput,MaxPerPage,"viewguest.ASP"
else
if (currentPage-1)*MaxPerPage
 |
姓名: |
<%=rs("cname")%> |
公司: |
(屏蔽状态,公司内部管理员可查看) |
| 地址: |
(屏蔽状态) |
Email: |
(屏蔽状态) |
| 电话: |
(屏蔽状态) |
传真: |
(屏蔽状态) |
留言时间: |
<%=rs("ctime")%> |
| 留言内容: |
(屏蔽状态) |
<% '当显示记录大于maxperpage时结束这页
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
function showpage(totalnumber,maxperpage,filename)
'求出当每页5条记录时总共的页数
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else n= totalnumber \ maxperpage+1
end if
response.write ""
end function
%>
|