📄 guestbooklist.asp
字号:
<!-- #include file="conn.asp" -->
<!--#include file="webconfig.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=webname%></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="include/top.asp" -->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="1" bgcolor="#cccccc"></td>
<td width="220" height="100"><!-- #include file="include/left.asp" --></td>
<td width="1" bgcolor="cccccc"></td>
<td align="center">
<!--#include file="include/search.asp" -->
<table width="98%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="center"><b><font color="#006699">客户留言系统</font></b></td>
</tr>
<tr>
<td align="right"><b><img src="../images/guestbook11.gif" width="20" height="16" align="absmiddle">
<a href="guestbook.asp" class="centertitle">我要留言</a></b></td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 width=98% align=center border=0>
<tbody>
<tr>
<td valign="top" align="right"> <div align=center>
<%
sql="select * from Net008_guestbook where yn='y' order by adddate desc"
set rs=server.createobject("adodb.recordset")
rs.open sql ,conn,1,2
if rs.recordcount<1 then
response.write"暂无信息"
'response.end
end if
const maxperpage=6 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
%>
<table class=p10Copy cellspacing=1 cellpadding=0 width="100%"
bgcolor=#0099CC border=0>
<tbody>
<tr>
<td align=middle bgcolor=EAF5FB colspan=3
height=22>页数:<%=currentpage%>/
<% =n%>
<%k=currentpage
if k<>1 then%>
[<a href="guestbooklist.asp?pageid=1" class="009900_009900">首页</a>]
[<a href="guestbooklist.asp?pageid=<%=k-1%>" class="009900_009900">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a href="guestbooklist.asp?pageid=<%=k+1%>" class="009900_009900">下一页</a>]
[<a href="guestbooklist.asp?pageid=<%=n%>" class="009900_009900">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<%=totalput%>条信息</td>
</tr>
</tbody>
</table>
<%
i=0
do while i< maxperpage and not rs.eof
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="3"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#0099CC">
<tr bgcolor="EAF5FB">
<td width="60" bgcolor="EAF5FB"><font color="#0099CC">留言标题:</font></td>
<td><font color="#0099CC"><%=left(rs("title"),30)%></font>
<%
Response.Write rs("guestname")
'Response.Write ("<a href=guest_show.asp?id="&rs("id")&" class=blue>"&left(rs("guestname"),40)&"</a>")
%>
<font color="#999999">留言于<%=rs("adddate")%></font></td>
<%if session("guestid")="henly" then %>
<td width="70" align="center"> </td>
<%end if%>
</tr>
<tr>
<td bgcolor="EAF5FB"><font color="#0099CC">留言内容:</font></td>
<td bgcolor="#FFFFFF" colspan="2"><font color="#666666">
<%
if rs("hideyn")="y" then
response.write "悄悄话!"
else
response.write replace(rs("content"),chr(13)+chr(10),"<br>")
end if
%>
</font></td>
</tr>
<tr>
<td bgcolor="EAF5FB"><font color="#0099CC">管理回复:</font></td>
<td bgcolor="#FFFFFF" colspan="2"><font color="#999900">
<%
if rs("msg")>1 then
response.write replace(rs("msg"),chr(13)+chr(10),"<br>")
response.write " ("
response.write rs("redate")
response.write ")"
else
response.write "暂无回复"
end if
%>
</font></td>
</tr>
<br>
<%
i=i+1
rs.movenext
loop
rs.close
'ser rs=nothing
%>
</table>
<br>
<table class=p10Copy cellspacing=1 cellpadding=0 width="100%"
bgcolor=#0099CC border=0>
<tbody>
<tr>
<td align=middle bgcolor=EAF5FB colspan=3
height=22>页数:<%=currentpage%>/
<% =n%>
<%k=currentpage
if k<>1 then%>
[<a href="guestbooklist.asp?pageid=1" class="009900_009900">首页</a>]
[<a href="guestbooklist.asp?pageid=<%=k-1%>" class="009900_009900">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a href="guestbooklist.asp?pageid=<%=k+1%>" class="009900_009900">下一页</a>]
[<a href="guestbooklist.asp?pageid=<%=n%>" class="009900_009900">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<%=totalput%>条信息</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
</div></td>
</tr>
</tbody>
</table> </td>
<td width="1" bgcolor="cccccc"></td>
</tr>
</table>
<!-- #include file="include/bottom.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -