<%'前后台公用调用
	Class ACTM

	Public Function ACT_MXList(ModeID)'表现方式.输出模型
	  Dim RSObj
	  ACT_MXList=ACT_MXList & "<script type='text/javascript' src='" &ACTCMS.ActSys&"ACT_INC/WebTime/WdatePicker.js'></script>"
	  Set RSObj=ACTCMS.ACTEXE("Select * from Table_ACT  Where ModeID=" & ModeID & " and ISType =1  order by OrderID asc,ID Desc")
	  	Do While Not RSObj.Eof
			ACT_MXList=ACT_MXList &"<tr><td  align=""right"">"&RSObj("Title")&"：</td><td>"&ListField(RSObj,RSObj("id"))&"</td></tr>"
		RSObj.MoveNext
		Loop
	  RSObj.Close:Set RSObj=Nothing
	  response.write ACT_MXList
	End function



	Public Function ACT_MXEdit(ModeID,ID)'表现方式.输出模型
	  Dim RS
	  ACT_MXEdit=ACT_MXEdit & "<script type='text/javascript' src='" &ACTCMS.ActSys&"ACT_INC/WebTime/WdatePicker.js'></script>"
	  Set RS=ACTCMS.ACTEXE("Select * from Table_ACT  Where ModeID=" & ModeID & " and ISType = 1 order by OrderID asc,ID Desc")
	  	Do While Not RS.Eof
			ACT_MXEdit=ACT_MXEdit &"<tr><td  align=""right"">"&RS("Title")&"：</td><td>"&EditField(RS,ModeID,ID)&"</td></tr>"
		RS.MoveNext
		Loop
	  RS.Close:Set RS=Nothing
	  response.write ACT_MXEdit
	End function




	Function EditField(RSObj,ModeID,id)
		Dim i , TitleTypeArr,checked,rs1,FieldName,IsNotNull
	  Set RS1=ACTCMS.ACTEXE("Select * from "&ACTCMS.ACT_C(ModeID,2)&"  Where id="&id&"")
		If rsobj("IsNotNull")="0" Then 
			IsNotNull="  <font color=red title=""必填"">*</font>  "&rsobj("Description")
		Else
			IsNotNull="  "&rsobj("Description")
		End If 
	  FieldName= RSObj("FieldName")
		 Select Case RSObj("FieldType")
		   Case "TextType"
				EditField= "<input title="""&RSObj("Description")&""" type=""text"" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RS1(FieldName)&""">"&IsNotNull& vbCrLf 
		   Case "MultipleTextType"
				EditField= "<textarea title="""&RSObj("Description")&""" name="""&RSObj("FieldName")&""" style=""height:"&RSObj("height")&"px;width:"&RSObj("width")&"px;"">"&RS1(FieldName)&"</textarea>"&IsNotNull& vbCrLf 
		   Case "MultipleHtmlType"
				EditField="<textarea rows=""1"" cols=""1"" name="""&RSObj("FieldName")&""" id="""&RSObj("FieldName")&""" style=""display:none;"">"&RS1(FieldName)&"</textarea>"& vbCrLf & _
				"<script type=""text/javascript"" language=""JavaScript"">"& vbCrLf & _
				"{"& vbCrLf & _
				"var sBasePath = """&Actcms.ActSys&"editor/fckeditor/"""& vbCrLf & _
				"var oFCKeditor = new FCKeditor('"&RSObj("FieldName")&"');"& vbCrLf & _
				"oFCKeditor.BasePath = sBasePath;"& vbCrLf & _
				"oFCKeditor.ToolbarSet = '"&RSObj("Content")&"';"& vbCrLf & _
				"oFCKeditor.Width = '"&RSObj("width")&"px';"& vbCrLf & _
				"oFCKeditor.Height = '"&RSObj("height")&"px' ;"& vbCrLf & _
				"oFCKeditor.ReplaceTextarea() ;"& vbCrLf & _
				"}"& vbCrLf & _
				"</script>"
		   Case "RadioType"
				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  EditField= EditField&"<select  name="""&RSObj("FieldName")&""">"
				  For I = 0 To UBound(TitleTypeArr)
					If RS1(FieldName)=TitleTypeArr(I) Then checked="selected" Else checked=""
					EditField = EditField & "<option value='" & TitleTypeArr(I) & "' "&checked&">" & TitleTypeArr(I) & "</option>"& vbCrLf
				  Next
					EditField= EditField&" </select>"&IsNotNull
				Else
				  For I = 0 To UBound(TitleTypeArr)
					If RS1(FieldName)=TitleTypeArr(I) Then checked="checked" Else checked=""
					EditField = EditField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""radio""  name="""&RSObj("FieldName")&""" value="""&TitleTypeArr(I)&""" "&checked&" />"&TitleTypeArr(I)&"&nbsp;&nbsp;</label>"& vbCrLf
				  Next
					EditField = EditField&IsNotNull
				End If 
		   Case "ListBoxType"
				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  For I = 0 To UBound(TitleTypeArr)
					If ACTCMS.FoundInArr(RS1(FieldName),TitleTypeArr(I),",")=true Then checked="checked" Else checked=""
					 EditField = EditField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""checkbox""  name="""&RSObj("FieldName")&""" value="""&TitleTypeArr(I)&""" "&checked&" />"&TitleTypeArr(I)&"&nbsp;&nbsp;</label>"& vbCrLf
				  Next
					 EditField = EditField&IsNotNull
				Else
				    EditField= EditField&"<select  size=""4""   style=""width:300px;height:126px""  name="""&RSObj("FieldName")&""" multiple>"
				  For I = 0 To UBound(TitleTypeArr)
					If ACTCMS.FoundInArr(RS1(FieldName),TitleTypeArr(I),",")=true Then checked="selected" Else checked=""
					EditField = EditField & "<option value=""" & TitleTypeArr(I) & """ "&checked&">" & vbCrLf& TitleTypeArr(I) & "</option>"& vbCrLf
				  Next
					EditField= EditField&" </select>"&IsNotNull
				End If 
		   Case "DateType"
				EditField= EditField&"<input name="""&RSObj("FieldName")&""" type=""text"" id="""&RSObj("FieldName")&""" value="&RS1(FieldName)&" onfocus='WdatePicker()' >"&IsNotNull
		   Case "PicType"
				EditField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""&RS1(FieldName)&""" size=""40""><iframe src=""../User/Upload_user.asp?ModeID="&RSObj("ModeID")&"&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&amp;instrct=content"" name=""image"" width='75%' height=""25"" scrolling=""No"" frameborder=""0"" id=""image""></iframe>"&IsNotNull
		   Case "FileType"
				EditField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""&RS1(FieldName)&""" size=""40""><iframe src=""../User/Upload_user.asp?ModeID="&RSObj("ModeID")&"&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&file=yes&amp;instrct=content"" name=""image"" width='75%' height=""25"" scrolling=""No"" frameborder=""0"" id=""image""></iframe>"&IsNotNull
		   Case "NumberType"
				EditField= "<input type=""text"" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RS1(FieldName)&""">"&IsNotNull
		   Case "RadomType"
				EditField= "<input type=""text"" name="""&RSObj("FieldName")&""" size=""25""  value="""&RS1(FieldName)&""">"&IsNotNull
		   Case else
				EditField= "<font color=red>该字段错误</font>"
		   End Select 
	  RS1.Close:Set RS1=Nothing
	End Function 

	Function ListField(RSObj,id)
		Dim i , TitleTypeArr,checked,IsNotNull
		If rsobj("IsNotNull")="0" Then 
			IsNotNull="  <font color=red title=""必填"">*</font>  "&rsobj("Description")
		Else
			IsNotNull="  "&rsobj("Description")
		End If 
		 Select Case RSObj("FieldType")
		   Case "TextType"
				ListField= "<input type=""text"" title="""&RSObj("Description")&""" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RSObj("Type_Default")&""">"&IsNotNull
		   Case "MultipleTextType"
				ListField= "<textarea title="""&RSObj("Description")&""" name="""&RSObj("FieldName")&""" style=""height:"&RSObj("height")&"px;width:"&RSObj("width")&"px;"">"&RSObj("Type_Default")&"</textarea>"&IsNotNull
		   Case "MultipleHtmlType"
				ListField="<textarea rows=""1"" cols=""1"" name="""&RSObj("FieldName")&""" id="""&RSObj("FieldName")&""" style=""display:none;"">"&RSObj("Type_Default")&"</textarea>"& vbCrLf & _
				"<script type=""text/javascript"" language=""JavaScript"">"& vbCrLf & _
				"{"& vbCrLf & _
				"var sBasePath = """&Actcms.ActSys&"editor/fckeditor/"""& vbCrLf & _
				"var oFCKeditor = new FCKeditor('"&RSObj("FieldName")&"');"& vbCrLf & _
				"oFCKeditor.BasePath = sBasePath;"& vbCrLf & _
				"oFCKeditor.ToolbarSet = '"&RSObj("Content")&"';"& vbCrLf & _
				"oFCKeditor.Width = '"&RSObj("width")&"px';"& vbCrLf & _
				"oFCKeditor.Height = '"&RSObj("height")&"px' ;"& vbCrLf & _
				"oFCKeditor.ReplaceTextarea() ;"& vbCrLf & _
				"}"& vbCrLf & _
				"</script>"
		   Case "RadioType"
				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  ListField= ListField&"<select  name="""&RSObj("FieldName")&""">"
				  For I = 0 To UBound(TitleTypeArr)
					If RSObj("Type_Default")=TitleTypeArr(I) Then checked="selected" Else checked=""
					ListField = ListField & "<option value='" & TitleTypeArr(I) & "' "&checked&">" & TitleTypeArr(I) & "</option>"& vbCrLf
				  Next
					ListField= ListField&" </select>"&IsNotNull
				Else
				  For I = 0 To UBound(TitleTypeArr)
					If RSObj("Type_Default")=TitleTypeArr(I) Then checked="checked" Else checked=""
					ListField = ListField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""radio""  name="""&RSObj("FieldName")&""" value="""&TitleTypeArr(I)&""" "&checked&" />"&TitleTypeArr(I)&"&nbsp;&nbsp;</label>"& vbCrLf
				  Next
					ListField = ListField&IsNotNull
				End If 
		   Case "ListBoxType"
				TitleTypeArr=Split(RSObj("Content"), vbCrLf)
				If RSObj("Type_Type")=0 Then 
				  For I = 0 To UBound(TitleTypeArr)
					If RSObj("Type_Default")=TitleTypeArr(I) Then checked="checked" Else checked=""
					ListField = ListField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""checkbox""  name="""&RSObj("FieldName")&""" value="""&TitleTypeArr(I)&""" "&checked&" />"&TitleTypeArr(I)&"&nbsp;&nbsp;</label>"& vbCrLf
				  Next
				    ListField = ListField&IsNotNull
				Else
				  ListField= ListField&"<select  size=""4""   style=""width:300px;height:126px""  name="""&RSObj("FieldName")&""" multiple>"
				  For I = 0 To UBound(TitleTypeArr)
					If RSObj("Type_Default")=TitleTypeArr(I) Then checked="checked" Else checked=""
					ListField = ListField & "<option value=""" & TitleTypeArr(I) & """ "&checked&">" & vbCrLf& TitleTypeArr(I) & "</option>"& vbCrLf
				  Next
					ListField= ListField&" </select>"&IsNotNull
				End If 
		   Case "DateType"
				ListField= ListField&"<input name="""&RSObj("FieldName")&""" type=""text"" id="""&RSObj("FieldName")&""" value="""" onfocus='WdatePicker()' >"&IsNotNull
		   Case "PicType"
				ListField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""" size=""40""><iframe src=""../User/Upload_user.asp?ModeID="&RSObj("ModeID")&"&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&amp;instrct=content"" name=""image"" width='75%' height=""25"" scrolling=""No"" frameborder=""0"" id=""image""></iframe>"&IsNotNull
		   Case "FileType"
				ListField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""" size=""40""><iframe src=""../User/Upload_user.asp?ModeID="&RSObj("ModeID")&"&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&file=yes&amp;instrct=content"" name=""image"" width='75%' height=""25"" scrolling=""No"" frameborder=""0"" id=""image""></iframe>"&IsNotNull
		   Case "NumberType"
				ListField= "<input type=""text"" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RSObj("Type_Default")&""">"&IsNotNull
		   Case "RadomType"
				ListField= "<input type=""text"" name="""&RSObj("FieldName")&""" size=""25""  value="""&ACTCMS.MakeRandom(20)&""">"&IsNotNull
		   Case else
				ListField= "<font color=red>该字段错误</font>"
		   End Select 
	End Function 

End Class 
	Dim M
	Set M = New ACTM
%>