<!--#include file="../../fy_inc/fy.User.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% 
		Server.ScriptTimeOut=999
		Response.Buffer = True
		Response.Expires = -1
		Response.ExpiresAbsolute = Now() - 1
		Response.CacheControl = "no-cache"
		response.Charset = "gb2312"
		ConnectionDatabase
		Dim Rs1,fycms_BookSetting,Content,Book_Code,url,audit
		Set Rs1=Conn.Execute("Select PlusConfig,IsUse from Plus_fy where PlusID='lyxt_fy'")
		If Rs1("IsUse")=1 Then Call fycms.alert("该系统已经被管理员关闭","")
		fycms_BookSetting=Split(Rs1(0),"^@$@^")
		Dim server_v1,server_v2,rs
		server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
		server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
		content=fycms.HTMLcode(fycms.s("content"))
		if fycms_BookSetting(0)=1 then call fycms.Alert("请不要从外部提交数据.留言功能已经被关闭",""):response.end
		if fycms_BookSetting(2)=0 then audit=1 else audit=0
		if  fycms_BookSetting(3) = 0 Then
		 Book_Code = Request.Form("Code")
			If Book_Code <>CStr(Session("GetCode")) then
				Call fycms.Alert("验证码有误，重新输入","")		
				Response.End
			End if
		End  If
		If Len(Content)>CLng(fycms_BookSetting(5)) and fycms_BookSetting(5)<>0 Then
		 Call  fycms.alert("留言内容内容必须在" &fycms_BookSetting(5) & "个字符以内!","")
		 Response.End
		End if
		if  mid(server_v1,8,len(server_v2))<>server_v2  then
			call fycms.alert("警告！你正在从外部提交数据！！请立即终止！！","")
			response.end
		end if
	 
	 
		if len(fycms.s("qq"))>12 and isnumeric(fycms.s("qq")) then
			call fycms.alert("请输入您的正确QQ,按确定返回上一页","")
			response.end
		End  If
		

		if Request.Form("username") ="" then
			call fycms.alert("请输入姓名,按确定返回上一页","")
			response.end
		End  If
		

		if Content ="" then
			call fycms.alert("请输入内容,按确定返回上一页","")
			response.end
		End  If
		

		If Trim(url)="http://" Then 
			url=""
		Else
			url= server.HTMLEncode(Request.Form("url"))
		End If 
		Dim IF_NULL,i

		IF_NULL=fycms.Act_MX_Arr(999,4)

		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




		set rs=server.CreateObject("adodb.recordset")
		rs.open "Book_fy",conn,3,3
		rs.addnew
		rs("qq")=ChkNumeric(Request.Form("qq"))
		rs("cid")=ChkNumeric(Request.Form("cid"))
		rs("audit")=audit'审核
		rs("content")=replace(server.HTMLEncode(Content),chr(13)&chr(10),"<br>")
		rs("ip")=Request.serverVariables("REMOTE_ADDR")
		rs("addtime")= now

		rs("username")=server.HTMLEncode(Request.Form("username"))




			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 
							   rs("" & IF_NULL(0,I) & "" )= ChkNumeric(fycms.S(IF_NULL(0,I)))
						   End If 
						Case "DateType"
							If IsDate(fycms.S(IF_NULL(0,I)))=False Then 
								rs("" & IF_NULL(0,I) & "")= Now()
							Else 
								rs("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
							End If
						Case "PicType"
							If IF_NULL(7,I)="1" Then
  							   rs("" & IF_NULL(0,I) & "")=IF_NULL(0,I)
  							 Else 
  									rs("" & 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 
											rs("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
										Else 
											Call fycms.Alert(IF_NULL(6,I),"")
										End If 
								Else 
									rs("" & IF_NULL(0,I) & "")=fycms.S(IF_NULL(0,I))
								End If 

 					End Select 
 
					actField=""
 				Next
			End If		














		rs.Update 
		rs.close:set rs =nothing  
		Dim sms
		If  audit=1 then sms="您的留言需要管理员审核才可以看到"
		Call  fycms.alert("留言成功,"&sms&",谢谢支持,按确定返回上一页","")
		response.End 

 %>
