<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<!--#include virtual="/agent/mydomainINC.asp"-->
<%
On Error Resume next
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent where username='"&session("agentusername")&"'"
		ds.Open Sql,conn,1,1
if ds.eof then
	ef=True
	ec="代理会员不存在！"
end if
end If


if not ef then
if ds("haveclosehtml")=true then
	ef=True
	ec="管理员已关闭了您的服务域名及模板管理功能"
end if
end if


if not ef then
'domain
	Set dsagentdomain = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_ALLdomain where username='"&session("agentusername")&"' order by id asc"
		dsagentdomain.Open Sql,conn,1,1
if dsagentdomain.eof then
'	ef=True
'	ec="代理网站为空！"
end if
end if

if not ef then

'ds.close
'set ds=nothing
'conn.Close 
'set conn=nothing
 
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　服务域名
<%=htmlwrite("html6")%>
<br><br>
代理用户名：<%=session("agentusername")%> 类型：<%=ds("agenttype")%><br>
所有访问下以域名的用户将自动成为您所代理的用户。<br>必须将以下的域名指向到本服务器的IP或别名上：<%=showIP%><br>
请设置的域名:


<form name="modhostname" method="post" action="mydomain-sub.asp">

<%if Application("openmustre")=true and Application("beianusecode")=1 then%>
        绑定域名前，您需要检查是否备案<br>
输入要检查的新域名：
          <input name="icpdomainnowcheck" type="text" size="20" onBlur="doicpcheck(this.value);">
        <br>
        <br>
再输入验证码(稍等一会右边的图片才会出现)：
<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.icpdomainnowcheck.value);document.modhostname.icpcode.value='';">
<br>
<br>
<a href="javascript:doicpcheckend(document.modhostname.icpcode.value);">再点这儿检查备案状态&gt;&gt;&gt;</a>　　检查结果(请耐心等候两分钟)：
<div id="divicpinfo"></div>
<br>
只有显示备案成功后，下面才能录入域名:<br>
<br>

<%end if%>

<%haveopen=dsagentdomain.recordcount%> 
<%if haveopen>0 then%>
<%for i=1 to haveopen%><%session("domain"&(i))=dsagentdomain("domain")%>
域名:<input name="domain<%=i%>" type="text" value="<%=ComX.actoidc_7i24_com(Cstr(dsagentdomain("domain")))%>" size="25"> 
<a href="http://<%=dsagentdomain("domain")%>" target="_blank"><font color="#000000">访问：>>></font></a>
<%
dsagentdomain.movenext
%>
<br>
<%next%>
<%end if%>
<%notopen=5-dsagentdomain.recordcount%> 
<%if notopen>0 then%>
<%for i=haveopen+1 to notopen+haveopen%>
域名:<input name="domain<%=i%>" type="text" size="25">
<br>
<%next%>
<%end if%><%if Application("openmustre")=true and Application("beianusecode")=-1 then%>
<input type="submit" name="Submit" value="将新域名提交给管理员审查">
            <br>
            <br>
您输入的域名需要管理员人工审查后才能绑定，<br>
<br>
您现在输入的域名只是提醒管理员审查此域名，<br>
<br>
并不会马上绑定成功，您需要在下面的表格看到状态<br>
<br>
是备案成功的域名才能再次输入域名并马上绑定成功。<br>

        <%else%><input type="submit" name="Submit" value="保存修改"><%end if%>

</form>
<script src="/inc-freehost-function/icpcheck.js"></script>
<%if Application("beianusecode")=-1 then
Set dsICPDB = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ICPDB where username='"&session("agentusername")&"' 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>您的用户名下的本地备案库的主域名<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")%></TD>
</TR>
<%
i=i+1
dsICPDB.movenext
wend%>
  </TBODY>
</TABLE>
<%end if%>

<%=htmlwrite("html7")%>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if


Function RegExpTest(patrn, strng)
  Dim regEx
  Set regEx = New RegExp
  regEx.Pattern = patrn
  regEx.IgnoreCase = False
  RegExpTest = regEx.Test(strng)
End Function %>
