?? default.asp
字號(hào):
<%
if session("admin_name")="" then
response.redirect "../index.asp"
response.end
end if
%>
<!--#include file="../inc/adconn.asp"-->
<link rel="stylesheet" type="text/css" href="../style.css">
<BODY bgcolor="#FFFFFF" marginheight=0 marginwidth=0 leftmargin=5>
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
const MaxPerPage=8
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim rs
dim sql
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
set rs=server.createobject("adodb.recordset")
sql="Select * from guestbook order by ID desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>對(duì)不起,暫時(shí)還沒有相關(guān)信息!!!</p>"%><CENTER>
<%else
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 totalput,MaxPerPage
showpage totalput,MaxPerPage,"default.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,"default.asp"
else
currentPage=1
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,"default.asp"
end if
end if
rs.close
end if
set rs=nothing
sub showContent (totalput,MaxPerPage)
%><CENTER>
<br>
<CENTER>
<TABLE width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#336699"><Form name="search" method="POST" action="default.asp">
<tr height=25 >
<TD width="64" align="center" background="../images/pics/tile_sub.gif"><font color="#FFFFFF"><b>ID號(hào)</b></font></TD>
<TD width="85" align="center" background="../images/pics/tile_sub.gif"><font color="#FFFFFF"><strong>留言人</strong></font></TD>
<TD width="429" align="center" background="../images/pics/tile_sub.gif"><font color="#FFFFFF"><strong>留言</strong><b>內(nèi)容</b></font></TD>
<TD colspan="2" align="center" background="../images/pics/tile_sub.gif"><strong><font color="#FFFFFF">操作</font></strong><strong><font color="#FFFFFF"></font></strong></TD>
<TD width="84" align="center" background="../images/pics/tile_sub.gif"><font color="#FFFFFF">
<input type='submit' value='刪除'>
</font></TD>
</TR>
<%do while not rs.eof%>
<tr height="20">
<td width="64" height="13" align="center" bgcolor="#ffffff"><font face="Arial"><b><%=rs("id")%></b></font></td>
<td width="85" align="center" bgcolor="#ffffff"><%=rs("名字")%></td>
<td width="429" bgcolor="#ffffff"><%=rs("留言")%></td>
<td width="58" align="center" bgcolor="#ffffff"><a href="reply.asp?id=<%=rs("ID")%>">回復(fù)</a></td>
<td width="65" align="center" bgcolor="#ffffff"><a href="check.asp?id=<%=rs("id")%>">審核<%if rs("check")=true then%><font color="#FF0000">√</font><%end if%></a></td>
<td width="84" align="center" bgcolor="#ffffff"> <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></td>
</tr>
<tr height="20">
<td height="13" colspan="6" align="center" bgcolor="#ffffff"><%if rs("reply")<>"" then%> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="69"> </td>
<td width="97" height="25" background="../images/pics/tile_sub.gif">
<div align="center"><font color="#FFFFFF"><strong>版主回復(fù):</strong></font></div></td>
<td background="../images/pics/tile_sub.gif"><font color="#FFffff"> <%=rs("reply")%></font></td>
</tr>
</table>
<% end if %></td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
</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
if CurrentPage<2 then
response.write "<table border=0 width=100% cellspacing=0 cellpadding=0 bgcolor=#e8f4ff>"
response.write "<tr height=30>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>頁 第<font color=#ff6600><b>"&CurrentPage&"</b></font>頁 共檢索到<font color=#ff6600><b>"&totalnumber&"</b></font>條相關(guān)信息</td>"
response.write "<td align=right>"
response.write "【最前頁】【上一頁】"
else
response.write "<table border=0 width=600 cellspacing=0 cellpadding=0 bgcolor=#e8f4ff>"
response.write "<tr height=30>"
response.write "<td align=left>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>頁 第<font color=#ff6600><b>"&CurrentPage&"</b></font>頁 共檢索到<font color=#ff6600><b>"&totalnumber&"</b></font>條相關(guān)信息</td>"
response.write "<td align=right>"
response.write "【<a href="&filename&"?page=1&txtitle="&request("txtitle")&">最前頁</a>】"
response.write "【<a href="&filename&"?page="&CurrentPage-1&"&txtitle="&request("txtitle")&">上一頁</a>】 "
end if
if n-currentpage<1 then
response.write "【下一頁】【最后頁】"
else
response.write "【<a href="&filename&"?page="&(CurrentPage+1)&"&txtitle="&request("txtitle")&">"
response.write "下一頁</a>】【<a href="&filename&"?page="&n&"&txtitle="&request("txtitle")&">最后頁</a>】"
end if
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.write "</form>"
end function
sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from [guestbook] where id="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "刪 除 失 敗 !<br>"
end if
End sub
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -