<!--#include file="utf-8.asp" -->
<!--#include file="js/Function.asp" -->
<!--#include file="html/yidacms_htmlurl.asp" -->
<!--#include file="CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成 yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除！</title>
</head>

<body>
<%
if request("t")="photoclasseditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_photoclass where wait_tcyi = '"&request("id")&"'"
	rs.open sql,dbok,1,1
    If Not rs.EOF Then
	rs.close
	set rs=nothing
		response.write "<script language=javascript> alert('该栏目下有子栏目,请先删除子栏目！');location.replace('photo/admin_photoclass.asp');</script>"
		response.end
    End If
	if html1 = "html" then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_photoclass WHERE id= "&request("id")&""
	rs.open sql,dbok,1,1
	Set fs = Server.CreateObject("Scripting.FileSystemObject")
	File = Server.MapPath("../html/photo/photolist_"&rs("id")&".html")
	on Error Resume Next
	fs.DeleteFile File, True
	If Err.Number = 53 Then
		Response.Write File & "文件不存在！"
			Elseif Err.Number = 70 Then
				Response.Write File & "文件属性为锁定状态！"
					Elseif Err.Number <> 0 Then
						Response.Write "未知错误，错误编码：" & Err.Number
							Else
								Response.Write "连同HTML文件一起删除了！" & File
	End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_photoclass WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('photo/admin_photoclass.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="photoeditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_photo WHERE id= "&request("id")&""
	rs.open sql,dbok,1,1
	htm = "../"&rs("shuaiweb_photoimg1")&",../"&rs("shuaiweb_photoimg2")&",../"&rs("shuaiweb_photoimg3")&",../"&rs("shuaiweb_photoimg4")&",../"&rs("shuaiweb_photoimg5")&""
	set fso = server.createobject("scripting.FileSystemObject")
	arrFile = split(htm,",")		
	for i = 0 to ubound(arrFile)
	if fso.FileExists(server.mappath(arrFile(i)))then
	fso.DeleteFile(server.mappath(arrFile(i)))
	end if
	next

if html1 = "html" then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_photo WHERE id= "&request("id")&""
rs.open sql,dbok,1,1
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath("../html/photo/photo_"&rs("id")&".html")
on Error Resume Next
fs.DeleteFile File, True
If Err.Number = 53 Then
	Response.Write File & "文件不存在！"
		Elseif Err.Number = 70 Then
			Response.Write File & "文件属性为锁定状态！"
				Elseif Err.Number <> 0 Then
					Response.Write "未知错误，错误编码：" & Err.Number
						Else
							Response.Write "连同HTML文件一起删除了！" & File
End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_photo WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('photo/admin_photolist.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="newsclasseditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_newsclass where wait_ncyi = '"&request("id")&"'"
	rs.open sql,dbok,1,1
    If Not rs.EOF Then
	rs.close
	set rs=nothing
		response.write "<script language=javascript> alert('该栏目下有子栏目,请先删除子栏目！');location.replace('news/admin_newsclass.asp');</script>"
		response.end
    End If
	if html1 = "html" then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_newsclass WHERE id= "&request("id")&""
	rs.open sql,dbok,1,1
	Set fs = Server.CreateObject("Scripting.FileSystemObject")
	File = Server.MapPath("../html/news/newslist_"&rs("id")&".html")
	on Error Resume Next
	fs.DeleteFile File, True
	If Err.Number = 53 Then
		Response.Write File & "文件不存在！"
			Elseif Err.Number = 70 Then
				Response.Write File & "文件属性为锁定状态！"
					Elseif Err.Number <> 0 Then
						Response.Write "未知错误，错误编码：" & Err.Number
							Else
								Response.Write "连同HTML文件一起删除了！" & File
	End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_newsclass WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('news/admin_newsclass.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="newseditdel" Then 
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_news WHERE id= "&request("id")&""
	rs.open sql,dbok,1,1
	htm = "../../"&rs("shuaiweb_pic")&""
	set fso = server.createobject("scripting.FileSystemObject")
	arrFile = split(htm,",")		
	for i = 0 to ubound(arrFile)
	if fso.FileExists(server.mappath(arrFile(i)))then
	fso.DeleteFile(server.mappath(arrFile(i)))
	end if
	next
	
if html1 = "html" then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_news WHERE id= "&request("id")&""
rs.open sql,dbok,1,1
Set fs = Server.CreateObject("Scripting.FileSystemObject")
if rs("yida_language") = "ch" then
	File = Server.MapPath("../html/news/news_"&rs("id")&".html")
		elseif rs("yida_language") = "en" then
	File = Server.MapPath("../html/en_news/news_"&rs("id")&".html")
end if
on Error Resume Next
fs.DeleteFile File, True
If Err.Number = 53 Then
	Response.Write File & "文件不存在！"
		Elseif Err.Number = 70 Then
			Response.Write File & "文件属性为锁定状态！"
				Elseif Err.Number <> 0 Then
					Response.Write "未知错误，错误编码：" & Err.Number
						Else
							Response.Write "连同HTML文件一起删除了！" & File
End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_news WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('news/admin_newslist.asp');</script>"
	response.end
End If 
'#################################################################
if request("t")="productseditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_productsclass where wait_pcyi = '"&request("id")&"'"
	rs.open sql,dbok,1,1
If Not rs.EOF Then
rs.close
set rs=nothing
	response.write "<script language=javascript> alert('该栏目下有子栏目,请先删除子栏目！');location.replace('products/admin_productsclass.asp');</script>"
	response.end
End If
		
if html1 = "html" then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_productsclass WHERE id= "&request("id")&""
rs.open sql,dbok,1,1
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath("../html/products/productslist_"&rs("id")&".html")
on Error Resume Next
fs.DeleteFile File, True
If Err.Number = 53 Then
	Response.Write File & "文件不存在！"
		Elseif Err.Number = 70 Then
			Response.Write File & "文件属性为锁定状态！"
				Elseif Err.Number <> 0 Then
					Response.Write "未知错误，错误编码：" & Err.Number
						Else
							Response.Write "连同HTML文件一起删除了！" & File
End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_productsclass WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('products/admin_productsclass.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="productsdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_products WHERE id= "&request("id")&""
	rs.open sql,dbok,1,1
	htm = "../"&rs("shuaiweb_productsminpic")&",../"&rs("shuaiweb_productsmaxpic")&""
	set fso = server.createobject("scripting.FileSystemObject")
	arrFile = split(htm,",")		
	for i = 0 to ubound(arrFile)
	if fso.FileExists(server.mappath(arrFile(i)))then
	fso.DeleteFile(server.mappath(arrFile(i)))
	end if
	next

if html1 = "html" then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_products WHERE id= "&request("id")&""
rs.open sql,dbok,1,1
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath("../html/products/products_"&rs("id")&".html")
on Error Resume Next
fs.DeleteFile File, True
If Err.Number = 53 Then
	Response.Write File & "文件不存在！"
		Elseif Err.Number = 70 Then
			Response.Write File & "文件属性为锁定状态！"
				Elseif Err.Number <> 0 Then
					Response.Write "未知错误，错误编码：" & Err.Number
						Else
							Response.Write "连同HTML文件一起删除了！" & File
End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_products WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('products/admin_productslist.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="bookeditdel" Then 
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_book WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('book/admin_book.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="coeditdel" Then 
if html1 = "html" then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_co WHERE id= "&request("id")&""
rs.open sql,dbok,1,1
Set fs = Server.CreateObject("Scripting.FileSystemObject")
if rs("yida_language") = "ch" then
	File = Server.MapPath("../html/about/about_"&rs("id")&".html")
		elseif rs("yida_language") = "en" then
	File = Server.MapPath("../html/en_about/about_"&rs("id")&".html")
end if
on Error Resume Next
fs.DeleteFile File, True
If Err.Number = 53 Then
	Response.Write File & "文件不存在！"
		Elseif Err.Number = 70 Then
			Response.Write File & "文件属性为锁定状态！"
				Elseif Err.Number <> 0 Then
					Response.Write "未知错误，错误编码：" & Err.Number
						Else
							Response.Write "连同HTML文件一起删除了！" & File
End If
end if

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_co WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('about/admin_co.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="yangshieditdel" Then 
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_style WHERE sid= "&request("sid")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('admin_yangshi.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="qqeditdel" Then 
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_qq WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('qq/admin_qq.asp');</script>"
	response.end
End If
'#################################################################
if request("yidacms")="tempeditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_waiter WHERE bid= "&request("bid")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('html/');</script>"
	response.end
End If
'#################################################################
if request("yidacms")="usereditdel" Then 
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_user WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('user/admin_userlist.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="navigationdel" Then
set rs = server.createobject("adodb.recordset")
sql="select * from shuaiweb_navigation where wait_nasi = "&request("id")&""
rs.open sql,dbok,1,1
If Not rs.EOF Then
rs.close
set rs=nothing
	response.write "<script language=javascript> alert('该栏目下有子栏目,请先删除子栏目！');location.replace('navigation/admin_navigation.asp');</script>"
	response.end
End If

	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_navigation WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('navigation/admin_navigation.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="videoclasseditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_videoclass WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('video/admin_videoclass.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="videoeditdel" Then
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_video WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('video/admin_video.asp');</script>"
	response.end
End If
'#################################################################
if request("t")="admineditdel" Then
    if request("id") = 1 then
	  response.write "<script language=javascript> alert('超级管理员不可以删除！');location.replace('admin_admin.asp');</script>"
	  response.end
	end if
	
	set rs = server.createobject("adodb.recordset")
	sql="DELETE * FROM shuaiweb_vipadministrator WHERE id= "&request("id")&""
	rs.open sql,dbok,3,2
	response.write "<script language=javascript> alert('成功删除！');location.replace('admin_admin.asp');</script>"
	response.end
End If
%>
</body>
</html>
