<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%if session("username")="" And session("agentusername")="" and (session("admau")="" and session("DomainNameModid")="") then
session("login_tar")=Request.ServerVariables("URL")
session("login_form")=request.form
session("login_QueryString")=request.QueryString
session("selectedDomainName")=request.form("selectedDomainName")
server.Transfer "/user/default.asp"
end if
fcon=Cstr(request.form("selectedDomainName"))
if fcon="" then
fcon=Cstr(session("selectedDomainName"))
end if
domain=fcon
session("selectedDomainName")=fcon

'session("selectedDomainName")="7i24.com"

if session("selectedDomainName")="" then Response.Redirect "e.asp?e=注册信息已失效，请重新查询域名。"

Dim enc
Enddomaintypeid=GetDomaintype(session("selectedDomainName"))


Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set RsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist where id="&Enddomaintypeid
		RsDlist.Open Sql,conn,1,1
if not RsDlist.eof then
if RsDlist("regapi")<>5 And Application("usercanselectapi")=false then
if RsDlist("regapi")=1 then server.Transfer "api1domainform.asp"
if RsDlist("regapi")=2 then server.Transfer "xindomainform.asp"
if RsDlist("regapi")=3 then server.Transfer "actionbiz2.asp"
if RsDlist("regapi")=4 then server.Transfer "actionch2.asp"
if RsDlist("regapi")=5 then server.Transfer "netdomainform.asp"
if RsDlist("regapi")=6 then server.Transfer "/style/info/plugin/1/ZZJZdomainform.asp"
end If

If Application("usercanselectapi")=true Then
If Application("api1")=True And request.form("usercanselectapi")=1 Then server.Transfer "api1domainform.asp"
If Application("api2")=True And request.form("usercanselectapi")=2 Then server.Transfer "xindomainform.asp"
If Application("api3")=True And request.form("usercanselectapi")=3 Then server.Transfer "actionbiz2.asp"
If Application("api4")=True And request.form("usercanselectapi")=4 Then server.Transfer "actionch2.asp"
'If Application("api5")=True And request.form("usercanselectapi")=5 Then server.Transfer "netdomainform.asp"
If Application("api6")=True And request.form("usercanselectapi")=6 Then server.Transfer "/style/info/plugin/1/ZZJZdomainform.asp"
End if


end if
'ds.close
'set ds=nothing
'conn.close
'set conn=nothing

if session("agentusername")<>"" Then%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
<%else%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
<%End if%>
　 域名注册
<%if session("agentusername")<>"" Then%>
<%=htmlwrite("html6")%>
<%else%>
<%=htmlwrite("html3")%>
<%End if%>

<%
if Request.QueryString ("id")<>"" and IsNumeric(Request("id"))  Then
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain where username='"&session("username")&"' and id='"&Request("id")&"'"
if session("agentusername")<>"" then sql="Select * from FreeHost.FreeHost_Product_Domain where agent1='"&session("agentusername")&"' and id='"&Request("id")&"'"
if session("admau")<>"" then sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&Request("id")&"'"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsdom.Open sql,conn,1,1
if dsdom.eof then
	ef=True
	ec="不存在的域名！"
end if

if not ef then
if dsdom("Domain_API")<>5 then
Response.Redirect "e.asp?e=此域名接口不是新网的，不能修改"
end if
end if
else'新注册检查模板中是否有
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain where username='"&session("username")&"' and Domain_API='5' and istemplate='y' order by id desc"
if session("agentusername")<>"" then sql="Select * from FreeHost.FreeHost_Product_Domain where username='"&session("agentusername")&"' and Domain_API='5' and istemplate='y' order by id desc"
	dsdom.Open sql,conn,1,1
if dsdom.eof then
	ef=True
	ec="不存在模板！"
end if
end if'是修改原有的

if not ef then
NameServer1=dsdom("NameServer1")
NameServer2=dsdom("NameServer2")
strCompanyCN=dsdom("strCompanyCN")
strCompanyEN=dsdom("strCompanyEN")
strAddressCN=dsdom("strAddressCN")
strAddressEN=dsdom("strAddressEN")
strCityCN=dsdom("strCityCN")
strCityEN=dsdom("strCityEN")
strProvince=dsdom("strProvince")
strPostcode=dsdom("strPostcode")
strNameCN=dsdom("strNameCN")
strNameEN=dsdom("strNameEN")
intPhoneAreaCode=dsdom("intPhoneAreaCode")
intPhoneNumber=dsdom("intPhoneNumber")
intFaxAreaCode=dsdom("intFaxAreaCode")
intFaxNumber=dsdom("intFaxNumber")
strEmail=dsdom("strEmail")
strTrade=dsdom("strTrade")
strManager=dsdom("strManager")
years=dsdom("years")
end if


If strAddressCN = "" Then strAddressCN = "海淀区清华科技园科技大厦A座20层"
If strAddressEN = "" Then strAddressEN = "Star Street"
If strCityCN = "" Then strCityCN = "广州"
If strCityEN = "" Then strCityEN = "GuangZhou"
If intPhoneAreaCode="" Then intPhoneAreaCode="513"
If intFaxAreaCode="" Then intFaxAreaCode="513"
If intPhoneNumber=""	Then intPhoneNumber="88888888"

if (Enddomaintypeid=9 or Enddomaintypeid=4 or Enddomaintypeid=5) and years="" then years="2"
if Application("onlyone")=true and Request.Form ("period")>1 and not (Enddomaintypeid=9 or Enddomaintypeid=4 or Enddomaintypeid=5) then years=1
%>
<table border="0" cellpadding="5" cellspacing="0">
	  <tr>
		<td valign="top">
		
	<FORM METHOD=POST ACTION="netdomainform2.asp" name="regform">
	域名：
	  <INPUT TYPE="text" id=txt1 NAME="strDomainName" value="<%=session("selectedDomainName")%>" readonly="true">
	<br>
	年限：<select name='intPeriod'>
<option value='1' <%if years="1" then%>selected<%end if%>>1</option>
<option value='2' <%if years="2" then%>selected<%end if%>>2</option>
<option value='3' <%if years="3" then%>selected<%end if%>>3</option>
<option value='4' <%if years="4" then%>selected<%end if%>>4</option>
<option value='5' <%if years="5" then%>selected<%end if%>>5</option>
</select>
	注:只能填写数字 

<%
regapi=5
agentname=session("agentname")
	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&agentname&"' and id="&RsDlist("id")
		dsendmoney.Open Sql,conn,1,1
if not dsendmoney.eof then
UserpaymoneyEnd1=dsendmoney("usermoney")
UserpaymoneyEnd2=dsendmoney("year2")
UserpaymoneyEnd3=dsendmoney("year3")
UserpaymoneyEnd4=dsendmoney("year4")
UserpaymoneyEnd5=dsendmoney("year5")
if Application("domaincansetM")=true Then
If Not IsNull(dsendmoney("usermoney"&"API"&regapi)) Then UserpaymoneyEnd1=dsendmoney("usermoney"&"API"&regapi)
if Not IsNull(dsendmoney("year2"&"API"&regapi)) then UserpaymoneyEnd2=dsendmoney("year2"&"API"&regapi)
if Not IsNull(dsendmoney("year3"&"API"&regapi)) then UserpaymoneyEnd3=dsendmoney("year3"&"API"&regapi)
if Not IsNull(dsendmoney("year4"&"API"&regapi)) then UserpaymoneyEnd4=dsendmoney("year4"&"API"&regapi)
if Not IsNull(dsendmoney("year5"&"API"&regapi)) then UserpaymoneyEnd5=dsendmoney("year5"&"API"&regapi)
End if
else
UserpaymoneyEnd1=RsDlist("usermoney")
UserpaymoneyEnd2=RsDlist("year2")
UserpaymoneyEnd3=RsDlist("year3")
UserpaymoneyEnd4=RsDlist("year4")
UserpaymoneyEnd5=RsDlist("year5")
if Application("domaincansetM")=true Then
If Not IsNull(RsDlist("usermoney"&"API"&regapi)) Then UserpaymoneyEnd1=RsDlist("usermoney"&"API"&regapi)
if Not IsNull(RsDlist("year2"&"API"&regapi)) then UserpaymoneyEnd2=RsDlist("year2"&"API"&regapi)
if Not IsNull(RsDlist("year3"&"API"&regapi)) then UserpaymoneyEnd3=RsDlist("year3"&"API"&regapi)
if Not IsNull(RsDlist("year4"&"API"&regapi)) then UserpaymoneyEnd4=RsDlist("year4"&"API"&regapi)
if Not IsNull(RsDlist("year5"&"API"&regapi)) then UserpaymoneyEnd5=RsDlist("year5"&"API"&regapi)
end if
end if
dsendmoney.close
if session("AgnRunasUser")=True Then
	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&agentname&"' and id="&RsDlist("id")
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
myrealcost1=RsDlist("usermoneyagn")'不用折扣算
myrealcost2=RsDlist("year2agn")
myrealcost3=RsDlist("year3agn")
myrealcost4=RsDlist("year4agn")
myrealcost5=RsDlist("year5agn")

