<!--#include file="../inc/DAL.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/page.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS,wherestr,sumnum
wherestr=""
sumnum=0
if request.QueryString("type")="d" then
	wherestr=" and DATEDIFF(d,[i_User_ConsumeRecord_Time],getdate())<1 "
elseif request.QueryString("type")="m" then
	wherestr=" and DATEDIFF(m,[i_User_ConsumeRecord_Time],getdate())<1 "
end if
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
Set ConfigRS=DB_CONN.EXECUTE("select (select sum([i_User_ConsumeRecord_InComeNum]) as [sumnum] from [i_User_ConsumeRecord] where [i_User_ConsumeRecord_Type]=0 and [i_User_ConsumeRecord_UID]="&request.QueryString("uid")&" and [i_User_ConsumeRecord_InComeNum]>0 "&wherestr&") as [sumnum],* from [i_User_ConsumeRecord] where [i_User_ConsumeRecord_Type]=0 and [i_User_ConsumeRecord_UID]="&request.QueryString("uid")&" and [i_User_ConsumeRecord_InComeNum]>0 "&wherestr&" group by [i_User_ConsumeRecord_ID],[i_User_ConsumeRecord_UID],[i_User_ConsumeRecord_Type],[i_User_ConsumeRecord_PayNum],[i_User_ConsumeRecord_InComeNum],[i_User_ConsumeRecord_Time],[i_User_ConsumeRecord_Store],[i_User_ConsumeRecord_Note]  order by [i_User_ConsumeRecord_Time] desc")

ConfigRS.pagesize=20
if isempty(request("page")) or request("page")="" then curpage=1 else curpage=Cint(request("page")) end if
if not ConfigRS.eof then 
	ConfigRS.absolutepage = curpage
	sumnum=ConfigRS("sumnum")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ImChat v1.5 Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
<link href="/i/v1/css/level.css" rel="stylesheet" type="text/css" />
<style>
.JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
.JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
</style>
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>用户【<%=tGUInfo(request.QueryString("uid"),"i_User_NickName")%>】收入记录&nbsp;&nbsp;&nbsp;<a href="incomeinfo.asp?uid=<%=request.QueryString("uid")%>&type=d" style="text-decoration:none;">当日</a>&nbsp;&nbsp;&nbsp;<a href="incomeinfo.asp?uid=<%=request.QueryString("uid")%>&type=m" style="text-decoration:none;">当月</a>&nbsp;&nbsp;&nbsp;<a href="payinfo.asp?uid=<%=request.QueryString("uid")%>" style="text-decoration:none;">消费记录</a>&nbsp;&nbsp;&nbsp;<a href="javascript:\\;" onclick="location.reload();" style="text-decoration:none;">刷新</a></h2>
    </div>
    <div class="contentbox">
        <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
            <th colspan="10">收入记录,合计收入：&nbsp;<%=sumnum%></th>
            <tr>
                <td>ID</td>
                <td>用户名</td>
                <td>昵称</td>
                <td>收入</td>
                <td>消费信息</td>
                <td>时间</td>
                <td>操作</td>
            </tr>
            <%
            dim iPage 
            while (not ConfigRS.eof and iPage<ConfigRS.pagesize )
            %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_User_ConsumeRecord_UID")%></td>
                <td>&nbsp;<a href="EditUser.asp?UID=<%=ConfigRS("i_User_ConsumeRecord_UID")%>"><%=tGUInfo(ConfigRS("i_User_ConsumeRecord_UID"),"i_User_Name")%></a></td>
                <td>&nbsp;<%=tGUInfo(ConfigRS("i_User_ConsumeRecord_UID"),"i_User_NickName")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_ConsumeRecord_InComeNum")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_ConsumeRecord_Note")%></td>
                <td>&nbsp;<%=ConfigRS("i_User_ConsumeRecord_Time")%></td>
                <td>&nbsp;<a href="EditUser.asp?UID=<%=ConfigRS("i_User_ConsumeRecord_UID")%>">查看账号</a>
                </td>
            </tr>
            <%
            iPage=iPage+1
            ConfigRS.MoveNext
            wend
            %>
            <tr>
                <td colspan="10"><%=ExportPageInfo(ConfigRS,curpage,iPage,"Pay_Manage.asp?1=1"&replace(Request.QueryString,"page","1")&"&")%></td>
            </tr>
        </table>
        
    </div>
</div>
</body>
</html>
