
<!-- #include file="../conn.asp" -->
<!-- #include file="admin.asp" -->
<%call ling()
Call Head
call saycardd("图片分类删除")
    dim rs,sql,lid,rs1
    lid=request.querystring("lid")
    set rs=server.CreateObject ("ADODB.Recordset") 
sql="Select * from wjlist where lid="&lid
rs.open sql,conn,2,3  
if not (rs.bof and rs.eof) then
rs.delete  
rs.close
set rs=nothing
   set rs=server.CreateObject ("ADODB.Recordset") 
rs.open "Select * from wjfile where lid="&lid ,conn,2,3  
If Not rs.eof Then
Do until RS.Eof
   set rs1=server.CreateObject ("ADODB.Recordset") 
rs1.open "Select * from uppic where lid="&rs("id") ,conn,2,3 
If Not rs1.eof Then 
Do until RS1.Eof
if rs1("picurl")<>"" then
Set fso = server.CreateObject("Scripting.FileSystemObject")
	IF (fso.FileExists(Server.MapPath(replace(rs1("picurl"),"http://"&request.ServerVariables("Server_NAME")&"","")))) Then
	Set delfile = fso.GetFile(Server.MapPath(replace(rs1("picurl"),"http://"&request.ServerVariables("Server_NAME")&"","")))
	delfile.Delete
	set delfile=nothing
	end if
set fso=nothing
	end if
rs1.delete
rs1.update  
rs1.movenext
loop
end if
rs1.close
set rs1=nothing

rs.delete
rs.update  
rs.movenext
loop
end if
rs.close
set rs=nothing
Response.Write "图片类别(包含类别中的图片)删除成功!"     
else
Response.Write "图片类别删除失败!类别不存在或者已删除!"  
%>
<%end if%>
<br/>----------<br/>
<a href='picdl.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>[图片大类]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<%response.write""%>
<%call head3()%>