📄 admin_picmana.asp
字号:
<!--#include file="function.asp"-->
<%CheckAdmin%>
<!--#include file="top.asp"-->
<script language="javascript">
<!--
function test() {
return confirm("您确认要删除此图片资料吗?删除后不可恢复!是否继续?");
}
//-->
</script>
<%
title=request("title")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selpic")) then
idlist=request("selpic")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call delpic(id)
next
else
call delpic(clng(idlist))
end if
end if
%>
<table border="0" width=770 align=center cellspacing="1" cellpadding="1" bgcolor="<%=Tablebackcolor%>">
<tr>
<td bgcolor="<%=Tabletitlecolor%>" align="center" width="163" valign="top"> <br>
<!--#include file="admin_left.asp"-->
</td>
<td bgcolor="<%=Tablebodycolor%>" width="600" height="2" align="center" valign="top">
<%
if title<>"" then
sql="select * from pic where title like '%"&trim(title)&"%' order by id desc"
else
sql="select * from pic order by id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有收集</p>"
else
totalPut=rs.recordcount
PageUrl="admin_picmana.asp"
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
end if
rs.close
sub showContent
i=0
%>
<table border="1" cellspacing="0" width="589" bordercolorlight="<%=Tablebackcolor%>" bordercolordark="#FFFFFF" cellpadding="1">
<form method=Post action="admin_picmana.asp" onsubmit="return test();">
<tr bgcolor="<%=Tabletitlecolor%>">
<td width="52" align="center" height="20"><strong>ID</strong></td>
<td width="464" align="center"><strong>图 片 名 称</strong></td>
<td width="65" align="center">
<input type='submit' value='删 除'></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#E3FBE3">
<td height="23" width="52" align="center"><%=rs("id")%></td>
<td width="464"><a href="admin_picedit.asp?id=<%=rs("id")%>&classid=<%=rs("classid")%>&Nclassid=<%=rs("Nclassid")%>"><%=rs("title")%></a></td>
<td width="65" align="center">
<input type='checkbox' name='selpic' value='<%=cstr(rs("id"))%>'></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</form>
</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
response.write "<div align=right><form method=Post action="&filename&">"&_
"共找到<b>"&totalnumber&"</b>项记录"
if CurrentPage<2 then
response.write " 首页 上一页 "
else
response.write " <a href="&filename&"?page=1>首页</a> <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&">下一页</a> "&_
"<a href="&filename&"?page="&n&">末页</a>"
end if
response.write " 页次:<strong>"&CurrentPage&"/"&n&"</strong>页 转到:<select name='page' size='1' onchange='javascript:submit()'>"
for i = 1 to n
response.write "<option value="&i
if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
next
response.write "</select></form></div>"
end function
sub delpic(id)
sql="delete from pic where id="&cstr(id)
conn.execute sql
End sub%>
<table width="50%" border="0" cellspacing="1" cellpadding="1" bgcolor="#333333">
<tr>
<form method="POST" action="admin_picmana.asp">
<td bgcolor="#E7FBE7" align="center">搜索图片: <input type="text" name="title" size="23" value="<%=title%>">
<input type="submit" value="查 询">
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file="copyright.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -