<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("username")="" and Request("truename")="" and Request("email")=""  and Request("domain")="" And Request("qq")="" And Request("tel")="" And Request("perid")="" And Request("mobi")="" Then
	ef=True
	ec="必须输入一项内容！"
elseif trim(Lcase(session("agentusername")))=trim(Lcase(Request("username"))) then
	ef=True
	ec="不能自己操作自己！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名非法字符！"
elseif Request("email")<>"" And RegExpTest("^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$",Request("email"))=false then
	ef=True
	ec="邮箱不正确！"
ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("truename")) Then
	ef=True
	ec="姓名中有非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request("qq")) Then
	ef=True
	ec="qq非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Replace(Request("tel"),"-","")) Then
	ef=True
	ec="电话非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Replace(Request("mobi"),"-","")) Then
	ef=True
	ec="mobi电话非法字符！"
ElseIf Instr(1,Request("username"), "'", 1)>0 or Instr(1,Request("truename"), "'", 1)>0 or Instr(1,Request("address"), "'", 1)>0 or Instr(1,Request("email"), "'", 1)>0 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")	
		Sql="Select * from FreeHost.FreeHost_Agent where username = '"&Request("username")&"'  and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') "
if Request("truename")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where truename like '%"&Request("truename")&"%' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
if Request("email")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where email like '%"&Request("email")&"%' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
'if Request("address")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where address like '%"&Request("address")&"%' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"

if Request("qq")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and qq like '%"&Request("qq")&"%'"
if Request("tel")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and tel like '%"&Request("tel")&"%'"
'if Request("perid")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where perid like '%"&Request("perid")&"%'"
if Request("mobi")<>"" then	Sql="Select * from FreeHost.FreeHost_Agent where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and mobi like '%"&Request("mobi")&"%'"


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


if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
 　查找代理
 <%=htmlwrite("html6")%>
<table width="98%"  border="0" cellspacing="0" cellpadding="0" id="table2">
          <tr>
            <td width="10" height="23" background="img/contopa.gif">&nbsp;</td>
            <td height="23" align="left" valign="top" background="img/contopb.gif"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="8" colspan="3"></td>
                </tr>
                <tr>
                  <td width="25">&nbsp;</td>
                  <td align="left" valign="top"><font color="#FFFFFF"><strong>查找的结果</strong></font></td>
                  <td width="10"><a href="#"  onClick="table2.style.display='none';"></a></td>
                </tr>
            </table></td>
            <td width="10" height="23" background="img/contopc.gif">&nbsp;</td>
          </tr>
          <tr>
            <td background="img/conmid1.gif">&nbsp;</td>
            <td>

<div id="truecon">
<%while not ds.eof%>
<br>
<strong>代理名</strong>：<%=ds("username")%>
　<a href="/agent/changeagnnext.asp?username=<%=ds("username")%>"><font color="#000000">切换成此代理角色>>>(代理区点注销会自动退回管理区)</font></a>　<br>
<br>
余额：<%=ds("usermoney")%> 元<br>
网上支付待入帐金额：　<%=ds("waitmoney")%> 　元 　　<a href="setwaitmoney.asp?username=<%=ds("username")%>&usertype=agent"><font color="#000000">马上将待入帐金额清零&gt;&gt;&gt;</font></a>　<br>
<br>

名下所有用户的资金总和：
<%
'domain
	Set dsagnuserall = Server.CreateObject("ADODB.Recordset")	
    Sql="Select usermoney=sum(usermoney) from FreeHost.FreeHost_User WHERE (agent1='"&ds("username")&"' or agent2='"&ds("username")&"')"
		dsagnuserall.Open Sql,conn,1,1%>
<%=dsagnuserall("usermoney")%>　元<br>
<%
'domain
	Set dsagnall = Server.CreateObject("ADODB.Recordset")	
    Sql="Select usermoney=sum(usermoney) from FreeHost.FreeHost_Agent WHERE (agent1='"&ds("username")&"' or agent2='"&ds("username")&"')"
		dsagnall.Open Sql,conn,1,1%>
名下所有代理的资金总和：<%=dsagnall("usermoney")%>　元<br>
<%
dsagnall.close
set dsagnall=nothing
dsagnuserall.close
set dsagnuserall=nothing
%>
<br>类型：<%=ds("agenttype")%><%if ds("agenttype")="n" then%>(未审批)<%end if%>
<br>

