<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<%
dim Result,Selectid
Dim ix,tempx,selectx,len_idx
Result=request.QueryString("Result")
SelectID=request.Form("SelectID")
select case Result
  case "Administrators"
    select case Trim(Request.Form("batch"))
	case "批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Admin set Working = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Admin set Working = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" then  conn.execute "delete from wygkcndiv_Admin where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case "LoginLog"
    if SelectID<>"" then  conn.execute "delete from wygkcndiv_AdminLog where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
  case "MemGroup"
    if SelectID<>"" then  conn.execute "delete from wygkcndiv_MemGroup where GroupID in ('"&SelectID&"')"
	conn.execute "Update wygkcndiv_About set GroupID='200603281858588888' , Exclusive='>=' where GroupID = '"&SelectID&"'"
	conn.execute "Update wygkcndiv_Download set GroupID='200603281858588888' , Exclusive='>=' where GroupID = '"&SelectID&"'"
	conn.execute "Update wygkcndiv_Members set GroupID='200603281858588888' , GroupName='临时游客' where GroupID = '"&SelectID&"'"
	conn.execute "Update wygkcndiv_News set GroupID='200603281858588888' , Exclusive='>=' where GroupID = '"&SelectID&"'"
	conn.execute "Update wygkcndiv_Others set GroupID='200603281858588888' , Exclusive='>=' where GroupID = '"&SelectID&"'"
	conn.execute "Update wygkcndiv_Products set GroupID='200603281858588888' , Exclusive='>=' where GroupID = '"&SelectID&"'"
    response.redirect request.servervariables("http_referer")
  case "Members"
    select case Trim(Request.Form("batch"))
	case "批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Members set Working = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Members set Working = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Members where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case "About"
	select case Trim(Request.Form("batch"))
	case "批量修改排序"
	Abo_id=request("Abo_id")
	Sequence=request("Sequence")
	arr_id=Split(Replace(Abo_id," ",""),",")
	arr_Sequence=Split(Replace(Sequence," ",""),",")
	For i = 0 To UBound(arr_id)
	conn.execute("update wygkcndiv_About set Sequence='"&arr_Sequence(i)&"' where id="&arr_id(i)&"")
	Next
	response.redirect request.servervariables("http_referer")
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_About set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_About set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_About set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_About set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_About where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&AboutNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&AboutNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select

  case "Products"
    select case Trim(Request.Form("batch"))
	case "批量修改产品参数"
	pro_id=request("pro_id")
	ProductNo=request("ProductNo")
	ProductName=request("ProductName")
	N_Price=request("N_Price")
	P_Price=request("P_Price")
	ProductModel=request("ProductModel")
	Stock=request("Stock")
	arr_id=Split(Replace(pro_id," ",""),",")
	arr_ProductNo=Split(Replace(ProductNo," ",""),",")
	arr_ProductName=Split(Replace(ProductName," ",""),",")
	arr_N_Price=Split(Replace(N_Price," ",""),",")
	arr_P_Price=Split(Replace(P_Price," ",""),",")
	arr_ProductModel=Split(Replace(ProductModel," ",""),",")
	arr_Stock=Split(Replace(Stock," ",""),",")
	For i = 0 To UBound(arr_id)
	conn.execute("update wygkcndiv_Products set ProductNo='"&arr_ProductNo(i)&"' where id="&arr_id(i)&"")
	conn.execute("update wygkcndiv_Products set ProductName='"&arr_ProductName(i)&"' where id="&arr_id(i)&"")
	conn.execute("update wygkcndiv_Products set N_Price="&arr_N_Price(i)&" where id="&arr_id(i)&"")
	conn.execute("update wygkcndiv_Products set P_Price="&arr_P_Price(i)&" where id="&arr_id(i)&"")
	conn.execute("update wygkcndiv_Products set ProductModel='"&arr_ProductModel(i)&"' where id="&arr_id(i)&"")
	conn.execute("update wygkcndiv_Products set Stock="&arr_Stock(i)&" where id="&arr_id(i)&"")
	Next
	response.redirect request.servervariables("http_referer")
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Products set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Products set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Products set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Products set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Products where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&ProName&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&ProName&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select
  case "News"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_News set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_News set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_News set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_News set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_News where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&NewName&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&NewName&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select
  case "Download"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Download set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Download set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Download set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Download set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Download where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&DownNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&DownNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select
  case "Jobs"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Jobs set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Jobs set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Jobs set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Jobs set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Jobs where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&JobNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&JobNameDiy&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select
  case "Message"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Message set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Message set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Message set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Message set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Message where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case "Order"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Order where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
  case "Talents"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Talents where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
  case "Navigation"
    select case Trim(Request.Form("batch"))
	case "批量修改排序"
	Nav_id=request("Nav_id")
	Sequence=request("Sequence")
	arr_id=Split(Replace(Nav_id," ",""),",")
	arr_Sequence=Split(Replace(Sequence," ",""),",")
	For i = 0 To UBound(arr_id)
	conn.execute("update wygkcndiv_Navigation set Sequence='"&arr_Sequence(i)&"' where id="&arr_id(i)&"")
	Next
	response.redirect request.servervariables("http_referer")
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Navigation set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Navigation set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Navigation set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Navigation set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Navigation where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case "FriendLink"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_FriendLink set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_FriendLink set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_FriendLink set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_FriendLink set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_FriendLink where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case "Others"
    select case Trim(Request.Form("batch"))
	case "中文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Others set ViewFlagCH = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Others set ViewFlagEN = 1 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "中文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Others set ViewFlagCH = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "英文批量不显示"
	if SelectID<>"" Then conn.execute "update wygkcndiv_Others set ViewFlagEN = 0 where id in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" Then conn.execute "delete from wygkcndiv_Others where id in ("&SelectID&")"
	If ISHTML = 1 Then
		ix=0
		SelectID=replace(SelectID," ","")
		len_idx=len(SelectID)
		tempx=tempx&left(SelectID,1)
		Do While ix<len_idx
			ix=ix+1
			tempx=left(SelectID,1)
			If tempx="," Then
				Call DoDelslhtml(""&OtherName&""&Separated&""&selectx&"."&HTMLName&"")
				selectx=""
			Else
				selectx=selectx&tempx
			End If
			if len_idx-ix=0 Then Call DoDelslhtml(""&OtherName&""&Separated&""&selectx&"."&HTMLName&"")
			SelectID=right(SelectID,len_idx-ix)
		Loop
	End If
    response.redirect request.servervariables("http_referer")
	End Select
	
	case "ADs"
    if SelectID<>"" then  
		'调用删除文章中相关文件	代码开始
	if instr(SelectID,",")>0 then
		idArr=split(SelectID)
		for i = 0 to ubound(idArr)
			call DelArticlepic(clng(idarr(i)))
		next
	else
		call DelArticlepic(clng(SelectID))
	end if
	'调用删除文章中相关文件	代码结束
	conn.execute "delete from wygkcndiv_ADs where id in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	end if
	
 case "NoHackSql"
    select case Trim(Request.Form("batch"))
	case "批量锁定"
	if SelectID<>"" Then conn.execute "update wygkcndiv_NoHackSql set Kill_ip=true where SqlIn_ID in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "批量解锁"
	if SelectID<>"" Then conn.execute "update wygkcndiv_NoHackSql set Kill_ip=False where SqlIn_ID in ("&SelectID&")"
	response.redirect request.servervariables("http_referer")
	case "删除所选"
    if SelectID<>"" then  conn.execute "delete from wygkcndiv_NoHackSql where SqlIn_ID in ("&SelectID&")"
    response.redirect request.servervariables("http_referer")
	End Select
  case else
end select

sub DelArticlepic(SelectID)
	   dim rs,sql,fso,strUploadFiles,arrUploadFiles,i
       Set rs= Server.CreateObject("ADODB.Recordset")
       sql= "select * from liangjing_"&Result&" where id in ("&SelectID&")"
       rs.open sql,conn,1,3
	   strUploadFiles=rs("UploadFiles")
			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 sub

%>