<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If len(Request.Form ("truename"))<2 or RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Request.Form ("truename")) Then
	ef=True
	ec="请提供准确的姓名！"
elseif IsValidEmail(Request.Form ("email"))=false then
	ef=True
	ec="请提供准确的Email地址！"
elseIf RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Request.Form ("prv")) Then
	ef=True
	ec="请提供准确的省！"
elseIf RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Request.Form ("city")) Then
	ef=True
	ec="请提供准确的城市！"
ElseIf Request.Form ("address")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Request.Form ("address")) Then
	ef=True
	ec="地址不对！"
ElseIf Request.Form ("postid")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("postid")) Then
	ef=True
	ec="postid只能是字母与数字！"
ElseIf len(Request.Form ("tel"))<5 Then
	ef=True
	ec="请提供准确的电话号码！"
ElseIf Request.Form ("tel")<>"" and RegExpTest("[^A-Za-z0-9\-]",Request.Form ("tel")) Then
	ef=True
	ec="电话只能是字母与数字！"
ElseIf Request.Form ("qq")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("qq")) Then
	ef=True
	ec="QQ只能是字母与数字！"
ElseIf Request.Form ("fax")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("fax")) Then
	ef=True
	ec="fax只能是字母与数字！"
ElseIf Request.Form ("perid")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("perid")) Then
	ef=True
	ec="证件只能是字母与数字！"
ElseIf Request.Form ("userremindinfo")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("userremindinfo")," ","")) Then
	ef=True
	ec="补充信息不能有特殊字符！"
ElseIf Request.Form ("Hosttype")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("Hosttype")," ","")) Then
	ef=True
	ec="Hosttype不能有特殊字符！"
ElseIf Request.Form ("emailtype")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("emailtype")," ","")) Then
	ef=True
	ec="emailtype不能有特殊字符！"
ElseIf Request.Form ("sqltype")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("sqltype")," ","")) Then
	ef=True
	ec="sqltype不能有特殊字符！"
ElseIf Request.Form ("idctype")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("idctype")," ","")) Then
	ef=True
	ec="idctype不能有特殊字符！"
ElseIf Request.Form ("VPStype")<>"" and RegExpTest("[^A-Za-z0-9\u4e00-\u9fa5]",Replace(Request.Form ("VPStype")," ","")) Then
	ef=True
	ec="VPStype不能有特殊字符！"
ElseIf Clng(session("ordermoney"))<>cLng(Request.Form ("usermoney")) or Request.Form ("ordermoney")<0 Then
	ef=True
	ec="金额不正确！"
ElseIf not IsNumeric(Request.Form("id"))  Then
	ef=True
	ec="ID应该是数字！"
ElseIf not IsNumeric(Request.Form("year"))  Then
	ef=True
	ec="year应该是数字！"


ElseIf Request.Form ("Ftpname")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("Ftpname")) Then
	ef=True
	ec="FTP用户名只能是字母与数字！"
ElseIf Request.Form ("Ftppassword")<>"" and RegExpTest("[^A-Za-z0-9]",Request.Form ("Ftppassword")) Then
	ef=True
	ec="FTP密码只能是字母与数字！"

ElseIf Request.Form ("hostname")<>"" and RegExpTest("[^A-Za-z0-9.]",Request.Form ("hostname")) Then
	ef=True
	ec="hostname只能是字母与数字！"
ElseIf Request.Form ("ICP_SN")<>"" and RegExpTest("[^A-Za-z0-9\-\u4e00-\u9fa5]",Request.Form ("ICP_SN")) Then
	ef=True
	ec="ICP_SN只能是字母与数字！"

ElseIf not IsNumeric(Request.Form("ServerlistID"))  Then
	ef=True
	ec="ServerlistID应该是数字！"

ElseIf Request.Form ("Vcode")<>session("Vcode") or session("Vcode")="" Then
	ef=True
	ec="验证码不正确！"
end if

If not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsreg = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Order where id=1"
		dsreg.Open Sql,conn,1,3
dsreg.AddNew
dsreg("username")=session("username")
dsreg("email")=Request.Form ("email")
dsreg("truename")=Request.Form ("truename")
dsreg("prv")=Request.Form ("prv")
dsreg("city")=Request.Form ("city")
dsreg("address")=Request.Form ("address")
dsreg("postid")=Request.Form ("postid")
dsreg("tel")=Request.Form ("tel")
dsreg("qq")=Request.Form ("qq")
dsreg("fax")=Request.Form ("fax")
dsreg("perid")=Request.Form ("perid")

dsreg("starttime")=NOW
dsreg("regip")=Request.ServerVariables("REMOTE_ADDR")
dsreg("site")=Request.ServerVariables("SERVER_NAME")

dsreg("userremindinfo")=Request.Form ("userremindinfo")
dsreg("Hosttype")=Request.Form ("Hosttype")
dsreg("emailtype")=Request.Form ("emailtype")
dsreg("sqltype")=Request.Form ("sqltype")
dsreg("othertype")=Request.Form ("othertype")
dsreg("idctype")=Request.Form ("idctype")
dsreg("VPStype")=Request.Form ("VPStype")

dsreg("status")="未处理"
dsreg("usermoney")=Request.Form ("usermoney")
dsreg("Realid")=Request.Form ("id")
dsreg("year")=Request.Form ("year")

dsreg("ftpname")=Request.Form ("ftpname")
dsreg("Ftppassword")=Request.Form ("Ftppassword")

dsreg("hostname")=Request.Form ("hostname")
dsreg("ICP_SN")=Request.Form ("ICP_SN")
dsreg("ServerlistID")=Request.Form ("ServerlistID")


if session("agentname")="" then
dsreg("agent1")="n"
else
dsreg("agent1")=session("agentname")
end if
dsreg("agent2")="n"
If session("agentusername")<>"" Then dsreg("agent1")=session("agentusername") 
dsreg.Update
dsreg.Close

set dsreg=nothing
conn.Close
set conn=nothing
end if

If not ef then
Application("noticemesg")=Application("noticemesg")&"　您有新的订单。"
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
　返回信息
<%=htmlwrite("html3")%>
<br>
<br>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="100" align="center" bgcolor="#FFFFFF">您的订单已成功提交，请您耐心等待工作人员联系您。<br>
    <br>
    <a href="/style/info/contact.asp">您也可以马上联系工作人员，我们会热诚为您提供服务&gt;&gt;&gt;</a>
    
  </tr>
</table>
<%=htmlwrite("html4")%><%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if
%>