　<a href="admagentsettype.asp?username=<%=ds("username")%>&agenttype=y"><font color="#000000">手工设置此</font><font color="#000000">代理的价格&gt;&gt;&gt;</font></a><br>
<br>电子邮件：<a href=mailto:<%=ds("email")%>><font color="#000000"><%=ds("email")%></font></a>
　　 　<a href="emailone.asp?email=<%=ds("email")%>&title=<%=ds("username")%>" target="_blank">发邮件给这个代理&gt;&gt;&gt;</a><br>
上级代理名：<%if ds("agent1")<>"n" then%><a href="searchagent.asp?username=<%=ds("agent1")%>" target="_blank"><font color="blue"><%=ds("agent1")%></font></a><%end if%>
<br>
<br>
QQ：<%=ds("qq")%><%
SERVER_NAME=Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("HTTP_FreeHostAPISITE")<>"" Then SERVER_NAME=Request.ServerVariables("HTTP_FreeHostAPISITE")
%>
　<a href="tencent://message/?uin=<%=ds("qq")%>&Site=<%=SERVER_NAME%>&Menu=yes" title="发送即时消息给用户"" target="_blank">发送即时消息给代理&gt;&gt;</a><br>
中文名：<%=ds("truename")%>
<br> 
地址：
<%=ds("prv")%>/<%=ds("city")%>/<%=ds("address")%> 　联系人：<%=ds("contact")%> 邮编：<%=ds("postid")%> <br> 
身份证号码：
<%=ds("perid")%><br>
电话：<%=ds("tel")%><br>
手机：<%=ds("mobi")%> <br>
传真：<%=ds("fax")%>
<br>
注册ip：<%=ds("regip")%>
<br>注册时间：<%=ds("regtime")%><br>
服务的域名:<br>
<%
'domain
	Set dsagentdomain = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_ALLdomain where username='"&ds("username")&"'"
		dsagentdomain.Open Sql,conn,1,1
while not dsagentdomain.Eof%> 
<a href="http://<%=dsagentdomain("domain")%>" target="_blank"><font color="#000000">http://<%=dsagentdomain("domain")%></font></a><br>
<%
dsagentdomain.movenext
Wend
dsagentdomain.close
set dsagentdomain=nothing
%>



  <strong><br>
  <br>
  名下已开通的虚拟主机:</strong><br>
  <%
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%>
<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>域　名</td>
    <td height="21">FTP用户名</td>
    <td>IP 地址</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
    <td>ICP</td>
  </tr>
  <%while not dsph.Eof%>
  <%

	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='"&dsph("agent1")&"' 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

hostname=dsph("hostname")
hostname=replace(hostname, ":80:","")
hostname_arry=Split(hostname, ",")

	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
		ostype=dsserver("ostype")
	useisp=dsserver("useisp")
isuseCDN=dsserver("isuseCDN")	

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=Hosttype%></td>
    <td><a href="searchuser.asp?username=<%=dsph("username")%>"><%=dsph("username")%></a></td>
    <td><%for idname=0 to ubound(hostname_arry)%>
        <a href="http://<%=hostname_arry(idname)%>" target="_blank"><%=hostname_arry(idname)%></a><br>
        <%next%></td>
    <td><%=dsph("ftpname")%></td>
    <td><%if isuseCDN=true then%>请用面板中的别名解析<%else%><%if dsserver("ostype")="linux" then%>
<br><%if dsph("status")="暂停" or dsph("status")="停止" then%>暂停或停止状态不能登陆DA后台<%else%><a href="hostadm2.asp?id=<%=dsph("id")%>&go=e" target="_blank">进入DA接口后台</a><br><%end if%>
<%end if%><%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Host_IP where HostID="&dsph("id")
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
      <%
'服务器
%>
      <%=dsserver("ip")%>
      <%dsserver.close%>
      <%else
while not dsX.eof
%>
      <%=dsX("IP")%> <br>
      <%
dsX.movenext
wend
end if%><%end if%></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="admhost.asp?username=<%=dsph("username")%>&id=<%=dsph("id")%>"><font color="#000000">管理</font></a></td>
    <td bgcolor="#FFFFFF"><a href="hostadm2.asp?id=<%=dsph("id")%>&go=b">
      <%if dsph("beianstatus")="备案成功" then%>
      <FONT color=red>成功</FONT>
      <%else%>
      <FONT color=#000000>备案</FONT>
      <%end if%>
    </a></td>
  </tr>
  <%
