<!--#include file="Include/Const.Asp" -->
<!--#include file="Include/ConnSiteData.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<%
Dim Result,Selectid,fromID
Dim ix, tempx, selectx, len_idx
Result = request.QueryString("Result")
fromID = request.QueryString("fromID")
SelectID = request.Form("SelectID")
Select Case Result
    Case "My_personKehu" '我的联系人
        Select Case Trim(Request.Form("batch"))
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "update Zqj_Contactperson set Cp_working = 0 where Cp_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
	Case "My_companyKehu" '我的公司客户
		Select Case Trim(Request.Form("batch"))
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "update Zqj_Company set Co_ViewFlag = 0 where Co_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
    Case "Recycle_people" '联系人回收站
        Select Case Trim(Request.Form("batch"))
        Case "还原所选"
            If SelectID<>"" Then conn.Execute "update Zqj_Contactperson set Cp_working = 1 where Cp_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "彻底删除"
            If SelectID<>"" Then conn.Execute "delete from Zqj_Contactperson where Cp_ID in ("&SelectID&")"
			conn.Execute "delete from Zqj_Records where Cp_ID in ("&SelectID&")"
			conn.Execute "delete from Zqj_Plan where Cp_ID in ("&SelectID&")"
			conn.Execute "delete from Zqj_Order where Cp_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
	Case "Recycle_Companies" '公司回收站
		 Select Case Trim(Request.Form("batch"))
        Case "还原所选"
            If SelectID<>"" Then conn.Execute "update Zqj_Company set Co_ViewFlag = 1 where Co_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "彻底删除"
            If SelectID<>"" Then conn.Execute "delete from Zqj_Company where Co_ID in ("&SelectID&")"
			conn.Execute "delete from Zqj_Records where Co_ID in ("&SelectID&")"
			conn.Execute "delete from Zqj_Contactperson where Co_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
    Case "KehuRe" '跟进记录
        If SelectID<>"" Then conn.Execute "delete from Zqj_KehuRe where ID in ("&SelectID&")"
		response.Redirect("Kehu/KehuView.Asp?Result=Modify&ID="&fromID&"&showid=4")
    Case "MemGroup" '用户组
        If SelectID<>"" Then conn.Execute "delete from Zqj_MemGroup where GroupID in ('"&SelectID&"')"
        conn.Execute "Update Zqj_Members set GroupID='201111268888888888' , GroupName='普通用户' where GroupID = '"&SelectID&"'"
		response.redirect request.servervariables("http_referer")
    Case "Members" '员工
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then conn.Execute "update Zqj_Members set Working = 1 where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then conn.Execute "update Zqj_Members set Working = 0 where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "delete from Zqj_Members where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
         End Select
	Case "My_chances_batch" '机会批量操作
	      Select Case Trim(Request.Form("batch"))
          Case "批量添加到任务"
		       response.Redirect "tasks/Tasks_Batch_chances2.asp?Result=Add&SelectID="&SelectID
		  End Select
    Case "My_chances" '删除单条机会
        If fromID <>"" Then conn.Execute "delete from Zqj_chances where ID="&fromID&""
		conn.Execute "delete from Zqj_KehuRe where chancesID="&fromID&""
		response.Redirect("chances/My_chances_list.Asp")        
    Case "News"
        Select Case Trim(Request.Form("batch"))
        Case "批量生效"
            If SelectID<>"" Then conn.Execute "update Zqj_News set ViewFlag = 1 where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "批量失效"
            If SelectID<>"" Then conn.Execute "update Zqj_News set ViewFlag = 0 where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "delete from Zqj_News where id in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
    Case "TasksSort" '删除任务分类
            If fromID<>"" Then conn.Execute "delete from Zqj_TasksSort where ID="&fromID&""
            response.redirect request.servervariables("http_referer")
    Case "Tasks" '删除任务
            If fromID<>"" Then conn.Execute "delete from Zqj_Tasks where ID="&fromID&""
			conn.Execute "delete from Zqj_KehuRe where TasksID = "&fromID&""
            response.redirect request.servervariables("http_referer")
    Case "Plan" '删除任务
            If fromID<>"" Then conn.Execute "delete from Zqj_Plan where PL_ID="&fromID&""
			response.redirect request.servervariables("http_referer")
	Case "Visitreport" '删除拜访记录
		Select Case Trim(Request.Form("batch"))
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "delete from Zqj_Visitreport where Vi_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
	Case "khRecords"
	    Select Case Trim(Request.Form("batch"))
        Case "删除所选"
            If SelectID<>"" Then conn.Execute "delete from Zqj_Records where Re_ID in ("&SelectID&")"
            response.redirect request.servervariables("http_referer")
        End Select
    Case Else
End Select
%>