<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmagn")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("username")) 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")	
if Request.QueryString ("op") ="all" then Sql="Select * from FreeHost.FreeHost_Agent order by id desc"
if Request.QueryString ("op") ="notzero" then Sql="Select * from FreeHost.FreeHost_Agent where usermoney>0 order by usermoney desc"
if Request.QueryString ("op") ="zero" then Sql="Select * from FreeHost.FreeHost_Agent where usermoney=0 order by usermoney desc"
if Request.QueryString ("op") ="notnor" then Sql="Select * from FreeHost.FreeHost_Agent where usermoney<0 order by usermoney desc"
if Request.QueryString ("op") ="netset" then Sql="Select * from FreeHost.FreeHost_Agent where agenttype='n' order by id desc"

if Request.QueryString ("agenttype") <>"" then Sql="Select * from FreeHost.FreeHost_Agent where agenttype='"&Request.QueryString ("agenttype")&"' order by id desc"

if Request.QueryString ("kefu") <>"" then Sql="Select * from FreeHost.FreeHost_Agent where kefunow='"&Request.QueryString ("kefu")&"' order by usermoney desc"

if Request.QueryString ("kefuto") <>"" then Sql="Select * from FreeHost.FreeHost_Agent where kefuto is not null order by usermoney desc"

if Request.QueryString ("username") <>"" then Sql="Select * from FreeHost.FreeHost_Agent where (agent1='"&Request("username")&"' or agent2='"&Request("username")&"') order by id desc"

		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	ds.PageSize = 25
	ds.Open Sql,conn,1,1
if ds.Eof then
	ef=True
	ec="此类内容不存在！"
end if
end if


if not ef then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If ds.RecordCount <> 0 Then ds.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if ds.PageCount<=10 then
       endini=ds.PageCount 
       else
       endini=10
      end if
    end if
%>
<!--#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 width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><font color="#FFFFFF">代理列表</font></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</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">

<div id="truecon">
共有：<%=ds.recordcount%> 条记录 <%if clng(pn)<=10 then%>最新 <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a target="iframeFreeHost" href="admuserlistagent.asp?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a target="iframeFreeHost" href="admuserlistagent.asp?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=ds.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a target="iframeFreeHost" href="admuserlistagent.asp?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a><%End If%>|<%If Clng(pn)<ds.PageCount Then%><a target="iframeFreeHost" href="admuserlistagent.asp?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a><%End If%>
<table width="98%"  border="0" cellspacing="1" bgcolor="#000000">
  <tr align="center" bgcolor="#666666">
    <td width="10%"><font color="#FFFFFF">
编号    </font>
    <td width="8%"><font color="#FFFFFF">代理名</font></td>
    <td width="9%"><font color="#FFFFFF">金额</font></td>
    <td width="73%"><font color="#FFFFFF">其他</font></td>
  </tr>
<%
For N=1 To ds.PageSize 
					If ds.RecordCount=0 Then Exit For
%>
  <tr align="center">
    <td width="10%" align="center" bgcolor="#FFCC66">
<%=ds("id")%>
    <td width="8%" align="center" bgcolor="#CCCCCC"><a href="searchagent.asp?username=<%=ds("username")%>" target="_blank"><%=ds("username")%></a>
    <%if ds("agenttype")="n" then%><br>(<a href="admagent.asp?username=<%=ds("username")%>" target="_blank"><font color="#FF0000">审批</font></a>)
    <%end if%>


<%if ds("agent1")<>"n" then%><br>上级代理名：<a href="searchagent.asp?username=<%=ds("agent1")%>" target="_blank"><font color="blue"><%=ds("agent1")%></font></a><%end if%>

	</td>
    <td width="9%" align="center" bgcolor="#CCCCCC"><%=ds("usermoney")%> 元 </td>
    <td width="73%" align="left" bgcolor="#CCCCCC">电子邮件：<a href=mailto:<%=ds("email")%>><%=ds("email")%></a> QQ：<%=ds("qq")%> 中文名：<%=ds("truename")%> 联系地址：<%=ds("address")%> 电话：<%=ds("tel")%>  注册ip：<%=ds("regip")%> 注册时间：<%=ds("regtime")%>
      <%
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where agent1='"&ds("username")&"'"
	dsph.Open Sql,conn,1,1
if dsph.Eof then%>
<%else%>
<br>
<font color="#FF0000">此代理有已开通的虚拟主机.</font>
<%
dsph.close
'set dsph=nothing
end if
%>
<%
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where agent1='"&ds("username")&"'"
	dsph.Open Sql,conn,1,1
if dsph.Eof then%>
<%else%>
<br>
<font color="#FF0000">此代理有已开通的邮箱.</font>
<%
dsph.close
'set dsph=nothing
end if
%>
      <%
Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where agent1='"&ds("username")&"'"
	dsph.Open Sql,conn,1,1
if dsph.Eof then%>
      <%else%>
      <br>
<font color="#FF0000">此代理有已开通的数据库.</font>
      <%
dsph.close
'set dsph=nothing
end if
%>
</td>
  </tr> 
<%

If clng(pn)=ds.PageCount Then
I = ds.RecordCount - (ds.PageCount-1) * ds.PageSize
If N=I Then Exit For
End If
ds.movenext
Next

ds.close
set ds=nothing
%></table>

</div>

	  </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%>
<%=ec%>
<%end if%>
  
<script>
var partable=parent.document.getElementById("table0");
if (partable!=null)
partable.style.display='';

partable=parent.document.getElementById("outconM");
if (partable!=null)
{partable.innerHTML = truecon.innerHTML;
document.body.innerHTML=partable.innerHTML;}
</script>
