⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_gbookmana.asp

📁 庐江二中
💻 ASP
字号:
<%PageName="admin_GBookMana"%>
<!--#include file="session.asp"-->
<%checkAdmin2%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<!--#include file="top.asp"-->
<br>
<table border="1" width="90%" cellspacing="0" cellpadding="1" bgcolor="<%=MainBgColor%>">
<tr>
<td align=center valign=top><br>
<%

sql="select * from gstbook order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有评论</p>"
else
MaxPerPage=15
PageUrl="admin_GBookMana.asp"
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
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
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
rs.close
end if

sub showContent
dim i
i=0
%>
<table border="1" width="100%" cellspacing="0" cellpadding="0" Class="TableLine" bordercolorlight="<%=MainBColor%>" bgcolor="<%=MainCColor%>">
<tr>
<td width="5%" height=22 align=center bgcolor="<%=MainTColor%>" >序号</td>
<td width="10%" height=22 align=center bgcolor="<%=MainTColor%>">评论人</td>
<td width="35%" height=22 align=center bgcolor="<%=MainTColor%>">内容</td>
<td width="15%" height=22 align=center bgcolor="<%=MainTColor%>">IP</td>
<td width="20%" height=22 align=center bgcolor="<%=MainTColor%>">时间</td>
<td width="5%" height=22 align=center bgcolor="<%=MainTColor%>">删除</td>
</tr>
<%do while not rs.eof
i=i+1
content=trim(rs("content"))
DisplayContent=mid(Content,1,36)
%>
<tr>
<td width="5%" align=center><%=rs("id")%></td>
<td width="10%" align=center><%=rs("name")%></td>
<td width="35%">&nbsp;<a class=noline href="gbookread.asp?id=<%=rs("id")%>" target="_blank"><%=left(DisplayContent,80)%></a></td>
<td width="15%" align="center"><%=rs("ip")%></td>
<td width="20%" align=center><%=rs("datetime")%></td>
<td width="5%" align=center><a href="admin_GBookDel.asp?id=<%=rs("id")%>&page=<%=CurrentPage%>">删除</a></td>
</tr>
<%
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
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
%>
<form method=Post action="<%=filename%>">
<center>共<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>个评论
<%if CurrentPage<2 then%>
&nbsp;首页 上一页&nbsp;
<%else%>
&nbsp<a href="<%=filename%>?page=1">首页</a>&nbsp;
<a href="<%=filename%>?page=<%=CurrentPage-1%>">上一页</a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>">下一页</a>
<a href="<%=filename%>?page=<%=n%>">末页</a>
<%end if%>
&nbsp;页次:<strong><font color="<%=AlertFColor%>"><%=CurrentPage%>/<%=n%></font></strong>页
转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>

<%
end function
%>
</td>
</tr>
</table>
<%set rs=nothing%>

⌨️ 快捷键说明

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