<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Include/checklogin.asp"-->
<!--#include file="Include/connect.asp"-->
<!--#include file="../Include/function.asp"-->
<%
if request.querystring("type")="album" then
	Edit_GroupNums=0
	Edit_GroupDelNums=0
	Edit_GroupID=Split(Request.Form("groupid"),",")
	Edit_GroupName=Split(Request.Form("groupname"),",")
	Edit_GroupDelID=Split(Request.Form("no"),",")
	For Each Edit_GroupEvery IN Edit_GroupID
	If Not IsInteger(Edit_GroupEvery) Then Edit_GroupEvery=0
		Edit_GroupNums=Edit_GroupNums+1
	Next
	IF Request.Form("no")<>Empty Then
	For Each Edit_GroupDelEvery IN Edit_GroupDelID
		Cn.Execute("DELETE FROM Show5_PhotoSysGroup WHERE GroupID="&Edit_GroupDelEvery&"")
		Edit_GroupDelNums=Edit_GroupDelNums+1
	Next
	End IF
	Dim new_GroupName
	new_GroupName=CheckStr(Request.Form("new_groupname"))
	new_GroupAccess=CheckStr(Request.Form("new_groupaccess"))
	If Request.Form("new_groupname")<>Empty then
    Cn.Execute("INSERT INTO Show5_PhotoSysGroup(Groupname,Photonum) VALUES ('"&new_GroupName&"',0)")
	End IF
    Response.write("<script>alert('相册分类保存成功！点击确认返回');window.location.replace('m_group.asp?type=album');</script>")
elseif request.querystring("type")="article" then
	Edit_GroupNums=0
	Edit_GroupDelNums=0
	Edit_GroupID=Split(Request.Form("groupid"),",")
	Edit_GroupName=Split(Request.Form("groupname"),",")
	Edit_GroupDelID=Split(Request.Form("no"),",")
	For Each Edit_GroupEvery IN Edit_GroupID
	If Not IsInteger(Edit_GroupEvery) Then Edit_GroupEvery=0
	Next
	IF Request.Form("no")<>Empty Then
	For Each Edit_GroupDelEvery IN Edit_GroupDelID
		Cn.Execute("DELETE FROM Show5_ArticleSysgroup WHERE GroupID="&Edit_GroupDelEvery&"")
		Edit_GroupDelNums=Edit_GroupDelNums+1
	Next
	End IF
	new_GroupName=CheckStr(Request.Form("new_groupname"))
	new_GroupAccess=CheckStr(Request.Form("new_groupaccess"))
	If Request.Form("new_groupname")<>Empty then
    Cn.Execute("INSERT INTO Show5_ArticleSysgroup(Groupname,ArticleNum) VALUES ('"&new_GroupName&"',0)")
	End IF
    Response.write("<script>alert('文章分类保存成功！点击确认返回');window.location.replace('m_group.asp?type=article');</script>")
elseif request.querystring("type")="tt" then
	Edit_GroupNums=0
	Edit_GroupDelNums=0
	Edit_GroupID=Split(Request.Form("groupid"),",")
	Edit_GroupName=Split(Request.Form("groupname"),",")
	Edit_GroupDelID=Split(Request.Form("no"),",")
	For Each Edit_GroupEvery IN Edit_GroupID
	If Not IsInteger(Edit_GroupEvery) Then Edit_GroupEvery=0
	Next
	IF Request.Form("no")<>Empty Then
	For Each Edit_GroupDelEvery IN Edit_GroupDelID
		Cn.Execute("DELETE FROM Show5_TTSysgroup WHERE GroupID="&Edit_GroupDelEvery&"")
		Edit_GroupDelNums=Edit_GroupDelNums+1
	Next
	End IF
	new_GroupName=CheckStr(Request.Form("new_groupname"))
	new_GroupAccess=CheckStr(Request.Form("new_groupaccess"))
	If Request.Form("new_groupname")<>Empty then
    Cn.Execute("INSERT INTO Show5_TTSysgroup(Groupname,TTNum) VALUES ('"&new_GroupName&"',0)")
	End IF
    Response.write("<script>alert('拍贴分类保存成功！点击确认返回');window.location.replace('m_group.asp?type=tt');</script>")
elseif request.querystring("type")="video" then
	Edit_GroupNums=0
	Edit_GroupDelNums=0
	Edit_GroupID=Split(Request.Form("groupid"),",")
	Edit_GroupName=Split(Request.Form("groupname"),",")
	Edit_GroupDelID=Split(Request.Form("no"),",")
	For Each Edit_GroupEvery IN Edit_GroupID
	If Not IsInteger(Edit_GroupEvery) Then Edit_GroupEvery=0
	Next
	IF Request.Form("no")<>Empty Then
	For Each Edit_GroupDelEvery IN Edit_GroupDelID
		Cn.Execute("DELETE FROM Show5_VideoSysgroup WHERE GroupID="&Edit_GroupDelEvery&"")
		Edit_GroupDelNums=Edit_GroupDelNums+1
	Next
	End IF
	new_GroupName=CheckStr(Request.Form("new_groupname"))
	new_GroupAccess=CheckStr(Request.Form("new_groupaccess"))
	If Request.Form("new_groupname")<>Empty then
    Cn.Execute("INSERT INTO Show5_VideoSysgroup(Groupname,Videonum) VALUES ('"&new_GroupName&"',0)")
	End IF
    Response.write("<script>alert('视频分类保存成功！点击确认返回');window.location.replace('m_group.asp?type=video');</script>")
end if 
%>