📄 index.asp
字号:
<HTML>
<HEAD>
<TITLE>信息反馈</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/site.css">
</HEAD>
<!--#include file="conn.asp"-->
<body background="image/bg_1.gif">
<table width="55%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-3" style="TABLE-LAYOUT: fixed">
<tr>
<td colspan="2" align="center" valign="top" class="table-you"><div align="right"><a href="write.asp">签写留言</a></div></td>
</tr>
</table>
<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
typename="信息反馈"
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql2
dim rs2
sql2="select * from admin"
Set rs2= Server.CreateObject("ADODB.Recordset")
rs2.open sql2,conn,1,1
If rs2("sh")=0 Then
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from guestbook where answer <>'暂无回复' order by id DESC"
rs.open sql,conn,1,1
else
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from guestbook order by id DESC"
rs.open sql,conn,1,1
End If
if rs.eof and rs.bof then
response.write "<p align='center'> 还没有留言</p>"
else
totalPut=rs.recordcount
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,"index.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"index.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
do while not rs.eof
%>
<hr width="55%" size=1 color=#000000 style="BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted">
<table width="55%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-3" style="TABLE-LAYOUT: fixed">
<tr>
<td colspan="2" align="center" valign="top" class="table-you"></td>
</tr>
<tr>
<td width="20%" align="center" valign="top" class="table-you">
<%
If rs("sex")=2 Then
%>
<div align="center"><img src="image/2.gif" width="80" height="80">
<%Else%>
<img src="image/1.gif" width="80" height="80">
<%End If%>
<br>
姓名 <%=rs("name")%> <br>
<img src='image/qq.gif'>
<% if rs("tel")="" then Response.Write "没有留下" else Response.Write ""&rs("tel")&"" %>
<br>
<img src='image/mail.gif'>
<% if rs("email")="" then Response.Write "没有留下" else Response.Write "<a href=mailto:"&rs("email")&">"&rs("email")&"</a>" %>
</div></td>
<td width="80%" valign="top" style="WORD-WRAP: break-word">内容:<br><%= rs("content")%>
<%If rs("answer")<>"暂无回复" Then%>
<p><br>
<font color="#FF6600">留言已经审核</font></p>
<p><font color="#FF6600"><%=rs("answer")%></font>
<%End If%>
</p>
<p>留言时间:<%=rs("date")%> </p></td>
</tr>
</table>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<hr width="55%" size=1 color=#000000 style="BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted">
<p 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 "<font class=a>共"&totalnumber&"篇留言 每页显示"&maxperpage&"篇 目前显示第"&CurrentPage&"/"&n&"页  </font>"
if CurrentPage<2 then
response.write "首页 上一页 "
else
response.write "<a href="&filename&"?page=1>首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
end function
%> </p>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -