<%'前后台公用调用
	Class ACTM
 
	Public Function ACT_MXEdit(ModeID,ID)'表现方式.输出模型
	 Dim RS
	  Set RS=fycms.ACTEXE("Select * from Table_fy  Where ModeID=" & ModeID & " and fycms=2    order by OrderID desc,ID Desc")
	  	Do While Not RS.Eof
 			ACT_MXEdit=ACT_MXEdit &"<dl><dt>"&RS("Title")&"：</dt>"&vbCrLf&"<dd>"&EditField(RS,ModeID,ID)&"</dd></dl>"&vbCrLf
		RS.MoveNext
		Loop
	  RS.Close:Set RS=Nothing
 	End function


 
 



	Function EditField(RSObj,ModeID,UserID)
		Dim i,IsNotNull,TitleTypeArr,checked,rs1,FieldName,arrtitle,titles,arrvalue
	  Set RS1=fycms.ACTEXE("Select * from "&fycms.ACT_U(ModeID,2)&"  Where UserID="&UserID&"")
  	  If rs1.eof Then 
		  fycms.ACTEXE("insert Into "&fycms.ACT_U(ModeID,2)&"(UserID) values("&UserID&")")
		  Set RS1=fycms.ACTEXE("Select * from "&fycms.ACT_U(ModeID,2)&"  Where UserID="&UserID&"")
	  End if
	  Set RS1=fycms.ACTEXE("Select * from "&fycms.ACT_U(ModeID,2)&"  Where UserID="&UserID&"")
 		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 class=""ainput"" 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=EditField&writeeditor(0,""&RSObj("FieldName")&"",""&RSObj("FieldName")&"","",RS1(FieldName))
		   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)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 

					If RS1(FieldName)=arrvalue Then checked="selected" Else checked=""
					EditField = EditField & "<option value='" & arrvalue & "' "&checked&">" & titles & "</option>"& vbCrLf
				  Next
					EditField= EditField&" </select>"&IsNotNull& vbCrLf 
				Else
				  For I = 0 To UBound(TitleTypeArr)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					
					
					If RS1(FieldName)=arrvalue Then checked="checked" Else checked=""
					EditField = EditField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""radio""  name="""&RSObj("FieldName")&""" value="""&arrvalue&""" "&checked&" />"&titles&"&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)
				
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					If fycms.FoundInArr(RS1(FieldName),arrvalue,",")=true Then checked="checked" Else checked=""
					EditField = EditField &"<label for="""&RSObj("FieldName")&i&"""> <input  id="""&RSObj("FieldName")&i&""" type=""checkbox""  name="""&RSObj("FieldName")&""" value="""&arrvalue&""" "&checked&" />"&titles&"&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)
					arrtitle=Split(TitleTypeArr(I),"-")
					If  UBound(arrtitle)="1" Then 
						titles=arrtitle(0)
						arrvalue=arrtitle(1)
					ElseIf  TitleTypeArr(I)<>"" Then 
					titles=arrtitle(0)
					arrvalue=arrtitle(0)
					Else
						Exit for
					End If 
					If fycms.FoundInArr(RS1(FieldName),arrvalue,",")=true Then checked="selected" Else checked=""
					EditField = EditField & "<option value=""" & arrvalue & """ "&checked&">" & vbCrLf& titles & "</option>"& vbCrLf
				  Next
					EditField= EditField&" </select>"&IsNotNull
				End If 
		   Case "DateType"
				EditField= EditField&"<input class=""ainput"" name="""&RSObj("FieldName")&""" type=""text"" id="""&RSObj("FieldName")&""" value="""&RS1(FieldName)&""" onClick=""WdatePicker();""  >"&IsNotNull
		   Case "PicType"
 					
						EditField= "<input t class=""Ainput""  name="""&RSObj("FieldName")&""" type=""text"" id="""&RSObj("FieldName")&""" value="""&RS1(FieldName)&""" size=""50"">"&IsNotNull
					 	
						EditField=EditField&"<input id=""PicUrls"&RSObj("FieldName")&""" class=""btn "" onClick=""javascript:tdialog(777,'"&fycms.actsys&fycms.adminurl&"/include/Upload_Admin.asp?ModeID=777&instr=1&instrname="&RSObj("FieldName")&"&YNContent=1&file=yes&amp;instrct=content');"" name=""button"" type=""button""   value=""点击上传文件"">"&IsNotNull
				 
 		   Case "FileType"
				EditField= "<input  name="""&RSObj("FieldName")&""" type=""text""  value="""&RS1(FieldName)&""" size=""40""><iframe src=""../Upload_Admin.asp?ModeID=1&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  class=""ainput"" type=""text"" name="""&RSObj("FieldName")&""" size="""&RSObj("width")&""" value="""&RS1(FieldName)&""">"&IsNotNull
		   Case "RadomType"
				EditField= "<input  class=""ainput""  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 







 End Class 
	Dim U_M
	Set U_M = New ACTM
%>