<%@ Language=VBScript %>
<!--#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="服务器不存在！"
end if
end if

if not ef then
 
%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
　绑定域名到子目录


<br>
<br>
<%
subcountall=dsph("subweb")

		Set dsuser = Server.CreateObject("ADODB.Recordset")	
	Sql="Select count(*)  from FreeHost.FreeHost_Product_Host where Hosttype='子目录绑定' and allowsubbyid='"&session("HOSTAUID")&"'"
dsuser.Open Sql,conn,1,1
subcount=dsuser(0)
dsuser.close
set dsuser=nothing

if dsph("allowsub")="y" and dsph("subweb")>0 then
canaddsub=true
%>[允许绑定子目录<%=dsph("subweb")%>个/已绑定<%=subcount%>个]<%else%>很抱歉，您的虚拟主机不允许绑定子目录。<%end if%>
<br><br>
<%
Set dsphlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where Hosttype='子目录绑定' and allowsubbyid='"&session("HOSTAUID")&"' order by endtime desc"
'if Request("ftpname")<>"" then	Sql="Select * from FreeHost.FreeHost_Product_Host where Hosttype='子目录绑定' and  ftpname like '%"&Request("ftpname")&"%'  and allowsubbyid='"&session("HOSTAUID")&"'"
'if Request("hostname")<>"" then	Sql="Select * from FreeHost.FreeHost_Product_Host where Hosttype='子目录绑定' and  hostname like '%"&Request("hostname")&"%'  and allowsubbyid='"&session("HOSTAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsphlist.PageSize = 25
	dsphlist.Open Sql,conn,1,1
if dsphlist.Eof then%>
<!--没有绑定子目录的虚拟主机.	-->
<%else%>
<%
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsphlist.RecordCount <> 0 Then dsphlist.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsphlist.PageCount<=10 then
       endini=dsphlist.PageCount 
       else
       endini=10
      end if
    end if
%>
<%if clng(pn)<=10 then%>最新 <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsphlist.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>">上一页</a><%End If%>|<%If Clng(pn)<dsphlist.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <tr bgcolor="#C1BFBF" align="center">
    <td width="20%" height="35" bgcolor="#7B7D7B"><a href="selfhostaddsub.asp?id=<%=session("HOSTAUID")%>"><font color="#FFFFFF">子目录绑定</font></a></td>
    <td width="10%" bgcolor="#FFFFFF">目录名</td>
    <td width="33%" bgcolor="#FFFFFF">已绑定域名</td>
    <td width="13%" bgcolor="#FFFFFF">占用资源</td>
    <td width="12%" bgcolor="#FFFFFF">操作</td>
    <td width="12%" bgcolor="#FFFFFF">ICP</td>
  </tr>
<%
For N=1 To dsphlist.PageSize 
					If dsphlist.RecordCount=0 Then Exit For
%><tr align="center" bgcolor="#FFFFFF">
    <td height="35" bgcolor="#EFEFEF">&nbsp;</td>
	<td><%=dsphlist("dirname")%></td>
    <td><%=replace(replace(dsphlist("hostname"),":80:",""),",","<br>")%></td>
    <td><a href="useper.asp?id=<%=session("HOSTAUID")%>"><%=dsphlist("useper")%>%</a></td>
    <td bgcolor="#FFFFFF"><a href="selfhostmodifysub.asp?id=<%=dsphlist("id")%>&go=a"><font color="#000000">管理</font></a></td>
    <td bgcolor="#FFFFFF"><a href="beian.asp?id=<%=dsphlist("id")%>">
      <%if dsphlist("beianstatus")="备案成功" then%>
      <FONT color=red>成功</FONT>
      <%else
	
	if canshowbeian=true Or Application("icpbyhost")=1 or Application("icpbyhost")=-1 then%>
      <%=dsphlist("beianstatus")%>
      <%If isnull(dsphlist("beianstatus")) then%>
      尚未录入备案信息
      <%End if%>
      <%else%>
    </a><a href="ispinfo.asp?id=<%=dsphlist("id")%>">自行到工信部备案</a>
    <%end if%>
    <%end if%></td>
  </tr>
<%
If clng(pn)=dsphlist.PageCount Then
I = dsphlist.RecordCount - (dsphlist.PageCount-1) * dsphlist.PageSize
If N=I Then Exit For
End If
dsphlist.movenext
Next%>
</table>
<%dsphlist.close
set dsphlist=nothing
end if
%>
<%if canaddsub=true and subcount<subcountall then%>
<form action="selfhostaddsub2.asp" method="post" name="modhostname">
  <TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
    <TBODY>
      <TR>
        <TD width="19%" vAlign=middle bgColor=#9E9E9E>&nbsp; <font color="#FFFFFF">填写资料：</font></TD>
        <TD width="80" height="40" bgColor=#ffffff><font color="#000000">　绑定域名：</font></TD>
        <TD width="64%" height="40" bgColor=#ffffff><br>
          输入域名：
            <input name="hostname1" type="text" id="host1" size="25" <%if dsserver("openmustre")=true and Application("beianusecode")=1 then%>onBlur="doicpcheck(this.value);"<%end if%>>
            (必须输入)
            <%if dsserver("openmustre")=true  and Application("beianusecode")=-1 then%>
            <br>
            <br>
您输入的域名需要管理员人工审查后才能绑定，<br>
<br>
您现在输入的域名只是提醒管理员审查此域名，<br>
<br>
并不会马上绑定成功，您需要在下面的表格看到状态<br>
<br>
是备案成功的域名才能再次输入域名并马上绑定成功。<br>
<%end if%><br>
  <%if dsserver("openmustre")=true and Application("beianusecode")=1 then%>        <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.hostname1.value);document.modhostname.icpcode.value='';">
  <br>
  <br>
  <a href="javascript:doicpcheckend(document.modhostname.icpcode.value);">再点这儿检查备案状态&gt;&gt;&gt;</a>　　检查结果(请耐心等候两分钟)：
  <div id="divicpinfo"></div>
  <%end if%>
  <br>
  
</TD></TR>
      <TR>
        <TD width="19%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
        <TD width="80" height="38" bgColor=#ffffff><font color="#000000">　子目录名：</font></TD>
        <TD width="64%" height="38" bgColor=#ffffff><input name="dirname" type="text" id="dirname" size="25" maxlength="60">
        可以是bbs或bbs\test\</TD>
      </TR>

      <TR>
        <TD height="53" colspan="2" bgColor=#ffffff>　
        <%if dsserver("openmustre")=true  and Application("beianusecode")=-1 then%>
        <a href="javascript:document.modhostname.submit();"><font color="#000000">提交&gt;&gt;&gt;&gt;</font></a>
        <%else%><input name="openX" type="submit" value="马上实时开通" onClick="document.modhostname.openX.value ='请等待不要重复刷新！....';document.modhostname.openX.disabled=true;document.modhostname.submit()"><%end if%></TD>
      </TR>
    </TBODY>
  </TABLE>
</form>
<%end if%>
<%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 height="50" align="center" vAlign=middle><%=i%></TD>
      <TD 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 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%>
<%if session("waitCDNsyn")=true then%>
<br>
<font color=red>注意：您的产品使用了CDN功能，因此新增加或修改的域名您要等候25分钟后才能生效。</font>
<br><br>
<%end if%>
<br>
　<a href="selfhostmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回主网站管理页]</font></a>
<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%>
