<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/conn.asp"-->
<!--#include file="../Include/ConnDatabase.asp"-->
<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方网站http://www.ip126.com
'技术支持论坛 http://bbs.ip126.com/
'QQ:530051328 mail:bbfhq@163.com
'=====================================
%>
<%Response.Charset="utf-8"%>
<%
Call SiteInfo()
if DateDiff("s",session("time"),now())<Refresh then
   response.write "<script language='JavaScript'>alert('防刷新机制启动：请不要在 "&Refresh&" 秒内重复刷新！');" & "history.back()" & "</script>"
   response.end
else
   session("time")=now()
end if
dim rs,sql
dim MesName,Content,SecretFlag,mMemID,mLinkman,mSex,mCompany,mAddress,mZipCode,mTelephone,mFax,mMobile,mEmail,GetCode
MesName=trim(request.form("MesName"))
Content=trim(request.form("Content"))
if trim(request.form("SecretFlag"))="1" then
  SecretFlag=1
else
  SecretFlag=0
end if
mMemID=request.QueryString("MemberID")
mLinkman=trim(request.form("Linkman"))
mSex=trim(request.form("Sex"))
mCompany=trim(request.form("Company"))
mAddress=trim(request.form("Address"))
mZipCode=trim(request.form("ZipCode"))
mTelephone=trim(request.form("Telephone"))
mFax=trim(request.form("Fax"))
mMobile=trim(request.form("Mobile"))
mEmail=trim(request.form("Email"))
GetCode = Trim(request.form("GetCode"))
If Trim(Session("GetCode")) = "" Then
response.write "<script language='javascript'>alert('页面停留的时间过长，导致验证码失效！');location.replace('MessageWrite.Asp');</script>"
End If
set rs = server.createobject("adodb.recordset")
sql="select * from TianTianCMS_Message"
rs.open sql,conn,1,3
rs.addnew
rs("MesName")=StrReplace(MesName)
rs("Content")=StrReplace(Content)
rs("MemID")=mMemID
rs("Linkman")=StrReplace(mLinkman)
rs("Sex")=mSex
rs("Company")=StrReplace(mCompany)
rs("Address")=StrReplace(mAddress)
rs("ZipCode")=StrReplace(mZipCode)
rs("Telephone")=StrReplace(mTelephone)
rs("Fax")=StrReplace(mFax)
rs("Mobile")=StrReplace(mMobile)
rs("Email")=mEmail
rs("SecretFlag")=SecretFlag
If MesViewFlag =True Then
rs("ViewFlag"&Language)=0
Else
rs("ViewFlag"&Language)=1
End If
rs("AddTime")=now()
rs.update
rs.close
set rs=Nothing
Call SiteInfo()
If MesViewFlag = True Then
	response.write "<script language='javascript'>alert('留言成功提交，但系统已被设置为审核可见，请等待管理员审核、回复！');location.replace('MessageList.asp');</script>"
Else
	response.write "<script language='javascript'>alert('留言成功提交，请等待管理员回复！');location.replace('MessageList.asp');</script>"
End If
%>