📄 admin_book.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit %>
<%response.buffer=false
%>
<%
if request.cookies("adminok")="" then
response.redirect "shop_login.htm"
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管 理 留 言</title>
<script language="JavaScript">
function cdel(id){
var id;
if (confirm("你真的要删除这条留言吗?")){
document.location.href="del_book.asp?id="+id+""
}
}
</script>
<script
language="javascript">
<!--
function winopen(url)
{
window.open(url,"search","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=yes,width=640,height=450,top=200,left=100");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<%
const MaxPerPage=10 '分页显示的纪录个数
dim sql
dim rs
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rs=server.createobject("adodb.recordset")
%>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body topmargin="0"><div align="center">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" height="1">
<tbody>
<tr>
<td width="100%" height="1" valign="top">
<table class="main" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tbody>
<tr>
<td width="597" valign="top" bgcolor="#BECFF1">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div align="center">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="60">
<center>
<tr>
<td width="100%" height="16" bgcolor="#BECFF1">
</td>
</tr>
</center>
<center>
<tr>
<td width="100%" valign="top" height="95">
<table cellSpacing="1" width="100%" border="0" bordercolorlight="#FFFFFF" bgcolor="#BECFF1">
<tbody>
<tr>
<td vAlign="top" width="100%"><img height="1" src="images/stretch.gif" width="146" border="0"> </center>
<div align="center">
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><% sql="select * from book order by id desc"
rs.open sql,conn,1,1
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
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpages
showContent
showpages
else
currentPage=1
showContent
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 or err) %></td>
</tr>
</table>
</div>
<div align="center">
<table width="90%" border="0" cellspacing="0" cellpadding="0" height="8">
<tr>
<td>
<div align="left"><br>
<a href="javascript:cdel('<%=rs("id")%>')">删除此留言</a></div>
</td>
</tr>
</table>
<table border="0" cellspacing="1"
bordercolordark="#FFFFFF" width="90%" bgcolor="#BECFF1"><tr><td nowrap width="70" valign="top" bgcolor="#BECFF1" align="center">
<p>大名:
</td>
<center>
<td nowrap valign="top" bgcolor="#BECFF1">
<p align="left"><%=rs("name")%>
</td></tr>
<%if rs("email")<>"" then%>
</center>
<tr> <td nowrap width="70" valign="top" bgcolor="#F7F7E7" align="center"><p><font color="#004040">E-Mail</font></td>
<center>
<td nowrap valign="top" bgcolor="#F7F7E7" ><p align="left"><font
color="#000000"><a href="mailto:<%=rs("email")%>"><%=rs("email")%></a> </font></td>
</tr><%end if%><%if rs("homepage")<>"" and rs("homepage")<>"http://" then%>
</center>
<tr>
<td nowrap width="70" valign="top" bgcolor="#F7F7E7" align="center"><p><font color="#004040">主
页</font></td>
<center>
<td nowrap valign="top" bgcolor="#F7F7E7"><p align="left"><font color="#000000"><a
href="<%=rs("homepage")%>" target="_blank"><%=rs("homepage")%></a> </font></td>
</tr>
<%end if%>
</center>
<tr>
<td nowrap width="70" valign="top" bgcolor="#F7F7E7" align="center"><p><font color="#004040">主
题</font></td>
<center>
<td nowrap valign="top" bgcolor="#F7F7E7" ><p align="left"><font color="#000000"><%=rs("title")%> (<%=rs("time")%>)</font></td>
</tr>
</center>
<tr>
<td nowrap width="70" valign="top" bgcolor="#F7F7E7" align="center"><p><font color="#004040">内
容</font></td>
<center>
<td valign="top" bgcolor="#F7F7E7"><font
color="#000000"><%=rs("content")%></font></td>
</tr>
</table>
</center>
</div>
<div align="center">
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
if n=1 then
exit sub
end if
dim k
response.write "<p align='left'>>> 留言分页 "
for k=1 to n
if k=currentPage then
response.write"["+Cstr(k)+"]"
else
response.write"["+"<a href='admin_book.asp?page="+cstr(k)+"'>"+Cstr(k)+"</a>]"
end if
next
response.write "</p>"
end sub
%>
<p> </td>
</tr>
</table>
</div>
</td>
<!-- this is the shade the right of the Portlet -->
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<center>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=100% height="122" bgcolor="#FFFFFF">
<TBODY>
<TR>
<TD class=unnamed1 height=122 width=100%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -