<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf Instr(Request("hostname"), "'")>0 then
	ef=True
	ec="产品类型有非法字符！"
ElseIf Instr(Request("ftpname"), "'")>0 then
	ef=True
	ec="产品类型有非法字符！"
end if
if not ef Then
Response.write "页面升级中"
Response.End

Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where username='"&Request("username")&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
if Request("id") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&Request("id")&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
if Request("hostname") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where hostname like '%"&replace(Request.QueryString ("hostname"),"http://","")&"%' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("ftpname") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where ftpname = '"&trim(Request.QueryString ("ftpname"))&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
if Request("op") ="all" then Sql="Select * from FreeHost.FreeHost_Product_Host where (beianstatus is null or beianstatus<>'备案成功') and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="0" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus is null and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="1" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='用户已录入数据' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="2" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='管理员录入数据' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="3" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='管理员已审核' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="4" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='用户需补充数据' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="5" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='已提交工信部' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="6" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='备案审核未通过' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Request("op") ="7" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='备案成功' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by starttime desc"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.PageSize = 25
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="此类虚拟主机不存在！"
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
 　管理ICP备案
 <%=htmlwrite("html6")%>
<%
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 dsph.RecordCount <> 0 Then dsph.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsph.PageCount<=10 then
       endini=dsph.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>页 
        　共<%=dsph.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>">上一页</a><%End If%>|<%If Clng(pn)<dsph.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#333333">
  <tr bgcolor="#C1BFBF" align="center">
    <td height="21">产品类型</td>
    <td>域　名</td>
    <td height="21">用户名<br>FTP名</td>
    <td>IP 地址</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
    <td>备案状态</td>
  </tr>
<%
For N=1 To dsph.PageSize 
					If dsph.RecordCount=0 Then Exit For
%>
<%

	Hosttype=dsph("Hosttype")
	Set ori_host_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
		ori_host_name.Open Sql,conn,1,1
		if not ori_host_name.eof then
Set newname_host = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_HostProductlist_AGN where agent1='"&session("agentname")&"' and id='"&ori_host_name("id")&"'"
		newname_host.Open Sql,conn,1,1
if not newname_host.eof then
Hosttype=newname_host("Hosttype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=Hosttype%></td>
    <td><%=replace(replace(dsph("hostname"),":80:",""),",","<br>")%></td>
    <td><a href="searchuser.asp?username=<%=dsph("username")%>"><font color="#000000"><%=dsph("username")%></font></a><br>
    <%=dsph("ftpname")%></td>
    <td><%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
%><%=dsserver("ip")%><%dsserver.close%></td>
    <td><%=formatdatetime(dsph("starttime"),1)%></td>
    <td><%=formatdatetime(dsph("endtime"),1)%></td>
    <td><%if dsph("endtime")>NOW then%>
      <%if dsph("istest")="y" then%>
      <font color="#FF0000">试用</font><%else%>
      <%=dsph("status")%>
      <%end if%>
      <%else%>
      <font color="#FF0000">过期</font>
      <%if dsph("status")="暂停" then%>
      <br>
      <font color="#FF0000">暂停</font>
      <%end if%>
      <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="hostadm2.asp?id=<%=dsph("id")%>&go=a"><font color="#000000">管理</font></a></td>
     <td bgcolor="#FFFFFF"><a href="hostadm2.asp?id=<%=dsph("id")%>&go=b"><FONT color=#0000ff><%=dsph("beianstatus")%><%if isnull(dsph("beianstatus")) then%><FONT color=red>未录入数据</FONT><%end if%></FONT></td>
  </tr>
<%
If clng(pn)=dsph.PageCount Then
I = dsph.RecordCount - (dsph.PageCount-1) * dsph.PageSize
If N=I Then Exit For
End If
dsph.movenext
Next%>
</table>
<%dsph.close
set dsph=nothing
%>
<%=htmlwrite("html7")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
