📄 admin_advdel.asp
字号:
<%
Option Explicit
Response.buffer=true
const purviewlevel=3
%>
<!--#include file="admin_PurviewChe.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="../inc/webconfig.asp" -->
<!--#include file="admin_function.asp" -->
<%
dim adverid,advdel,sqlDel,rsDel,FoundErr,ErrMsg
adverid=trim(request("adverid"))
advdel=Trim(Request("advdel"))
FoundErr=False
if adverid="" or advdel<>"del" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>2?êy2?×?£?</li>"
end if
if FoundErr=False then
if instr(adverid,",")>0 then
dim idarr,i
idArr=split(adverid)
for i = 0 to ubound(idArr)
call DelArticle(clng(idarr(i)))
next
else
call DelArticle(clng(adverid))
end if
end if
if FoundErr=False then
call CloseConn()
response.Redirect "admin_AdvMan.asp"
else
call CloseConn()
call ShowErrMsg()
end if
sub DelArticle(ID)
'session("adminpurview")=False
Set rsDel= Server.CreateObject("ADODB.Recordset")
sqlDel="select * from advertisement where adverid=" & CLng(ID)
rsDel.open sqlDel,conn,1,3
if rsDel.bof and rsDel.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>?????:" & rsDel("adverid") & " </li>"
else
if FoundErr=False then
dim ObjInstalled
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
if DelUpFiles="yes" and ObjInstalled=True then
dim fso,strUploadFiles,arrUploadFiles
strUploadFiles=rsDel("imgurl") & ""
if strUploadFiles<>"" then
Set fso = CreateObject("Scripting.FileSystemObject")
if instr(strUploadFiles,"|")>1 then
arrUploadFiles=split(strUploadFiles,"|")
for i=0 to ubound(arrUploadFiles)
if fso.FileExists(server.MapPath("../" & arrUploadfiles(i))) then
fso.DeleteFile(server.MapPath("../" & arrUploadfiles(i)))
end if
next
else
if fso.FileExists(server.MapPath("../" & strUploadfiles)) then
fso.DeleteFile(server.MapPath("../" & strUploadfiles))
end if
end if
Set fso=nothing
end if
end if
rsDel.delete
rsDel.update
set rsDel=nothing
end if
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -