<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../c_Public/Intro_Cookies.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<% 
Dim Param,Ncid,Rs,SQL,Re
Dim Comid,UserName

'//获取用户的登陆标记
If IsArray(Session("Intro")) Then
 Corid = Session("Intro")(2)
 UserName = Session("Intro")(0)
Else
 Session.Abandon() 
 Response.write "<script>alert('-登录后才能进行该操作！-');window.close();</script>"
 Response.End()
End if

Param    = Replace_Text(Request("param"))
Ncid     = Replace_Text(Request("perid"))
'//判断参数是否有效
If Param = "" Then
 Response.write "<script language=JavaScript>alert('操作错误！');window.close();</script>"
 Response.End()
End if

If Ncid = "" Then
 Response.write "<script language=JavaScript>alert('您没有选择记录！');window.close();</script>"
 Response.End()
Else
 Ncid  = Split(Ncid,",")
End if

'//判断操作分支
Select Case Param
 Case "delperson":Call DelPerson_Submit()             '删除人才
 Case "deljob":Call DelJob_Submit()     	          '删除职位
 Case "delheadhunt":Call Delheadhunt_Submit()         '删除猎头职位 
 
 Case "flagjob":Call FlagJob_Submit()                 '开通职位
 Case "noflagjob":Call NoFlagjob_Submit()             '屏蔽职位
 Case "flagheadhunt":Call Flagheadhunt_Submit()       '开通猎头职位 
 Case "noflagheadhunt":Call NoFlagheadhunt_Submit()   '屏蔽猎头职位 
 
 Case "delcomment":Call Delcomment_Submit()           '删除客户留言
 Case "flagcomment":Call Flagcomment_Submit()         '审核留言 
 Case "noflagcomment":Call Noflagcomment_Submit()     '取消审核留言
End Select

'//功能函数

'--------------------------------------删除留言----------------------------------------------
Sub Delcomment_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Intro_GuestBook] Where Corid='"&Corid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub

'--------------------------------------通过留言审核----------------------------------------------
Sub Flagcomment_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Intro_GuestBook] Set Flag=1 Where Corid='"&Corid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub
'--------------------------------------取消留言审核----------------------------------------------
Sub Noflagcomment_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Intro_GuestBook] Set Flag=0 Where Corid='"&Corid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub


'--------------------------------------删除人才----------------------------------------------
Sub DelPerson_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Person_Info] Where Perid='"&Trim(Ncid(i))&"'"
   Conn.Execute(SQL)
   SQL = "Delete From [pH_Person_Base] Where Comid='"&Corid&"' And Perid='"&Trim(Ncid(i))&"'"
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub

'--------------------------------------删除职位----------------------------------------------
Sub DelJob_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Intro_Job] Where Corid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub

'--------------------------------------开通职位----------------------------------------------
Sub FlagJob_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Intro_Job] Set Flag=1 Where Corid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub

'--------------------------------------屏蔽职位----------------------------------------------
Sub NoFlagjob_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Intro_Job] Set Flag=0 Where Corid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub

'--------------------------------------删除猎头职位----------------------------------------------
Sub Delheadhunt_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Headhunt_Base] Where Usertype='Cor' And Userid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub

'--------------------------------------开通猎头职位----------------------------------------------
Sub Flagheadhunt_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Headhunt_Base] Set JobFlag=1 Where Usertype='Cor' And Userid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub

'--------------------------------------屏蔽猎头职位----------------------------------------------
Sub NoFlagheadhunt_Submit() 
 For i = 0 To Ubound(Ncid)
   SQL = "Update [pH_Headhunt_Base] Set JobFlag=0 Where Usertype='Cor' And Userid='"&Corid&"' And Ncid="&Cstr(Trim(Ncid(i)))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub

 %>
