<%@ Language=VBScript %>
<%
If session("username")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
If session("HOSTAUID")<>"" Then ec="主机面板中不能操作用户区的内容，请您先登陆用户区。"
If session("EmailAUID")<>"" Then ec="邮箱面板中不能操作用户区的内容，请您先登陆用户区。"
If session("SQLAUID")<>"" Then ec="数据库面板中不能操作用户区的内容，请您先登陆用户区。"
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_USER where username='"&session("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsreg.Open Sql,conn,1,1
If dsreg.Eof Then
		ef=True
		ec="会员名不存在或密码出错了！"
end if
end if

if not ef then
session("usermoney")=dsreg("usermoney")
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>　财务记录
<%=htmlwrite("html3")%>
<br>
您当前的可用金额：<%if session("usermoney")<1 then%>0<%end if%><%=session("usermoney")%> 元 <%if session("agentname")=session("username") then%>您同时是代理，这儿的可用金额只代表您作为用户的可用金额，作为代理的可用金额请到代理区查看。<%end if%><br>
<%Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_moneylog where username='"&session ("username")&"' and usermoney<>0 and isnew is null order by id desc"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	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
%><br>

<%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>页 
        　共<%=dsmoney.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>">上一页</a><%End If%>|<%If Clng(pn)<dsmoney.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 bgcolor="#CCCCCC">
            <td width="6%" align="center">编号</td>
            <td width="11%" align="center">用户名</td>
            <td width="20%" align="center">时间</td>
            <td width="10%" align="center">金额</td>
            <td width="24%" 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
%>
<%if not instr(dsmoney("forwhat"),"代理收入")>0 or not instr(dsmoney("forwhat"),"代理返回收入")>0 then%>
          <tr bgcolor="#EEEEEE">
            <td width="6%" align="center"><%=dsmoney("id")%></td>
            <td width="11%" align="center"><%=dsmoney("username")%></td>
            <td width="20%" align="center"><%=dsmoney("attime")%></td>
            <td width="10%" align="center"><%=dsmoney("usermoney")%> 元</td>
            <td width="24%" align="center"><%=dsmoney("forwhat")%></td>
            <td width="11%" align="center"><%=dsmoney("whichProduct")%></td>
            <td width="7%" align="center"><%=dsmoney("pdid")%></td>
          </tr>
        
<%end if
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>

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