<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" 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="产品类型有非法字符！"
elseIf session("canmoneyK")="" Then
	ef=True
	ec="您没有此操作的权限。"
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 username='"&Request("username")&"'"
if Request("id") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&Request("id")&"'"
if Request("hostname") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where hostname like '%"&replace(Request.QueryString ("hostname"),"http://","")&"%' order by starttime desc"
if Request("ftpname") <>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Host where ftpname = '"&trim(Request.QueryString ("ftpname"))&"'"
if Request("op") ="all" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus is null or beianstatus<>'备案成功' order by starttime desc"
if Request("op") ="0" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus is null order by starttime desc"
if Request("op") ="1" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='用户已录入数据' order by starttime desc"
if Request("op") ="2" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='管理员录入数据' order by starttime desc"
if Request("op") ="3" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='管理员已审核' order by starttime desc"
if Request("op") ="4" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='用户需补充数据' order by starttime desc"
if Request("op") ="5" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='已提交工信部' order by starttime desc"
if Request("op") ="6" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='备案审核未通过' order by starttime desc"
if Request("op") ="7" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='备案成功' order by starttime desc"
if Request("op") ="8" then Sql="Select * from FreeHost.FreeHost_Product_Host where (beianstatus<>'备案成功' or beianstatus is null) and starttime<'"&dateadd("d",-30,now)&"' order by starttime desc"

if Request("op") ="12" then Sql="Select * from FreeHost.FreeHost_Product_Host where (beianstatus<>'备案成功' or beianstatus is null) order by starttime desc"

if Request("op") ="9" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus is null and starttime<'"&dateadd("d",-30,now)&"' order by starttime desc"
if Request("op") ="13" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus is null and starttime<'"&dateadd("d",-7,now)&"' order by starttime desc"

if Request("op") ="10" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='用户需补充数据' and starttime<'"&dateadd("d",-30,now)&"' order by starttime desc"
if Request("op") ="11" then Sql="Select * from FreeHost.FreeHost_Product_Host where beianstatus='备案审核未通过' and starttime<'"&dateadd("d",-30,now)&"' 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("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="90" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="admicp.asp"><font color="#FFFFFF"><strong>备案管理</strong></font></a><a href="admsql.asp"><font color="#FFFFFF"></font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">
	 <table width="98%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
	<br>


<%
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")%></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="handhost1.asp?id=<%=dsph("id")%>"><font color="#000000">管理</font></a></td>
     <td bgcolor="#FFFFFF"><a href="beian.asp?id=<%=dsph("id")%>"><FONT color=#0000ff><%=dsph("beianstatus")%><%if isnull(dsph("beianstatus")) then%><FONT color=red>未录入数据</FONT><%end if%></FONT> 
<br><%
if dsph("beianstatus")="备案成功" then
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")
username=dsph("ftpname")
password=dsph("Ftppassword")
homedir=dsserver("homedir") 		
if not isnull(dsph("dirname")) then
if dsph("dirname")<>"" then
dir=replace(homedir&"\"&username&"\web\"&dsph("dirname")&"\cert\bazs.cert","\\","\")
else
dir=replace(homedir&"\"&username&"\web\cert\bazs.cert","\\","\")
end if
else
dir=replace(homedir&"\"&username&"\web\cert\bazs.cert","\\","\")
end if
retdns=OPFileExists(URL,FreeHostsharekey,dir)
if instr(retdns,"IMPLEMENTED")>1 then%>
		  受控端版本太旧不支持此功能
		  <%else
if instr(retdns,"已存在")>1 then%>备案文件已正确上传<%
else%><font color=red>备案文件未上传</font><%end if
end if
end if
%><%dsserver.close%></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><br>
<%if Request.QueryString ("op") ="8" or Request.QueryString ("op") ="9" or Request.QueryString ("op") ="10" or Request.QueryString ("op") ="11" or Request.QueryString ("op") ="13" or Request.QueryString ("op") ="12" then%>
<a href="admhostautodo.asp?op=pause&pausefor=icp&opid=<%=Request.QueryString ("op")%>"><font color="#FF0000">暂停以上内容的主机>>></font></a>
<%end if%>

<%dsph.close
set dsph=nothing
%>


	
	</td>
  </tr>
</table> 

      </TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>


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