<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&session("HOSTAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
else
isuseCDN=dsserver("isuseCDN")	
end if
end if

if not ef then
if isuseCDN=true then
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerCDNlist where id='"&dsserver ("usecdn1")&"'"
	dsCDNserver.Open Sql,conn,1,1
if dsCDNserver.Eof then
	ef=True
	ec="CDN服务器不存在！"
end if
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
　虚拟主机自助管理

<br>
<form action="selfhostmodifyhostname.asp" method="post" name="modhostname" id="modhostname">
<%
hostname=dsph("hostname")
hostname=replace(hostname, ":80:","")
hostname_arry=Split(hostname, ",")
 
%>
<TABLE  width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD height="35" colspan="3" align="center" vAlign=middle bgColor=#494949><br><font color="#FFFFFF">绑定域名：<%if isuseCDN=true then%>海外免备案CDN主机，请使用别名(CNAME)解析到：<%if len(dsCDNserver("cname"))>3 then%><%=dsCDNserver("cname")%><%else%><%=dsserver("cname")%><%end if%><%else%>(服务器IP为 <%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where HostID="&dsph("id")
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
        <%=dsserver("ip")%><%if not isnull(dsserver("cname")) then%> 
        <font color="#FF0000"><br>
        主机别名:双线主机，请使用别名(CNAME)解析到：<%=dsserver("cname")%></font>
        <%end if%>
<%else
while not dsX.eof
%><%=dsX("IP")%> <%
dsX.movenext
wend
end if%>)<%end if%>　总允许数为：<%If IsNull(dsph("domaincount")) then%><%=dsHostpdlist("allowdomain")%><%else%><%=dsph("domaincount")%><%End if%>个</font><br><br></TD>
      </TR>
    <TR bgcolor="#F2F2F2">
      <TD width="15%" height="50" align="center" vAlign=middle>序号</TD>
      <TD width="71%" height="50" align="center" vAlign=middle>已绑定成功的域名<br>

</TD>
      <TD width="14%" height="50" align="center" vAlign=middle>操作</TD>
</TR>	  
<%for i=0 to ubound(hostname_arry)%>	
    <TR>
      <TD width="15%" height="35" align="center" vAlign=middle bgColor=#EEEEEE><%=i+1%></TD>
      <TD width="71%" align="center" vAlign=middle bgColor=#FFFFFF>
      <br>
	  <%if ComX.actoidc_7i24_com(cstr(hostname_arry(i)))<>hostname_arry(i) then%>
          <%=ComX.actoidc_7i24_com(cstr(hostname_arry(i)))%> (<%=hostname_arry(i)%>)
          <%else%>
          <%=hostname_arry(i)%>
          <%end if%><br>
<%
if dsserver("autodelicp")=true then'如果启用后台检查

domain=hostname_arry(i)

	Set dsICPDB = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ICPDB where domain='"&GetDomainMain(domain)&"'"
	dsICPDB.Open Sql,conn,1,1
if Not dsICPDB.Eof Then%>
<br>备案状态：<%=dsICPDB("status")%><%If Not IsNull(dsICPDB("ICP_SN")) then%>　<%=dsICPDB("ICP_SN")%><%End if%><%If Not IsNull(dsICPDB("ICP_Who")) then%>　<%=dsICPDB("ICP_Who")%><%End if%>
<%if dsICPDB("status")="未提交备案" then%>
<br> 　<font color=red>在<%=7-DateDiff("d", dsICPDB("firstaddtime"),Now)%>天内必须在工信部能查到提交备案信息，否则此域名会被清理</font>
<br>　 <font color=red>在<%=30-DateDiff("d", dsICPDB("firstaddtime"),Now)%>天内必须在工信部能查到备案成功，否则此域名会被清理</font><br>
<%end if
if dsICPDB("status")="已提交备案，尚未备案成功" then%>
<br>　 <font color=red>在<%=30-DateDiff("d", dsICPDB("firstaddtime"),Now)%>天内必须在工信部能查到备案成功，否则此域名会被清理</font><br>
<%end if

end If
dsICPDB.close

End if
%>
          <input name="hostname<%=i+1%>" type="hidden" value="<%=hostname_arry(i)%>">
          <%session("hostname"&(i+1))=hostname_arry(i)%>
          <br>
        </TD>
      <TD width="14%" align="center" vAlign=middle bgColor=#FFFFFF><a href="javascript:document.modhostname.hostname<%=i+1%>.value='';document.modhostname.submit();"><font color="#000000">删除</font></a></TD>
    </TR>
<%next%>

    <TR>
      <TD width="15%" height="35" align="center" vAlign=middle bgColor=#EEEEEE><%=i+1%></TD>
      <TD width="71%" align="center" vAlign=middle bgColor=#FFFFFF><br>
        <%if Application("beianusecode")=1 then%>1.<%end if%>输入新域名：
          <input name="hostname<%=i+2%>" type="text" size="20" <%if dsserver("openmustre")=true and Application("beianusecode")=1 then%>onBlur="doicpcheck(this.value);"<%end if%>>
        <br>
<%if dsserver("openmustre")=true  and Application("beianusecode")=-1 then%>
<br>
您输入的域名需要管理员人工审查后才能绑定，<br>
<br>
您现在输入的域名只是提醒管理员审查此域名，<br>
<br>
并不会马上绑定成功，您需要在下面的表格看到状态<br>
<br>
是备案成功的域名才能再次输入域名并马上绑定成功。<br>
<%end if%>		
<%if dsserver("openmustre")=true and Application("beianusecode")=1 then%>        <br>
2.再输入验证码(稍等一会右边的图片才会出现)：
<input name="icpcode" type="text" id="icpcode" size="6" maxlength="10" onmouseover="this.focus()" onFocus="this.select()">
<img id=imgcode height=50 src="" width=200 name=imgcode style="display:none" onClick="doicpcheck(document.modhostname.hostname<%=i+2%>.value);document.modhostname.icpcode.value='';">
<br>
<br>
<a href="javascript:doicpcheckend(document.modhostname.icpcode.value);">3.再点这儿检查备案状态&gt;&gt;&gt;</a>　　检查结果(请耐心等候两分钟)：
<div id="divicpinfo"></div>
<%end if%>
<br>
</TD>
      <TD width="14%" align="center" vAlign=middle bgColor=#FFFFFF><a href="javascript:document.modhostname.submit();"><font color="#000000">增加</font></a>
	  	  <%if dsserver("openmustre")=true  and Application("beianusecode")=1 then%>
	  <br>(先检查备案状态才能增加)
	  <%end if%></TD>
</TR>
  </TBODY>
</TABLE><br>



<%if Application("beianusecode")=-1 then
Set dsICPDB = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ICPDB where ftpname='"&dsph("ftpname")&"' order by  firstaddtime desc"
'	Sql="Select * from FreeHost.FreeHost_ICPDB where ftpname='"&dsph("ftpname")&"' and status<>'备案成功'"
'If Application("beianupsaok")=True Then 	Sql="Select * from FreeHost.FreeHost_ICPDB where ftpname='"&dsph("ftpname")&"' and (status<>'备案成功' and status<>'已提交备案，尚未备案成功')"
	dsICPDB.Open Sql,conn,1,1
i=1	
%>
<TABLE  width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR bgcolor="#F2F2F2">
      <TD width="15%" height="50" align="center" vAlign=middle>序号</TD>
      <TD width="71%" height="50" align="center" vAlign=middle>您的FTP用户名下的本地备案库的主域名<br>

</TD>
      <TD width="14%" height="50" align="center" vAlign=middle>状态</TD>
</TR>
<%if dsICPDB.Eof then%>
    <TR bgcolor="#FFFFFF">
      <TD width="15%" height="50" align="center" vAlign=middle>无</TD>
      <TD width="71%" height="50" align="center" vAlign=middle>没有此类域名<br>

</TD>
      <TD width="14%" height="50" align="center" vAlign=middle>无</TD>
</TR>
<%end if%>
<%while not dsICPDB.Eof
%>
    <TR bgcolor="#FFFFFF">
      <TD width="15%" height="50" align="center" vAlign=middle><%=i%></TD>
      <TD width="71%" height="50" align="center" vAlign=middle><br>
       <%if ComX.actoidc_7i24_com(cstr(dsICPDB("domain")))<>dsICPDB("domain") then%>
          <%=ComX.actoidc_7i24_com(cstr(dsICPDB("domain")))%> (<%=dsICPDB("domain")%>)
          <%else%>
          <%=dsICPDB("domain")%>
          <%end if%>
      
      <%if dsICPDB("status")<>"备案成功" then%><br>
       提交时间：<%=dsICPDB("firstaddtime")%>       <br>
       <%if not isnull(dsICPDB("checktime")) then%>检查时间：<%=dsICPDB("checktime")%>       <br><%end if%>
       <br><%end if%>

</TD>
      <TD width="14%" height="50" align="center" vAlign=middle><%=dsICPDB("status")%>
 <%if dsICPDB("status")<>"备案成功" and dsICPDB("status")<>"尚未检测" then%><br>
 <a href="icpchstatus.asp?id=<%=dsICPDB("id")%>&goto=<%=server.urlencode("selfhostmodifyhostnamea.asp?id="&Request("id"))%>"><br>
提醒管理员重新检查</a><br>
<%end if%>
	  </TD>
</TR>
<%
i=i+1
dsICPDB.movenext
wend%>
  </TBODY>
</TABLE>
<%end if%>
<input name="id" type="hidden" value="<%=Request("id")%>">
</form>
<%if session("waitCDNsyn")=true then%>
<br>
<font color=red>注意：您的产品使用了CDN功能，因此新增加或修改的域名您要等候25分钟后才能生效。</font>
<br><br>
<%end if%>
　<a href="selfhostmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<br>
<script src="/inc-freehost-function/icpcheck.js"></script>
<!--#include virtual="/inc-freehost-function/template-hostadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
