📄 admin_photo.asp
字号:
<!--#include file=INC/skin.asp-->
<%
Dim const_txl_HomeUrl
const_txl_HomeUrl = ""
%>
<!--#include file=admin_login_check.asp-->
<%
Call opendatabase
Call txl_SiteHead (const_txlname&"- 管理员")
If Request.QueryString("action") ="del" Then
Call del
Else
Call main
End If
Call CloseDataBase
Call web_end
Sub main
%>
<br><table width="720" border="1" align="center" cellpadding="8" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td height="20" align="center" bgcolor="#efefef">删除单个记录请点<a href="<%=const_txl_HomeUrl%>photo_show.asp" target="_blank">这里进入</a>前台进行操作,批量删除请在下面输入天数<b></b></td>
</tr>
<tr>
<td height="23" align="center"><script language="javascript">
function selectAll(){
for (var i=0;i<document.form1.elements.length;i++){
var e = document.form1.elements[i];
if (e.name== 'applyno')
e.checked=document.form1.del.checked;
}
}
function todel(){
var logo
for (i=0;i<document.form1.elements.length;i++)
{
e = document.form1.elements[i];
if(e.name== 'applyno'&&e.checked==true)
{
logo=true;
break;
}
else
{
logo=false;
}
}
if(logo)
{
if (confirm("你确实要删除吗?"))
{
if ((!document.form1.delpic.checked)&&(!document.form1.dellog.checked))
{
alert("请你选择操作!")
return false
}
else
{
return true
}
}
}
else
{
alert("请你选择记录!")
return false
}
}
function walk_jing(loveyou){
if (loveyou.checked)
document.form1.dellog.disabled=false
else
document.form1.dellog.disabled=true
document.form1.dellog.checked=false
}
</script>
以下是删除的照片,如果你使用的服务器支持FSO,可直接删除图片和记录,如果不支持FSO,请在ftp中手动删除.
<form name="form1" method="post" action="?action=del">
<table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#FFFFFF">
<td width="31"><font color="#000000">ID</font></td>
<td width="69"><font color="#000000">操作员</font></td>
<td width="196"><font color="#000000">文件</font></td>
<td ><font color="#000000">时间</font></td>
<td >删除</td>
</tr>
<%
Dim sql,rs,i
i=0
sql="select * from dellog order by deltime desc"
set rs=conn.execute (sql)
if not rs.eof then
while not rs.eof
i=i+1
%>
<tr align="center" bgcolor="#FFFFFF">
<td><font color="#000000"><B><%=i%></B></font></td>
<td><font color="#000000"><%=rs("sname")%></font></td>
<td><font color="#000000"><a href='<%=const_txl_HomeUrl&const_photoup_path&rs("pic")%>'><%=rs("pic")%></a></font></td>
<td width="134"><font color="#000000"><%=rs("deltime")%></font></td>
<td width="84"><input name="applyno" type="checkbox" id="applyno" value="<%=rs("id")%>"></td>
</tr>
<%
rs.movenext
wend
else
Response.Write("<tr><td colspan=4 align=center><font color=red>no record!</font></td></tr>")
end if
rs.close
set rs=nothing
%>
</table>
<table width="99%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"><input name="del" type="checkbox" id="del" onclick="selectAll()" value="checkbox">
全选
<input name="delpic" type="checkbox" id="delpic" value="1" onclick="walk_jing(this)">
删除所选图片文件
<input name="dellog" type="checkbox" id="dellog" value="1" disabled>
删除所选记录</td>
</tr>
<tr>
<td height="50" align="center"><input type="submit" name="Submit" value="立 即 执 行" onclick="return todel()"></td>
</tr>
</table>
</form></td>
</tr>
</table>
<br>
<%End SUb%><% Sub Del
dim rs,i,delpicflag,dellogflag,id
delpicflag=false
dellogflag=false
if Request.Form("delpic")="1" Then delpicflag=true
if Request.Form("dellog")="1" Then dellogflag=true
id=Request.form("applyno")
if id="" Then exit sub
id=Replace(id," ","")
if Instr(id,",")>0 THen
id=Split(id,",")
end if
if isarray(id) then
for i=0 to ubound(id)
set rs=conn.execute ("select id,pic from dellog where id="&id(i))
if not rs.eof then
if delpicflag Then
Call FSODel(Server.Mappath(const_txl_HomeUrl&const_photoup_path&rs(1)))
end if
if dellogflag Then
Call dellog(rs(0))
end if
end if
rs.close
set rs=nothing
next
else
set rs=conn.execute ("select id,pic from dellog where id="&id)
if not rs.eof then
if delpicflag Then
Call FSODel(Server.Mappath(const_txl_HomeUrl&const_photoup_path&rs(1)))
end if
if dellogflag Then
Call dellog(rs(0))
end if
end if
rs.close
set rs=nothing
end if
End Sub
function dellog(id)
on error resume next
conn.execute ("delete from dellog where id="&id)
Response.write "<br> 成功删除标号为<font color=red>"&id&"</font>的日志记录!<br>"
end function
Function FSODel(filename)
on error resume next
Dim objFSO,filepaths
filepaths=filename
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If not isobject(objFSO) Then
Response.write "<br> <font color=red>服务器不支持该组件!</font>"
Exit Function
End if
if objFSO.fileExists(filepaths) then
objFSO.DeleteFile(filepaths)
response.write "<br> 成功删除"&filepaths&"<br>"
else
response.write "<br> 未找到"&filepaths&"<br>"
end if
objFSO.close
set objFSO=nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -