<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
Response.Redirect "default.asp"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
 Set dsreg = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_AGENT where username='"&session("agentusername")&"'"
		dsreg.Open Sql,conn,1,1
session("agentusermoney")=dsreg("usermoney")
'dsreg.close
'set dsreg=nothing
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>欢迎您光临代理专区！
<%=htmlwrite("html6")%>
<%
	Set dsuser = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and regtime>'"&date&"'"
dsuser.Open Sql,conn,1,1
usercount=dsuser.recordcount
dsuser.close
set dsuser=nothing

If Application("agentcannetpay")=True Then
	Set dsuser2 = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and waitmoney>0"
dsuser2.Open Sql,conn,1,1
usercount2=dsuser2.recordcount
dsuser2.close
set dsuser2=nothing

	Set dsuser3 = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Agent where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and waitmoney>0"
dsuser3.Open Sql,conn,1,1
usercount3=dsuser3.recordcount
dsuser3.close
set dsuser3=nothing
end if
%>
<br>
<br>
<table width="100%" height="70"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td align="center" bgcolor="#FFFFFF">　欢迎　<%if session("agenttype")<>"子代理" then%><%=session("agenttype")%><%end if%>　<font size="+1" face="Arial, Helvetica, sans-serif"><%=session("agentusername")%></font>  　登陆时间：<%=now%> 　可用余额：<strong>
    <%if session("agentusermoney")<1 and session("agentusermoney")<>0 then%>
0
<%end if%>
<%=dsreg("usermoney")%></strong> 元
<%If Application("agentcannetpay")=True and  dsreg("agentdegree")>0 Then%>
，等待入帐金额：<font face="Arial, Helvetica, sans-serif" color=red><%=FormatNumber(dsreg("waitmoney"),2,-1)%> </font>元
<%end if%> 
今天新用户 <a href="admuserlistuser.asp?op=all" target="_blank"><font color="#FF0000"><%=usercount%></font> 个</a>　<%If Application("agentcannetpay")=True Then%><br><br>等待处理的网上支付成功但未入帐名下用户： <a href="admuserlistuser.asp?op=waitmoney" target="_blank"><font color="#FF0000"><%=usercount2%></font> 个</a>　等待处理的网上支付成功但未入帐名下代理： <a href="admuserlistagent.asp?op=waitmoney" target="_blank"><font color="#FF0000"><%=usercount3%></font> 个</a><%end if%> </td>
  </tr>
</table>
<br>
<br> 
内部通知：
<%


	Set dslogin = Server.CreateObject("ADODB.Recordset")	
	Sql="Select top 10 * from FreeHost.FreeHost_News where type2=100 order by id desc"
if dsreg("agentdegree")=0 then 	Sql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and (type2=103 or type2=104))  order by id desc" '直接用户
if dsreg("agentdegree")>0 then 	Sql="Select top 10 * from FreeHost.FreeHost_News where (username='freehost' and  (type2=103 or type2=105)) order by id desc" '代理名下用户
'response.write sql
'	dslogin.PageSize = 10
	dslogin.Open Sql,conn,1,1
if dslogin.Eof then
%>
        <br><br>
数据库中不存在内部通知。
<%else%>
　

        <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#EEEEEE">
            <td width="19%" height="29" align="center" bgcolor="#EEEEEE">编号</td>
            <td width="38%" align="center">标题</td>
            <td width="20%" align="center">时间</td>
          </tr>
          <%
while not dslogin.eof
%>
          <tr bgcolor="#FFFFFF">
            <td width="19%" height="20" align="center" bgcolor="#FFFFFF"><%=dslogin("id")%></td>
            <td width="38%" align="center"><a href="/style/info/shownews.asp?id=<%=dslogin("id")%>" target=_blank><font color="#000000"><%=dslogin("title")%></font></a></td>
            <td width="20%" align="center"><%=dslogin("posttime")%><br>
            </td>
          </tr>
          <%

dslogin.movenext
wend%>
        </table>
      <%end if
dslogin.close
set dslogin=nothing%><br>
<br>

登陆记录：
<%


	Set dslogin = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Loginlog where username='"&session("agentusername")&"'  order by logintime desc"
	dslogin.PageSize = 25
	dslogin.Open Sql,conn,1,1
%>
<%
if dslogin.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 dslogin.RecordCount <> 0 Then dslogin.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dslogin.PageCount<=10 then
       endini=dslogin.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>页 
        　共<%=dslogin.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)<dslogin.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr bgcolor="#EEEEEE">
    <td width="6%" height="29" align="center" bgcolor="#EEEEEE">编号</td>    
    <td width="11%" align="center">用户名</td>
	<td width="20%" align="center">时间</td>
    <td width="10%" align="center">登陆IP</td>
  </tr>
<%
For N=1 To dslogin.PageSize 
					If dslogin.RecordCount=0 Then Exit For
%>
  <tr bgcolor="#FFFFFF">
    <td width="6%" height="20" align="center" bgcolor="#FFFFFF"><%=dslogin("id")%></td>
    <td width="11%" align="center"><%=dslogin("username")%></td>
    <td width="20%" align="center"><%=dslogin("logintime")%><br>
    </td>
    <td width="10%" align="center"><%=dslogin("ip")%> </td>
  </tr>
<%
If clng(pn)=dslogin.PageCount Then
I = dslogin.RecordCount - (dslogin.PageCount-1) * dslogin.PageSize
If N=I Then Exit For
End If
dslogin.movenext
Next%>
</table>
<%end if
dslogin.close
set dslogin=nothing%><br>
<br>
<%=htmlwrite("html7")%>
<%
conn.Close
set conn=nothing
end if

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