📄 admindelpic.asp
字号:
<!--#include file="conn.asp"-->
<style type="text/css">
<!--
body,td,th {
color: #000000;
font-size: 12px;
}
body {
margin-left: 0px;
margin-top: 0px;
}
a {
font-size: 12px;
color: #000000;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
<table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <%dim username,sql,type2,ad
ad=request.querystring("ad")
type2=request.queryString("type2")
use=request.querystring("use")
if Session("chong")<>4 then
Response.Write("兄弟,你的权力不够啊!快来给我送点礼吧")
Response.Write("<br>")
Response.Write("<a href='javascript:history.go(-1)'><font color=red size=2>哎,回去吧</font></a>")
else
Const const_photoup_path="../upphoto/"
If Request.QueryString("action") ="del" Then
Call del
Else
Call main
End If
end if
Sub main
%>
<table border="1" cellspacing="0" width="98%" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" cellpadding="0" align="center">
<tr>
<td height="23" colspan="2" 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>
<table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="form1" method="post" action="?action=del"><tr align="center" bgcolor="#FFFFFF">
<td width="45"><font color="#000000">ID</font></td>
<td width="97"><font color="#000000">操作员</font></td>
<td width="286"><font color="#000000">文件</font></td>
<td ><font color="#000000">时间</font></td>
<td >删除</td>
</tr>
<%
Dim 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("username")%></font></td>
<td><font color="#000000"><a href='../upphoto/<%=rs("pic")%>' target="_blank"><%=rs("pic")%></a></font></td>
<td width="193"><font color="#000000"><%=rs("deltime")%></font></td>
<td width="123"><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>暂时没有被删除的照片!</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 align="center"><input type="submit" name="Submit" value="执行" onclick="return todel()">
</td>
</tr></form>
</table>
</td>
</tr>
<tr>
<td height="23" colspan="2" align="center">本照片删除系统主体代码由电商电学录编写者walkman所写</td>
</tr>
</table>
<%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_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 "成功删除标号为<font color=red>"&id&"</font>的日志记录!<br>"
Response.write "<a href=admindelpic.asp>回头</a><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 "<font color=red>服务器不支持该组件!</font>"
Exit Function
End if
if objFSO.fileExists(filepaths) then
objFSO.DeleteFile(filepaths)
response.write "成功删除"&filepaths&"<br>"
else
response.write "未找到"&filepaths&"<br>"
end if
objFSO.close
set objFSO=nothing
End Function
%></td>
</tr>
</table></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -