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

'//获取用户的登陆标记
If IsArray(Session("Educate")) Then
 Schid = Session("Educate")(2)
 UserName = Session("Educate")(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 "delsud":Call DelSud_Submit() '删除课程
 Case "delaction":Call DelAction_Submit() '删除课程的报名信息
 Case "delteacher":Call DelTeacher_Submit() '删除讲师
 Case "dellessoncomment":Call Dellessoncomment_Submit() '删除课程留言
 Case "delteachercomment":Call Delteachercomment_Submit() '删除讲师留言
 Case "delcomment":Call Delcomment_Submit() '删除客户留言
 
 Case "flaglessoncomment":Call Flaglessoncomment_Submit() '审核课程留言 
 Case "noflaglessoncomment":Call Noflaglessoncomment_Submit() '取消审核课程留言
 Case "flagteachercomment":Call Flagteachercomment_Submit() '审核讲师留言 
 Case "noflagteachercomment":Call Noflagteachercomment_Submit() '取消审核讲师留言
 Case "flagcomment":Call Flagcomment_Submit() '审核课程留言 
 Case "noflagcomment":Call Noflagcomment_Submit() '取消审核课程留言

End Select

'//功能函数

'--------------------------------------删除课程----------------------------------------------
Sub DelSud_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Educate_Lesson] Where Schid='"&Schid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub
'--------------------------------------删除课程报名信息----------------------------------------------
Sub DelAction_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Educate_Action] Where Schid='"&Schid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('删除成功！');window.close();</script>"
End Sub

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

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

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

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

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

'--------------------------------------删除培训机构客户留言----------------------------------------------
Sub Delcomment_Submit()
 For i = 0 To Ubound(Ncid)
   SQL = "Delete From [pH_Educate_GuestBook] Where Schid='"&Schid&"' 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_Educate_GuestBook] Set Flag=1 Where Schid='"&Schid&"' 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_Educate_GuestBook] Set Flag=0 Where Schid='"&Schid&"' And Ncid="&Cstr(Ncid(i))
   Conn.Execute(SQL)
 Next
 Response.write "<script language=JavaScript>alert('设置成功！');window.close();</script>"
End Sub

'//关闭数据库连接

CloseDB
 %>