if Application("domaincansetM")=true Then
If Not isNull(RsDlist("usermoneyagn"&"API"&regapi)) Then myrealcost1=RsDlist("usermoneyagn"&"API"&regapi)'不用折扣算
if Not IsNull(RsDlist("year2agn"&"API"&regapi)) then myrealcost2=RsDlist("year2agn"&"API"&regapi)
if Not IsNull(RsDlist("year3agn"&"API"&regapi)) then myrealcost3=RsDlist("year3agn"&"API"&regapi)
if Not IsNull(RsDlist("year4agn"&"API"&regapi)) then myrealcost4=RsDlist("year4agn"&"API"&regapi)
if Not IsNull(RsDlist("year5agn"&"API"&regapi)) then myrealcost5=RsDlist("year5agn"&"API"&regapi)
End if

else
myrealcost1=dsagnpri("usermoney")
If IsNull(dsagnpri("usermoney")) Then myrealcost1=RsDlist("usermoneyagn")
myrealcost2=dsagnpri("year2")
If IsNull(dsagnpri("year2")) Then myrealcost2=RsDlist("year2agn")
myrealcost3=dsagnpri("year3")
If IsNull(dsagnpri("year3")) Then myrealcost3=RsDlist("year3agn")
myrealcost4=dsagnpri("year4")
If IsNull(dsagnpri("year4")) Then myrealcost4=RsDlist("year4agn")
myrealcost5=dsagnpri("year5")
If IsNull(dsagnpri("year5")) Then myrealcost5=RsDlist("year5agn")

if Application("domaincansetM")=true Then
If Not isNull(RsDlist("usermoneyagn"&"API"&regapi)) Then myrealcost1=RsDlist("usermoneyagn"&"API"&regapi)
if Not IsNull(RsDlist("year2agn"&"API"&regapi)) then myrealcost2=RsDlist("year2agn"&"API"&regapi)
if Not IsNull(RsDlist("year3agn"&"API"&regapi)) then myrealcost3=RsDlist("year3agn"&"API"&regapi)
if Not IsNull(RsDlist("year4agn"&"API"&regapi)) then myrealcost4=RsDlist("year4agn"&"API"&regapi)
if Not IsNull(RsDlist("year5agn"&"API"&regapi)) then myrealcost5=RsDlist("year5agn"&"API"&regapi)

If Not isNull(dsagnpri("usermoney"&"API"&regapi)) Then myrealcost1=dsagnpri("usermoney"&"API"&regapi)
if Not IsNull(dsagnpri("year2"&"API"&regapi)) then myrealcost2=dsagnpri("year2"&"API"&regapi)
if Not IsNull(dsagnpri("year3"&"API"&regapi)) then myrealcost3=dsagnpri("year3"&"API"&regapi)
if Not IsNull(dsagnpri("year4"&"API"&regapi)) then myrealcost4=dsagnpri("year4"&"API"&regapi)
if Not IsNull(dsagnpri("year5"&"API"&regapi)) then myrealcost5=dsagnpri("year5"&"API"&regapi)
End if

end if
dsagnpri.close
end if

%>价格：<%=UserpaymoneyEnd1%>元/1年 <%=UserpaymoneyEnd2%>元/2年 <%=UserpaymoneyEnd3%>元/3年 <%=UserpaymoneyEnd4%>元/4年 <%=UserpaymoneyEnd5%>元/5年
<%if session("AgnRunasUser")=True then%><font color=red>(代理成本价：<%=myrealcost1%>元/1年 <%=myrealcost2%>元/2年 <%=myrealcost3%>元/3年 <%=myrealcost4%>元/4年 <%=myrealcost5%>元/5年)</font><%End if%>	

	<br>
