<%@ 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
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>　财务记录
<%=htmlwrite("html3")%>
<br>
      
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#EEEEEE">
            <td width="14%" height="30" align="center">分类</td>
            <td width="11%" height="30" align="center">入款</td>
            <td width="11%" height="30" align="center">消费</td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="14%" height="25" align="center" bgcolor="#FFFFFF">今天统计</td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=y&starttime=<%=date%>&endtime=<%=DateAdd("d",1,date)%>">
            <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='y' and isnew='y' and isdel is null and isadd='y' and (attime>'"&date&"')"
'If session("AgnRunasUser") then	Sql="Select * from FreeHost.FreeHost_moneylog where (opusername='"&session("agentname")&"' or agnusername='"&session("agentname")&"' or agent1='"&session("agentname")&"' or agent2='"&session("agentname")&"') and isnew='y' and isdel is null order by id desc"
	dsmoney.Open Sql,conn,1,1
	response.Write fix(dsmoney(0))
%> 
            元
          </a></td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=n&starttime=<%=date%>&endtime=<%=DateAdd("d",1,date)%>">
              <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='y' and isnew='y' and isdel is null and isadd='n' and (attime>'"&date&"')"
'If session("AgnRunasUser") then	Sql="Select * from FreeHost.FreeHost_moneylog where (opusername='"&session("agentname")&"' or agnusername='"&session("agentname")&"' or agent1='"&session("agentname")&"' or agent2='"&session("agentname")&"') and isnew='y' and isdel is null order by id desc"
	dsmoney.Open Sql,conn,1,1
	response.Write Fix(dsmoney(0))
%>
元 </a></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="14%" height="25" align="center" bgcolor="#FFFFFF">本月统计</td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=y&starttime=<%=Year(now)&"-"&Month(now)&"-1"%>&endtime=<%=DateAdd("d",1,date)%>">
            <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='y' and isnew='y' and isdel is null and isadd='y' and (attime>'"&Year(now)&"-"&Month(now)&"-1' )"
'response.write sql
	dsmoney.Open Sql,conn,1,1
	response.Write fix(dsmoney(0))
%> 
            元</a></td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=n&starttime=<%=Year(now)&"-"&Month(now)&"-1"%>&endtime=<%=DateAdd("d",1,date)%>">
              <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='y' and isnew='y' and isdel is null and isadd='n' and (attime>'"&Year(now)&"-"&Month(now)&"-1' )"
'response.write sql
	dsmoney.Open Sql,conn,1,1
	response.Write fix(dsmoney(0))
%>
元</a></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="14%" height="25" align="center" bgcolor="#FFFFFF">总额统计</td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=y">
            <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='n' and isnew='y' and isdel is null and isadd='y'"
'response.write sql
	dsmoney.Open Sql,conn,1,1
	response.Write fix(dsmoney(0))
%> 
            元</a></td>
            <td width="11%" align="center"><a href="moneylist.asp?isadd=n">
              <%
	Set dsmoney = Server.CreateObject("ADODB.Recordset")	
	Sql="Select sum(abs(usermoney)) from FreeHost.FreeHost_moneylog where norusername='"&session ("username")&"' and isuser='n' and isnew='y' and isdel is null and isadd='n'"
'response.write sql
	dsmoney.Open Sql,conn,1,1
	response.Write fix(dsmoney(0))
%>
元</a></td>
          </tr>


</table>
<br>
这儿的统计记录只统计作为普通用户的财务记录，并不包含作为代理商的统计，代理商的财务统计请在代理区查看，由于财务结构升级过，以上数据仅供参考，财务信息以<a href="moneylist.asp">财务流水</a>为准。 <a href="moneylist.asp">[返回]</a><br>

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