dsph.movenext
wend%>
</table>
<%
dsph.close
set dsph=nothing
end if%>
<br>
<strong>名下已开通的邮箱产品:</strong><br>
<%
Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where agent1='"&ds ("username")&"'"
	dsphemail.Open Sql,conn,1,1
if dsphemail.Eof then%>
没有已开通的邮箱产品.
<%else%>
<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>绑定域名</td>
    <td height="21">所属父产品</td>
    <td>IP 地址</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <%while not dsphemail.Eof%>
  <%
	Emailtype=dsphemail("Emailtype")
	Set ori_email_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where Emailtype='"&dsphemail("Emailtype")&"'"
		ori_email_name.Open Sql,conn,1,1
		if not ori_email_name.eof then
Set newname_email = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_EmailProductlist_AGN where agent1='"&dsphemail("agent1")&"' and id='"&ori_email_name("id")&"'"
		newname_email.Open Sql,conn,1,1
if not newname_email.eof then
Emailtype=newname_email("Emailtype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=Emailtype%> </td>
    <td><a href="searchuser.asp?username=<%=dsphemail("username")%>"><%=dsphemail("username")%></a></td>
    <td><%
	Set dspdallemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLEmail where username='"&dsphemail ("username")&"' and PdEID='"&dsphemail ("id")&"' order by emailname"
		dspdallemail.Open Sql,conn,1,1
		if not dspdallemail.eof then
		if not isnull(dspdallemail("emailname")) then
		%>
        <%= replace(dspdallemail("emailname"),"webmaster@","")%>
        <%
		end if
		end if%></td>
    <td><%
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&dsphemail("byhost")&"' and username='"&dsphemail("username")&"'"
	dsph.Open Sql,conn,1,1
if not dsph.Eof then
nohost=false%>
        <a href="admhost.asp?id=<%=dsphemail("byhost")%>"><font color="black">虚拟主机(<%=dsph("ftpname")%>)</font></a>
        <%else
nohost=true
end if%>
        <%
Set dsdm = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Product_Domain where username='"&dsphemail ("username")&"' and id ='"&dsphemail("bydomain")&"'"
	dsdm.Open Sql,conn,1,1
if not dsdm.Eof then
nodomain=false%>
        <a href="listmydomain.asp?id=<%=dsphemail("bydomain")%>"><font color="black">域名(<%=dsdm("domain")%>)</font></a>
        <%else
nodomain=true
end if
if nohost and nodomain then%>
      无
      <%end if%>
    </td>
    <td><%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serveremaillist where id='"&dsphemail ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
%>
        <%=dsserver("ip")%>
        <%dsserver.close%></td>
    <td><%=formatdatetime(dsphemail("starttime"),1)%></td>
    <td><%=formatdatetime(dsphemail("endtime"),1)%></td>
    <td><%if dsphemail("endtime")>NOW then%>
        <%if dsphemail("istest")="y" then%>
        <font color="#FF0000">试用</font>
        <%else%>
        <%=dsphemail("status")%>
        <%end if%>
        <%else%>
        <font color="#FF0000">过期</font>
        <%if dsphemail("status")="暂停" then%>
        <br>
        <font color="#FF0000">暂停</font>
        <%end if%>
        <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="admemail.asp?id=<%=dsphemail("id")%>"><font color="#000000">管理</font></a></td>
  </tr>
  <%
dsphemail.movenext
wend%>
</table>
<%
dsphemail.close
set dsphemail=nothing
end if
%>
<strong></strong>
<strong><br>
<br>
名下已开通的数据库产品:</strong><br>
<%
Set dsphSql = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where agent1='"&ds ("username")&"'"
	dsphSql.Open Sql,conn,1,1
if dsphSql.Eof then%>
没有已开通的数据库产品.
<%else%>
<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>数据库名</td>
    <td height="21">所属父产品</td>
    <td>IP 地址</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <%while not dsphSql.Eof%>
  <%
	Sqltype=dsphSql("Sqltype")
	Set ori_Sql_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist where Sqltype='"&dsphSql("Sqltype")&"'"
		ori_Sql_name.Open Sql,conn,1,1
		if not ori_Sql_name.eof then
Set newname_Sql = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_SqlProductlist_AGN where agent1='"&dsphSql("agent1")&"' and id='"&ori_Sql_name("id")&"'"
		newname_Sql.Open Sql,conn,1,1
if not newname_Sql.eof then
Sqltype=newname_Sql("Sqltype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=Sqltype%> </td>
    <td><a href="searchuser.asp?username=<%=dsphSql("username")%>"><%=dsphSql("username")%></a></td>
    <td><%=dsphSql("sqlname")%></td>
    <td><%
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&dsphSql("byhost")&"' and username='"&dsphSql("username")&"'"
	dsph.Open Sql,conn,1,1
if not dsph.Eof then
nohost=false%>
        <a href="admhost.asp?id=<%=dsphSql("byhost")%>&go=a"><font color="black">虚拟主机(<%=dsph("ftpname")%>)</font></a>
        <%else%>
      无
      <%end if%>
    </td>
    <td><%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serversqllist where id='"&dsphSql ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
%>
        <%=dsserver("ip")%>
        <%dsserver.close%></td>
    <td><%=formatdatetime(dsphSql("starttime"),1)%></td>
    <td><%=formatdatetime(dsphSql("endtime"),1)%></td>
    <td><%if dsphSql("endtime")>NOW then%>
        <%if dsphSql("istest")="y" then%>
        <font color="#FF0000">试用</font>
        <%else%>
        <%=dsphSql("status")%>
        <%end if%>
        <%else%>
        <font color="#FF0000">过期</font>
        <%if dsphSql("status")="暂停" then%>
        <br>
        <font color="#FF0000">暂停</font>
        <%end if%>
        <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="admsql.asp?id=<%=dsphSql("id")%>"><font color="#000000">管理</font></a></td>
  </tr>
  <%
dsphSql.movenext
wend%>
</table>
<%

dsphSql.close
set dsphSql=nothing
end if
%>
<strong><br>
<br>
名下已开通的域名产品:</strong><br>
<%
Set dsdm = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Domain where agent1='"&ds ("username")&"'"
	dsdm.Open Sql,conn,1,1
if dsdm.Eof then%>
没有已开通的域名产品.
<%else%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#000000">
  <tr bgcolor="#C1BFBF">
    <td width="8%" align="center">编号</td>
    <td align="center">用户名</td>
    <td width="15%" align="center">域名</td>
    <td width="12%" align="center">状态</td>
    <td width="13%" align="center">注册时间</td>
    <td width="14%" align="center">到期时间</td>
    <td width="12%" align="center">初始密码</td>
    <td width="9%" align="center">信息</td>
    <td align="center">操作</td>
  </tr>
  <%while not dsdm.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="8%" align="center"><%=dsdm("id")%></td>
    <td align="center"><a href="searchuser.asp?username=<%=dsdm("username")%>"><%=dsdm("username")%></a></td>
    <td width="15%" align="center"><a href="listmydomain.asp?id=<%=dsdm("id")%>" ><font color="#000000"><%=dsdm("Domain")%></font></a></td>
    <td width="12%" align="center"><%if dsdm("endtime")<NOW and dsdm("status")="正常" then%>
      <font color=red>过期</font>
      <%else%>
      <%=dsdm("status")%>
      <%end if%></td>
    <td width="13%" align="center"><%=formatdatetime(dsdm("starttime"),1)%></td>
    <td width="14%" align="center"><%if not isnull(dsdm("endtime")) then%>
        <%=formatdatetime(dsdm("endtime"),1)%>
        <%end if%></td>
    <td width="12%" align="center"><%=dsdm("inipass")%><br>
        <a href="domainpass.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">重置密码</font></a></td>
    <td width="9%" align="center"><%if dsdm("status")="预注册成功" then%>
        <a href="infoa.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">查询</font></a>
        <%else%>
        <a href="domainadm2.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">管理DNS</font></a>
        <%end if%>
    </td>
    <td align="center"><a href="listmydomain.asp?id=<%=dsdm("id")%>" ><font color="#000000">管理</font></a></td>
  </tr>
  <%
dsdm.movenext
wend%>
</table>
<%
dsdm.close
set dsdm=nothing
end if
%>
<br>
<strong>已开通的IDC产品:</strong><br>
<%
Set dsphIDC = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_IDC where agent1='"&ds ("username")&"'"
	dsphIDC.Open Sql,conn,1,1
if dsphIDC.Eof then%>
没有已开通的IDC产品.
<%else%>
<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>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <%while not dsphIDC.Eof%>
  <%
	IDCtype=dsphIDC("IDCtype")
	Set ori_IDC_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCProductlist where IDCtype='"&dsphIDC("IDCtype")&"'"
		ori_IDC_name.Open Sql,conn,1,1
		if not ori_IDC_name.eof then
Set newname_IDC = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_IDCProductlist_AGN where agent1='"&dsphIDC("agent1")&"' and id='"&ori_IDC_name("id")&"'"
		newname_IDC.Open Sql,conn,1,1
if not newname_IDC.eof then
IDCtype=newname_IDC("IDCtype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=IDCtype%> </td>
    <td><%=formatdatetime(dsphIDC("starttime"),1)%></td>
    <td><%=formatdatetime(dsphIDC("endtime"),1)%></td>
    <td><%if dsphIDC("endtime")>NOW then%>
        <%if dsphIDC("istest")="y" then%>
        <font color="#FF0000">试用</font>
        <%else%>
        <%=dsphIDC("status")%>
        <%end if%>
        <%else%>
        <font color="#FF0000">过期</font>
        <%if dsphIDC("status")="暂停" then%>
        <br>
        <font color="#FF0000">暂停</font>
        <%end if%>
        <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="/user/idcadm.asp?id=<%=dsphIDC("id")%>"><font color="#000000">管理</font></a></td>
  </tr>
  <%
dsphIDC.movenext
wend%>
</table>
<%
dsphIDC.close
set dsphIDC=nothing
end if
%>


<br>
  <strong>已开通的云服务器产品:</strong><br>
  <%
Set dsphVPS = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_VPS where agent1='"&ds ("username")&"'"
	dsphVPS.Open Sql,conn,1,1
if dsphVPS.Eof then%>
  没有已开通的云服务器产品.
  <%else%>

 <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>已分配IP</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
<%while not dsphVPS.Eof%>
<%
	vpstype=dsphVPS("vpstype")
	Set ori_VPS_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_VPSProductlist where vpstype='"&dsphVPS("vpstype")&"'"
		ori_VPS_name.Open Sql,conn,1,1
		if not ori_VPS_name.eof then
Set newname_VPS = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_VPSProductlist_AGN where agent1='"&dsphVPS("agent1")&"' and id='"&ori_VPS_name("id")&"'"
		newname_VPS.Open Sql,conn,1,1
if not newname_VPS.eof then
vpstype=newname_VPS("vpstype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30">
<%=vpstype%>
</td>
    <td><%=dsphVPS("vpsname")%></td>
    <td><%
	if dsphVPS("isagentpd")=true then%>
      <%=dsphVPS("AgnUpIP")%>
      <%
	else
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_VPS_IP where VPSID="&dsphVPS("id")
		dsX.Open Sql,conn,1,1
while not dsX.eof
%>
      <%=dsX("IP")%> <br>
      <%
if dsX("portstart")>0 then

if isONEip=true then
	Set dsPORTserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ServerPORTlist where id='"&useportserver&"'"
		dsPORTserver.Open Sql,conn,1,1%>
      <%=dsPORTserver("IP")%>(公网)<br>
      <%end if	

end if
dsX.movenext
wend
end if
%></td>
    <td><%=formatdatetime(dsphVPS("starttime"),1)%></td>
    <td><%=formatdatetime(dsphVPS("endtime"),1)%></td>
    <td><%if dsphVPS("endtime")>NOW then%>
      <%if dsphVPS("istest")="y" then%>
      <font color="#FF0000">试用</font><%else%>
      <%=dsphVPS("status")%>
      <%end if%>
      <%else%>
      <font color="#FF0000">过期</font>
      <%if dsphVPS("status")="暂停" then%>
      <br>
      <font color="#FF0000">暂停</font>
      <%end if%>
      <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="admvps.asp?id=<%=dsphVPS("id")%>"><font color="#000000">管理</font></a></td>
  </tr>
<%
dsphVPS.movenext
wend%>
</table> 
  <%

dsphVPS.close
set dsphVPS=nothing
end if
%>


  <br>
  <strong>已开通的CDN产品:</strong><br>
  <%
Set dsphCDN = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_CDN where agent1='"&ds ("username")&"'"
	dsphCDN.Open Sql,conn,1,1
if dsphCDN.Eof then%>
没有已开通的CDN产品.
<%else%>
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#333333">
  <tr bgcolor="#C1BFBF" align="center">
    <td height="21">产品类型</td>
    <td>CDN名</td>
    <td>域名</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <%while not dsphCDN.Eof%>
  <%
	CDNtype=dsphCDN("CDNtype")
	Set ori_CDN_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist where CDNtype='"&dsphCDN("CDNtype")&"'"
		ori_CDN_name.Open Sql,conn,1,1
		if not ori_CDN_name.eof then
Set newname_CDN = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_CDNProductlist_AGN where agent1='"&dsphCDN("agent1")&"' and id='"&ori_CDN_name("id")&"'"
		newname_CDN.Open Sql,conn,1,1
if not newname_CDN.eof then
CDNtype=newname_CDN("CDNtype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=CDNtype%> </td>
    <td><%=dsphCDN("ftpname")%></td>
    <td><%
hostname=dsphCDN("hostname")
If IsNull(dsphCDN("hostname")) Then hostname=""
'hostname=replace(hostname, ":80:","")
hostname_arry=Split(hostname, ",")

for idname=0 to ubound(hostname_arry)
domary=Split(hostname_arry(idname),":")
domain=domary(2)
%>
        <a href="http://<%=domain%>" target="_blank">
        <%if ComX.actoidc_7i24_com(cstr(domain))<>domain then%>
        <%=ComX.actoidc_7i24_com(cstr(domain))%> (<%=domain%>)
        <%else%>
        <%=domain%>
        <%end if%>
        (端口:<%=domary(1)%> IP:<%=domary(0)%>)</a><br>
        <%next%>
    </td>
    <td><%=formatdatetime(dsphCDN("starttime"),1)%></td>
    <td><%=formatdatetime(dsphCDN("endtime"),1)%></td>
    <td><%if dsphCDN("endtime")>NOW then%>
        <%if dsphCDN("istest")="y" then%>
        <font color="#FF0000">试用</font>
        <%else%>
        <%=dsphCDN("status")%>
        <%end if%>
        <%else%>
        <font color="#FF0000">过期</font>
        <%if dsphCDN("status")="暂停" then%>
        <br>
        <font color="#FF0000">暂停</font>
        <%end if%>
        <%end if%></td>
    <td bgcolor="#FFFFFF"><a href="admcdn.asp?id=<%=dsphcdn("id")%>"><font color="#000000">管理</font></a><a href="handCDN1.asp?id=<%=dsphCDN("id")%>"></a></td>
  </tr>
  <%
dsphCDN.movenext
wend%>
</table>
<%

dsphCDN.close
set dsphCDN=nothing
end if
%>
  <br>
<strong>已开通的其他类产品:</strong><br>
<%
Set dsphOther = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Other where agent1='"&ds ("username")&"'"
	dsphOther.Open Sql,conn,1,1
if dsphOther.Eof then%>
没有已开通的其他类产品.
<%else%>
<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>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <%while not dsphOther.Eof%>
  <%
	Othertype=dsphOther("Othertype")
	Set ori_Other_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_OtherProductlist where Othertype='"&dsphOther("Othertype")&"'"
		ori_Other_name.Open Sql,conn,1,1
		if not ori_Other_name.eof then
Set newname_Other = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_OtherProductlist_AGN where agent1='"&dsphOther("agent1")&"' and id='"&ori_Other_name("id")&"'"
		newname_Other.Open Sql,conn,1,1
if not newname_Other.eof then
Othertype=newname_Other("Othertype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30"><%=Othertype%> </td>
    <td><%=formatdatetime(dsphOther("starttime"),1)%></td>
    <td><%=formatdatetime(dsphOther("endtime"),1)%></td>
    <td><%if dsphOther("endtime")>NOW then%>
        <%if dsphOther("istest")="y" then%>
        <font color="#FF0000">试用</font>
        <%else%>
        <%=dsphOther("status")%>
        <%end if%>
        <%else%>
        <font color="#FF0000">过期</font>
        <%if dsphOther("status")="暂停" then%>
        <br>
        <font color="#FF0000">暂停</font>
        <%end if%>
        <%end if%></td>
    <td bgcolor="#FFFFFF"><font color="#000000">管理</font></td>
  </tr>
  <%
dsphOther.movenext
wend%>
</table>
<%
dsphOther.close
set dsphOther=nothing
end if
%>
<strong><br>
财务记录：</strong><br>
<%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_moneylog where isdel is null and (username='"&ds("username")&"' or opusername='"&session("username")&"' or agent1='"&ds("username")&"' or agent2='"&ds("username")&"') order by id desc"
	dsmoney.PageSize = 25
	dsmoney.Open Sql,conn,1,1
if dsmoney.Eof then
%>
<br>
数据库中不存在款项操作记录。
<%
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 dsmoney.RecordCount <> 0 Then dsmoney.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsmoney.PageCount<=10 then
       endini=dsmoney.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="<%=Request.ServerVariables("URL")%>?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="<%=Request.ServerVariables("URL")%>?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsmoney.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="<%=Request.ServerVariables("URL")%>?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>|<%If Clng(pn)<dsmoney.PageCount Then%><a href="<%=Request.ServerVariables("URL")%>?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#B5BECE">
  <tr bgcolor="#CCCCCC">
    <td width="6%" align="center">编号</td>    
    <td width="11%" align="center">用户名</td>
	<td width="11%" align="center">操作人</td>
    <td width="20%" align="center">时间与IP</td>
    <td width="10%" align="center">金额</td>
    <td width="10%" align="center">余额</td>
    <td width="12%" align="center">原因</td>
    <td width="12%" align="center">内部记录</td>
    <td width="11%" align="center">产品</td>
    <td width="7%" align="center">ID</td>
  </tr>
<%
For N=1 To dsmoney.PageSize 
					If dsmoney.RecordCount=0 Then Exit For
%>
  <tr bgcolor="#F2F2F2">
    <td width="6%" align="center"><%=dsmoney("id")%></td>
    <td width="11%" align="center"><a href="searchuser.asp?username=<%=dsmoney("username")%>" target="_blank"><font color="black"><%=dsmoney("username")%></font></a>
      <%if dsmoney("isagent")="y" then%>
      <font color=red>&#8482;</font>
    <%end if%></td>
	<td width="11%" align="center"><a href="searchuser.asp?username=<%=dsmoney("opusername")%>" target="_blank"><font color="black"><%=dsmoney("opusername")%></font></a></td>
    <td width="20%" align="center"><%=dsmoney("attime")%><br>
    <%=dsmoney("ip")%></td>
    <td width="10%" align="center"><a href="moneyshow.asp?id=<%=dsmoney("id")%>"><font color="black">
    <%if dsmoney("isadd")="y" then%>+<%elseif dsmoney("isadd")="n" then%>-<%end if%><%=replace(formatNumber(dsmoney("usermoney"),2,-1),".00","")%> 元</font></a></td>
    <td width="10%" align="center"><a href="moneyshow.asp?id=<%=dsmoney("id")%>"><font color="black">
      <%=dsmoney("agnEndmoney")%></font></a></td>
    <td width="12%" align="center"><%=dsmoney("forwhat")%></td>
    <td width="12%" align="center"><%=dsmoney("corewhat")%></td>
    <td width="11%" align="center"><%=dsmoney("whichProduct")%></td>
    <td width="7%" align="center"><%=dsmoney("pdid")%></td>
  </tr>

<%
If clng(pn)=dsmoney.PageCount Then
I = dsmoney.RecordCount - (dsmoney.PageCount-1) * dsmoney.PageSize
If N=I Then Exit For
End If
dsmoney.movenext
Next%>
</table>
<%end if
dsmoney.close
set dsmoney=nothing%>
        
<br>
<br>

<%
ds.movenext
wend
ds.Close
set ds=nothing
conn.Close 
set conn=nothing
%></div>



</td>
            <td width="10" background="img/conmid2.gif">&nbsp;</td>
          </tr>
          <tr>
            <td width="10" height="10"><img src="img/conend1.gif" width="10" height="10"></td>
            <td height="10" background="img/conend2.gif"></td>
            <td width="10" height="10"><img src="img/conend3.gif" width="10" height="10"></td>
          </tr>
        </table>
 

<%=htmlwrite("html7")%>
<%end if


if ef then
Response.Redirect "e.asp?e="&ec
end if%>
