adminfile.asp
来自「一个网络相册」· ASP 代码 · 共 200 行
ASP
200 行
<!--#include file="../function1/DBOpen.asp"-->
<%
if session("purview")="" then
Response.Redirect"../login.asp?id=0"
end if
%>
<html>
<head>
<%
dim classid,owner
if trim(Request.QueryString("classid"))<>"" then
classid=trim(Request.QueryString("classid"))
sql = "SELECT * FROM class where id="&classid&" "
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,0,1
if not rs2.eof and not rs2.bof then
owner=rs2("owner")
if session("name")<>owner and session("purview")<>"99999" then
Response.Write"你不是超极管理员或者该相册不是你所有,你不能管理该相册"
Response.end
end if
end if
end if
%>
<title>图片管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: none}
a:hover { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: underline}
td { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
br { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
.bk { font-size: 9pt; border: 1px <%=xcolor%> solid}
body { font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none}
.an { font-family: "宋体"; font-size: 9pt; background-color: <%=bgcolor%>; border: 1px <%=xcolor%> solid; color: <%=fontcolor%>}
.xzy { border: <%=xcolor%> solid; border-width: 0px 1px 1px}
.zx { border: <%=xcolor%> solid; border-width: 0px 0px 1px 1px}
.sxz { border: <%=xcolor%> solid; border-width: 1px 0px 1px 1px}
.s { border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
.y { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px}
.font { font-family: "Arial Black"; font-size: 14pt; color: <%=fontcolor%>}
.x { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
.z { border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 1px}
.sx { border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
-->
</style>
</head>
<body bgcolor="<%=bgcolor%>" text="#000000" background="images/bg4.gif">
<script language=JavaScript>
function SureDel(id)
{
if ( confirm("确定删除这张相片吗?"))
{
window.location.href = "savefile.asp?cz=del&id=" + id
}
}
</script>
<table cellspacing=0 cellpadding=0 width=641 align=center border=0>
<tbody>
<tr valign=top>
<td width="641" height="200" align="center" valign="middle" bgcolor="#FFFFFF"> <div align="center"> <TABLE width="726" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD><IMG height=9 src="../img/all_zone_03.gif" width=8></TD>
<TD background=../img/all_zone_04.gif></TD>
<TD><IMG height=9 src="../img/all_zone_05.gif" width=8></TD>
</TR>
<TR>
<TD background=../img/all_zone_07.gif height=10></TD>
<TD align=middle bgcolor="#FFFFFF"></TD>
<TD background=../img/all_zone_09.gif></TD>
</TR>
<TR>
<TD width=7 background=../img/all_zone_07.gif height=110></TD>
<TD align=middle bgcolor="#FFFFFF"><table width="100%" height="98%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="100%" height="110" align="center"><table cellspacing=0 cellpadding=5 width="100%"
align=center border=0>
<tbody>
<tr>
<td align=middle>相册名称:
<%
sql = "SELECT * FROM class where id="&classid&" "
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,0,1
if rs2.eof and rs2.bof then
Response.Write"还没有分类"
else
Response.Write rs2("name")
end if
rs2.close
Set rs2=Nothing
%></td>
</tr>
<tr>
<td align=middle>
<%
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5'>"
Dim ipagecount
Dim ipagecurrent
Dim strorderBy
Dim irecordsshown
if request.querystring("page")="" then
ipagecurrent=1
else
ipagecurrent=cint(request.querystring("page"))
end if
sql = "SELECT small,hit,title,id FROM photo ORDER BY id DESC"
if classid<>"" then
sql = "SELECT small,hit,title,id FROM photo where classid="&classid&" ORDER BY id DESC"
else
sql = "SELECT small,hit,title,id FROM photo ORDER BY id DESC"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.pagesize = 9
rs.cachesize = 9
rs.open sql,conn,1,1
ipagecount = rs.pagecount
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
If ipagecurrent < 1 Then ipagecurrent = 1
if ipagecount=0 then
response.write "<tr><td align='center'>没有任何文件</tr></td>"
else
rs.absolutepage = ipagecurrent
irecordsshown = 0
do while irecordsshown<9 and NOT rs.EOF
Response.Write"<tr align='center'>"
for i=1 to 3
Response.Write"<td width='33%'>"
if not rs.eof then
Response.Write"<a href='../display.asp?id="&rs("id")&"' target='_blank'><img src='"&rs("small")&"' height='90' class='bk'></a><br><br><a href='../display.asp?id="&rs("id")&"' target='_blank'>"&rs("title")&"</a> <br>[<a href='javascript:SureDel("&rs("id")&")'>删除 </a>|<a href='addfile.asp?id="&rs("id")&"&cz=editfile'> 编辑</a>]</td>"
irecordsshown = irecordsshown +1
rs.movenext
end if
next
Response.Write"</tr>"
loop
end if
rs.Close
set rs=nothing
Response.Write"</table>"
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5' class='s'><form name='form1' method='get' action='adminfile.asp'><tr><td height='20' align='center'>每页显示 9 个文件 共有 "&ipagecount&" 页 当前为第 "&ipagecurrent&" 页 "
if ipagecurrent=1 then
Response.Write"首页 | "
else
Response.Write"<a href='adminfile.asp?classid="&classid&"&page=1'>首页</a> | "
end if
if ipagecurrent=1 then
Response.Write"上一页 | "
else
Response.Write"<a href='adminfile.asp?classid="&classid&"&page="&ipagecurrent-1&"'>上一页</a> | "
end if
if ipagecount>ipagecurrent then
Response.Write"<a href='adminfile.asp?classid="&classid&"&page="&ipagecurrent+1&"'>下一页</a> "
else
Response.Write"下一页"
end if
if ipagecount>ipagecurrent then
Response.Write"| <a href='adminfile.asp?classid="&classid&"&page="&ipagecount&"'>末页</a> "
else
Response.Write"| 末页 "
end if
Response.Write"</td></tr></form></table>"
%>
</td>
</tr>
</tbody>
</table></td>
</tr>
</table></TD>
<TD width=8 background=../img/all_zone_09.gif></TD>
</TR>
<TR>
<TD><IMG height=9 src="../img/all_zone_10.gif" width=8></TD>
<TD background=../img/all_zone_11.gif></TD>
<TD><IMG height=9 src="../img/all_zone_12.gif"
width=8></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr valign=top>
<td><div align="center"><%Response.Write"<a href='addfile.asp?classid="&classid&"'>添加图片</a> <a href='photoclass.asp'>返回</a>"%></div></td>
</tr>
</tbody>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?