域名解析服务器1：<INPUT TYPE="text" NAME="NameServer1" value="<%if Application("DNS_API")=1 then%><%=Application("DNS1")%><%else%>dns7.hichina.com<%end if%>"><br>
	域名解析服务器2：<INPUT TYPE="text" NAME="NameServer2" value="<%if Application("DNS_API")=1 then%><%=Application("DNS2")%><%else%>dns8.hichina.com<%end if%>">

	<hr>
	<b>注册人信息</b>(<font color="#FF0000">请严格按照示例格式填写，否则注册难以成功</font>)<br>
	单位名称中文：<INPUT TYPE="text" NAME="strCompanyCN" value="<%=strCompanyCN%>">
	如：XX公司<br>
	单位名称英文：<INPUT TYPE="text" NAME="strCompanyEN" value="<%=strCompanyEN%>">
	如：Star Co.Ltd <br>
	通信地址中文：<INPUT TYPE="text" NAME="strAddressCN" value="<%=strAddressCN%>" onclick="if(this.value=='海淀区清华科技园科技大厦A座20层'){this.value=''}">
	如：X区X路X号<br>
	通信地址英文：<INPUT TYPE="text" NAME="strAddressEN" value="<%=strAddressEN%>" onclick="if(this.value=='Star Street'){this.value=''}">
	如：Star Street <br>
	城市名称中文：<INPUT TYPE="text" NAME="strCityCN" value="<%=strCityCN%>" onclick="if(this.value=='广州'){this.value=''}">
	如：广州<br>
	城市名称英文：<INPUT TYPE="text" NAME="strCityEN" value="<%=strCityEN%>" onclick="if(this.value=='GuangZhou'){this.value=''}">
	如：GuangZhou<br>
	所在省份缩写：<select name="strProvince" size="1">
				<option label="请选择" value="">请选择</option>
				<option value="BJ" label="北京" <%If strProvince="BJ" then%>selected<%End if%>>北京</option>
				<option label="香港" value="HK" <%If strProvince="HK" then%>selected<%End if%>>香港</option>
				<option label="澳门" value="MO" <%If strProvince="MO" then%>selected<%End if%>>澳门</option>
				<option label="台湾" value="TW" <%If strProvince="TW" then%>selected<%End if%>>台湾</option>
				<option label="上海" value="SH" <%If strProvince="SH" then%>selected<%End if%>>上海</option>
				<option label="深圳特区" value="SZ" <%If strProvince="SZ" then%>selected<%End if%>>深圳特区</option>
				<option label="广东" value="GD" <%If strProvince="GD" then%>selected<%End if%>>广东</option>
				<option label="山东" value="SD" <%If strProvince="SD" then%>selected<%End if%>>山东</option>
				<option label="四川" value="SC" <%If strProvince="SC" then%>selected<%End if%>>四川</option>
				<option label="福建" value="FJ" <%If strProvince="FJ" then%>selected<%End if%>>福建</option>
				<option label="江苏" value="JS" <%If strProvince="JJ" then%>selected<%End if%>>江苏</option>
				<option label="浙江" value="ZJ" <%If strProvince="ZJ" then%>selected<%End if%>>浙江</option>
				<option label="天津" value="TJ" <%If strProvince="TJ" then%>selected<%End if%>>天津</option>
				<option label="重庆" value="CQ" <%If strProvince="CQ" then%>selected<%End if%>>重庆</option>
				<option label="河北" value="HE" <%If strProvince="HE" then%>selected<%End if%>>河北</option>
				<option label="河南" value="HA" <%If strProvince="HA" then%>selected<%End if%>>河南</option>
				<option label="黑龙江" value="HL" <%If strProvince="HL" then%>selected<%End if%>>黑龙江</option>
				<option label="吉林" value="JL" <%If strProvince="JL" then%>selected<%End if%>>吉林</option>
				<option label="辽宁" value="LN" <%If strProvince="LN" then%>selected<%End if%>>辽宁</option>
				<option label="内蒙古" value="NM" <%If strProvince="NM" then%>selected<%End if%>>内蒙古</option>
				<option label="海南" value="HI" <%If strProvince="HI" then%>selected<%End if%>>海南</option>
				<option label="山西" value="SX" <%If strProvince="SX" then%>selected<%End if%>>山西</option>
				<option label="陕西" value="SN" <%If strProvince="SN" then%>selected<%End if%>>陕西</option>
				<option label="安徽" value="AH" <%If strProvince="AH" then%>selected<%End if%>>安徽</option>
				<option label="江西" value="JX" <%If strProvince="JX" then%>selected<%End if%>>江西</option>
				<option label="甘肃" value="GS" <%If strProvince="GS" then%>selected<%End if%>>甘肃</option>
				<option label="新疆" value="XJ" <%If strProvince="XJ" then%>selected<%End if%>>新疆</option>
				<option label="湖北" value="HB" <%If strProvince="HB" then%>selected<%End if%>>湖北</option>
				<option label="湖南" value="HN" <%If strProvince="HN" then%>selected<%End if%>>湖南</option>
				<option label="云南" value="YN" <%If strProvince="YN" then%>selected<%End if%>>云南</option>
				<option label="广西" value="GX" <%If strProvince="GX" then%>selected<%End if%>>广西</option>
				<option label="宁夏" value="NX" <%If strProvince="NX" then%>selected<%End if%>>宁夏</option>
				<option label="贵州" value="GZ" <%If strProvince="GZ" then%>selected<%End if%>>贵州</option>
				<option label="青海" value="QH" <%If strProvince="QH" then%>selected<%End if%>>青海</option>
				<option label="西藏" value="XZ" <%If strProvince="XZ" then%>selected<%End if%>>西藏</option>
				<option label="外国" value="WG" <%If strProvince="WG" then%>selected<%End if%>>外国</option>
	    </select>
	<br>
	邮政编码(邮编)：
	<INPUT TYPE="text" NAME="strPostcode" value="<%=strPostcode%>">
	如：100000<br>
	注册人(中文名)：
	<INPUT TYPE="text" NAME="strNameCN" value="<%=strNameCN%>">
	如：张三三<br>
	注册人(英文名)：
	<INPUT TYPE="text" NAME="strNameEN" value="<%=strNameEN%>">
	如：Zhang ShanShan <br>
	联系电话(区号)：
	<INPUT TYPE="text" NAME="intPhoneAreaCode" value="<%=intPhoneAreaCode%>">
	注:如 513 <br>
	联系电话(号码)：
	<INPUT TYPE="text" NAME="intPhoneNumber" value="<%=intPhoneNumber%>">
	注:如&nbsp;88089580	<br>
	传真号码(区号)：
	<INPUT TYPE="text" NAME="intFaxAreaCode" value="<%=intFaxAreaCode%>">
