adminbook.asp

来自「关于手机销售的ASP网站程序,程序不太,但功能很全,很是实用!」· ASP 代码 · 共 185 行

ASP
185
字号
<%@ LANGUAGE="VBSCRIPT" %>
<%
if request.cookies("adminok")="" then
  response.redirect "shoplogin.htm"
end if
%>
<!--#include file="conn.asp"-->


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显 示 留 言</title>
<style type="text/css">
body { font-family: 宋体; font-size: 9pt; }
table { font-family: 宋体; font-size: 9pt; }
a { text-decoration: none;color:3366ff}
a:active { text-decoration: none }
a:hover { color: red; font-size: 9pt; text-decoration: underline }
</style>
<%
const MaxPerPage=10 '分页显示的纪录个数
dim sql 
dim rs
dim totalPut 
dim CurrentPage
dim TotalPages
dim i,j
dim pass
pass=request("pass")

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>
<!--#include file="indextop.asp" -->

<div align="center">
  <center>
  <table border="0" width="700">
    <tr>
      <td>
 
<p align="center">
<b>
〖删除留言内容〗    
<% 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) %>    
</b>    
      </td>  
    </tr>  
  </table>  
  </center>  
</div>  
<div align="center">  
  <center>   
<table border="0" cellspacing="1" width="700" bgcolor="#006699"><tr><td nowrap width="70" valign="top"><p align="right"><strong><font color="#FFFFFF">大名:</font></strong>   
</td><td nowrap valign="top"><p align="left"><font color="#FFFFFF"><%=rs("name")%>   
      </font>   
      <a href="delbook.asp?id=<%=rs("ID")%>"><font color="#FFFFFF">删除</font></a>&nbsp;&nbsp;&nbsp;    
      <a href="rebook.asp?id=<%=rs("ID")%>"><font color="#FFFFFF">回复</font></a>      
    </td></tr>      
<%if rs("email")<>"" then%>      
 <tr> <td nowrap width="70" valign="top" bgcolor="#E6F2F2"><p align="right"><strong><font color="#004040"      
 face="Times New Roman">E-Mail</font><font color="#004040">:</font></strong></td>      
 <td nowrap valign="top" bgcolor="#E6F2F2" ><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%><tr>      
 <td nowrap width="70" valign="top" bgcolor="#E6F2F2"><p align="right"><font color="#004040"><strong>主       
 页:</strong></font></td>      
 <td nowrap valign="top" bgcolor="#E6F2F2"><p align="left"><font color="#000000"><a      
 href="<%=rs("homepage")%>" target="_blank"><%=rs("homepage")%></a> </font></td>      
 </tr>      
<%end if%>      
 <tr>      
 <td nowrap width="70" valign="top" bgcolor="#E6F2F2"><p align="right"><font color="#004040"><strong>主       
 题:</strong></font></td>      
 <td nowrap valign="top" bgcolor="#E6F2F2" ><p align="left"><font color="#000000"><%=rs("title")%>&nbsp;&nbsp;(<%=rs("time")%>)</font></td>      
 </tr>      
 <tr>      
 <td nowrap width="70" valign="top" bgcolor="#E6F2F2"><p align="right"><font color="#004040"><strong>内        
 容:</strong></font></td>       
 <td valign="top" bgcolor="#E6F2F2"><font       
 color="#000000"><%=rs("content")%></font></td>       
 </tr>       
 <tr>      
 <td nowrap width="70" valign="top" bgcolor="#E6F2F2"> 
  <p align="center"><b>回复留言</b></p>
 </td>      
 <td valign="top" bgcolor="#E6F2F2"><b><font color="#808000"><%=rs("rebook")%></font></b></td>      
 </tr>      
 </table>      
<p>       
  </center>     
</div>     
<div align="center">   
  <center>   
  <table border="0" width="700" 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      
response.write "留言簿管理界面"     
response.write "</p>"     
exit sub     
end if     
dim k     
response.write "<p align='left'>&gt;&gt; 留言分页 "     
 for k=1 to n     
if k=currentPage then     
response.write "[<b>"+Cstr(k)+"</b>] "     
else     
response.write "[<b>"+"<a href='adminbook.asp?page="+cstr(k)+"'>"+Cstr(k)+"</a></b>] "     
end if     
next     
response.write "</p>"     
end sub     
%>     
        <p> </td>   
    </tr>   
  </table>   
  </center>   
</div>   
<p align="center"> </p>   
</body>     
</html>     

⌨️ 快捷键说明

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