<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
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")	
if Request.QueryString ("op") ="all" then Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by id desc "
'if Request.QueryString ("op") ="host" then Sql="Select * from FreeHost.FreeHost_USER where endtime<'"&now&"' order by endtime desc"
'if Request.QueryString ("op") ="del" then Sql="Select * from FreeHost.FreeHost_USER where endtime<'"&dateadd("d",-30,now)&"' order by endtime desc"

if Request.QueryString ("op") ="all" then Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by id desc"
if Request.QueryString ("op") ="notzero" then Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and usermoney>0 order by usermoney desc"
if Request.QueryString ("op") ="zero" then Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and usermoney=0 order by usermoney desc"

if Request.QueryString ("op") ="waitmoney" then Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and waitmoney>0 order by waitmoney 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("html5")%>　用户列表管理
<%=htmlwrite("html6")%>


共有：<%=ds.recordcount%> 条记录 <%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>页 
        　共<%=ds.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a><%End If%>|<%If Clng(pn)<ds.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a><%End If%>
<table width="100%"  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="searchuser.asp?username=<%=ds("username")%>" target="_blank"><%=ds("username")%></a>
</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 username='"&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 username='"&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 username='"&ds("username")&"'"
	dsph.Open Sql,conn,1,1
if dsph.Eof then%>
      <%else%>
      <br>
<font color="#000000">此用户有已开通的数据库.</font>      
      <%
dsph.close
'set dsph=nothing
end if
%>
            </font>
</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>
<br>
<br>

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