注:如 513<br>
	传真号码(号码)：
	<INPUT TYPE="text" NAME="intFaxNumber" value="<%=intFaxNumber%>">
注:如&nbsp;88089580<br>
	电子邮件(常用)：
	<INPUT TYPE="text" NAME="strEmail" value="<%=strEmail%>">
注:如&nbsp;test@163.com<br>
	行业编码(类型)：
	<select name="strTrade" size="1">
					<option label="请选择" value="">请选择</option>
					<option label="党和政府部门" value="S1">党和政府部门</option>
					<option label="信息咨询服务业" value="S2">信息咨询服务业</option>
					<option label="社会福利事业业" value="S3">社会福利事业业</option>
					<option label="商业税务部门" value="S4">商业税务部门</option>
					<option label="体育、娱乐行业" value="S5">体育、娱乐行业</option>
					<option label="运输业" value="S6">运输业</option>
					<option label="媒体、广告业" value="S7">媒体、广告业</option>
					<option label="商业" value="S8" selected>商业</option>
					<option label="科学研究、教育业" value="S9">科学研究、教育业</option>
					<option label="房地产业" value="S10">房地产业</option>
					<option label="邮电业" value="S11">邮电业</option>
					<option label="IT业" value="S12">IT业</option>
					<option label="产品制造业" value="S13">产品制造业</option>
					<option label="公共事业" value="S14">公共事业</option>
					<option label="建筑业" value="S15">建筑业</option>
					<option label="农、林、渔业" value="S16">农、林、渔业</option>
					<option label="采矿业" value="S17f">采矿业</option>
					<option label="其他" value="S18">其他</option>
	    </select><br>
	管理人(中文名)：
	<INPUT TYPE="text" NAME="strManager" value="<%=strManager%>">
	如：张三三
	<br>
	<br>
	<input name="openX" type="submit" value="保存注册信息">
    <input name="istemplate" type="checkbox" id="istemplate" value="y" checked>
    将注册信息保存为以后注册用的模板	
    </FORM>
		</td>
	  </tr>
</table>
<%if session("agentusername")<>"" Then%>
<%=htmlwrite("html7")%>
<%else%>
<%=htmlwrite("html4")%>
<%End if%>
