<!--#include file="../Inc/Consts.inc" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/strfunc.Asp" -->

<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
Dim Result, Selectid,ID
Dim ix, tempx, selectx, len_idx
Result = request.QueryString("Result")
SelectID = request.Form("SelectID")

'Call SiteInfo()
ID=trim(request.QueryString("ID"))
Select Case Result
    Case "SiteLink"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db( "update ["&Datapre&"_Link] set State = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Link] set State = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Link] where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "Administrators"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Admin] set Working = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Admin] set Working = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Admin] where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "LoginLog"
        If SelectID<>"" Then call db("delete from ["&Datapre&"_AdminLog] where id in ("&SelectID&")",0)
        response.redirect request.servervariables("http_referer")
   
    Case "About"
        If SelectID<>"" Then call db("delete from ["&Datapre&"_About] where id in ("&SelectID&")",0)
        response.redirect request.servervariables("http_referer")
    Case "Products"
        Select Case Trim(Request.Form("batch"))
        Case "批量修改产品排序"
			Dim pro_id,arr_id,OrderNum,arr_Order,i
            pro_id = request("pro_id")
           OrderNum=request("OrderNum")
            arr_id = Split(Replace(pro_id, " ", ""), ",")
            arr_Order = Split(Replace(OrderNum, " ", ""), ",")
            For i = 0 To UBound(arr_id)
                Call db("update ["&Datapre&"_Products] set OrderNum='"&arr_Order(i)&"' where id="&arr_id(i)&"",0)
            Next
            response.redirect request.servervariables("http_referer")
        Case "批量生效"
            If SelectID<>"" Then Call db("update ["&Datapre&"_Products] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then Call db( "update ["&Datapre&"_Products] set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then Call db("delete from ["&Datapre&"_Products] where id in ("&SelectID&")",0)
            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 Call db("update ["&Datapre&"_News] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then  Call db("update ["&Datapre&"_News] set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then Call db( "delete from ["&Datapre&"_News] where id in ("&SelectID&")",0)
            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 "UserMessage"
        Select Case Trim(Request.Form("batch"))
        Case "批量处理"
            If SelectID<>"" Then call db("update ["&Datapre&"_Biz] set BizOK = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Biz] where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "Download"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Download] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Download] set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Download] where id in ("&SelectID&")",0)
            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 call db("update ["&Datapre&"_Jobs] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Jobs] set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Jobs] where id in ("&SelectID&")",0)
            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 call db("update ["&Datapre&"_Message] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Message] set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from ["&Datapre&"_Message] where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "Talents"
        If SelectID<>"" Then call db("delete from ["&Datapre&"_Talents] where id in ("&SelectID&")",0)
        response.redirect request.servervariables("http_referer")
    Case "Navigation"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db("update ["&Datapre&"_Navigation] set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update "&Datapre&"_Navigation set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from "&Datapre&"_Navigation where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "FriendLink"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db("update "&Datapre&"_FriendLink set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update "&Datapre&"_FriendLink set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from "&Datapre&"_FriendLink where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
    End Select
    Case "Others"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then call db("update "&Datapre&"_Others set ViewFlag = 1 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then call db("update "&Datapre&"_Others set ViewFlag = 0 where id in ("&SelectID&")",0)
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then call db("delete from "&Datapre&"_Others where id in ("&SelectID&")",0)
            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 "Labels"
         Call db( "delete from ["&Datapre&"_Labels] where id ="&ID&"")
    response.redirect request.servervariables("http_referer")       
	
	
    Case Else
End Select
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
%>