<!--#include file="../fy.Function.asp"-->
<!--#include file="../../fy_inc/fy.Code.asp"-->
<!--#include file="../../Field.asp"-->
<%
	Dim Save_Rs,ClassIDValue,Save_Rs1,Getrootid,Articleadd,EnName,ShowErr,Save_SQL,Save_SQL1,ClassID
	Dim ClassName,Extension,ClassKeywords,ClassDescription,ChangesLinkUrl 
	dim ismenu,tg,classename,ConTentTemplate,sitepath,moresite,siteurl,ACTlink
	Dim TGGroupID,OrderID,FolderTemplate,ModeID,FilePathName,content,makehtmlname,pageTemplate
	dim ClassPurview,ClassArrGroupID,ClassReadPoint,ClassChargeType ,ClassPitchTime,ClassReadTimes,ClassDividePercent
	Dim SEOtitle,ClassPicUrl,labelfor,classmake 
	 ModeID = ChkNumeric(Request("ModeID"))
	 labelfor= ChkNumeric(Request("labelfor"))
	 if ModeID=0 or ModeID="" Then ModeID=1
		If Not fycms.fycms_QXYZ(ModeID,"","") Then   Call fycms.Alert("对不起，您没有"&fycms.ACT_C(ModeID,1)&"系该项操作权限！","")
	ClassPicUrl=Request.Form("ClassPicUrl")
	TGGroupID=Request.Form("TGGroupID")
	ClassID = ChkNumeric(Request("ClassID"))
	SEOtitle=Request.form("SEOtitle")
	OrderID = ChkNumeric(Request.form("OrderID"))
	classmake = ChkNumeric(Request.form("classmake"))
	
	Getrootid = Request.form("rootid")
	ClassName = Trim(Request.Form("ClassName"))
	Extension = Trim(Request.Form("Extension"))
	If Extension<>"" Then Extension="index.html"
	ClassDescription = Request.Form("ClassDescription")
	ClassKeywords = Request.Form("ClassKeywords")
	FolderTemplate = Request.Form("FolderTemplate")
	ChangesLinkUrl = Request.Form("ChangesLinkUrl")
	ismenu = ChkNumeric(Request.Form("ismenu"))
	tg = ChkNumeric(Request.Form("tg"))
	ACTlink = ChkNumeric(Request.Form("ACTlink"))

 
	FolderTemplate = Request.Form("FolderTemplate")
	ConTentTemplate = Request.Form("ConTentTemplate")
	FilePathName = fycms.S("FilePathName")

 
	ClassPurview = ChkNumeric(Request.form("ClassPurview"))
	ClassReadPoint = ChkNumeric(Request.form("ClassReadPoint"))
	ClassChargeType = ChkNumeric(Request.form("ClassChargeType"))
	ClassPitchTime = ChkNumeric(Request.form("ClassPitchTime"))
	ClassReadTimes = ChkNumeric(Request.form("ClassReadTimes"))
	ClassDividePercent = ChkNumeric(Request.form("ClassDividePercent"))
	ClassArrGroupID = Request.form("ClassArrGroupID")
 	content= fycms.S("Content")
	makehtmlname= fycms.S("makehtmlname")
	pageTemplate= fycms.S("pageTemplate")

	If ActLink="2"  Then  makehtmlname=fycms.S("LinkUrl")
 '----------------------------------------------------------
	moresite = ChkNumeric(Request.Form("moresite"))
	siteurl = Request.Form("siteurl")
	sitepath = Request.Form("sitepath")
'----------------------------------------------------------




	Dim IF_NULL
	IF_NULL=fycms.Act_MX_Arr(888,5)

  	If IsArray(IF_NULL) Then
		For I=0 To Ubound(IF_NULL,2)
		 If IF_NULL(8,I)=0  And Trim(fycms.S(IF_NULL(0,I)))<>""  Then  Call fycms.checkValueOnly(ID,ModeID,IF_NULL(0,I),IF_NULL(1,I),IF_NULL(3,I))
 		 If IF_NULL(2,I)=0 And Trim(fycms.S(IF_NULL(0,I)))="" Then  Call  fycms.ALERT(IF_NULL(1,I)&"不能为空","")
		Next
	End If


 
 
 

  	ClassIDValue = fycms.MakeRandom(9)'随机生成15位字符
	Set Save_SQL = server.CreateObject("adodb.recordset")
 	
		Dim TemplateContent,makenames
		Dim MakePage,namearr,i,namearrs
		Set MakePage =New ACT_Code
 
  		Save_SQL1 = "Select * from Class_fy where ClassID="&ClassID &""
 		Save_SQL.Open Save_SQL1,Conn,1,3
		If Not Save_SQL.eof Then 
 		Save_SQL("ClassKeywords") = ClassKeywords
		Save_SQL("ClassDescription") = ClassDescription
		Save_SQL("ismenu") = ismenu
 		Save_SQL("SEOtitle") = SEOtitle
 		Save_SQL("content")=content
		Save_SQL("makehtmlname")=makehtmlname

		Save_SQL("ClassPicUrl")=ClassPicUrl
	

  
 		ModeID=Save_SQL("ModeID") 
  


		If IsArray(IF_NULL) Then
			For I=0 To Ubound(IF_NULL,2)
 					Select Case IF_NULL(3,I)
						Case "NumberType"
 						   If fycms.regexField(fycms.S(IF_NULL(0,I)),"^\d+$")=True Then 
							   Save_SQL("" & IF_NULL(0,I) & "" )= fycms.S(IF_NULL(0,I))
						   End If 
						Case "DateType"
							If IsDate(fycms.S(IF_NULL(0,I)))=False Then 
								Save_SQL("" & IF_NULL(0,I) & "")= Now()
							Else 
								Save_SQL("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
							End If
						Case "PicType"
							If IF_NULL(7,I)="1" Then 
  							   Save_SQL("" & IF_NULL(0,I) & "")=IF_NULL(0,I)
  							 Else 
  									Save_SQL("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
							 End If 
 						
						Case Else 
 							  If IF_NULL(4,I)="2" Then 
										If fycms.regexField(fycms.S(IF_NULL(0,I)),IF_NULL(5,I))=True Then 
											Save_SQL("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
										Else 
											Call fycms.Alert(IF_NULL(6,I),"")
										End If 
								Else 
									Save_SQL("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
								End If 

 					End Select 
 				actField=""
			Next
		End If			


 





		Save_SQL.update
		ShowErr = "栏目保存成功"
	 End If 

 			Application(fycmsN & "fycms_TCJ_Type")= "Folder"
			Application(fycmsN & "classid")=  ClassID
			Application(fycmsN & "modeid")= fycms.ACT_L(ClassID,10)
 			Dim rs
			Set rs=fycms.actexe("Select top 1 * from Class_fy where classid="&classid&" order by id desc")
			If Not rs.eof then
  				TemplateContent = MakePage.CreateArticleList(rs("ModeID"),rs)
  			End If 
 	Application.Contents.RemoveAll
	Save_SQL.close:set Save_SQL = Nothing
	Call fycms.ActErr(ShowErr,"fy_Mode/fy.Class.asp?ModeID="&ModeID&"","")
   %>