<!--#include file="../inc/Bll.asp"-->
<!--#include file="../inc/Constant.asp"-->
<!--#include file="../inc/Md5.asp"-->
<!--#include file="../inc/App.asp"-->

<%
Auto_Login()

if Request.QueryString("ac")="getconsumerecord" then 
	RS_End
	dim SumPay,SumIncome,CurrentPage,k,Re
	Re="var Re=""{data:["
	Set RS=DB_CONN.EXECUTE("select * from [i_User_ConsumeRecord] where [i_User_ConsumeRecord_UID]="&Session(Session_UserID_Arg)&" order by [i_User_ConsumeRecord_Time] desc")
	RS.pagesize=20
	if isempty(Request.QueryString("page")) or Request.QueryString("page")="" then CurrentPage=1 else CurrentPage=Cint(Request.QueryString("page")) end if
	if not RS.eof then RS.absolutepage = CurrentPage
	while (not RS.eof and k<RS.pagesize )
		if k>0 then Re=Re&","		
		Re=Re&"{d:'"&RS("i_User_ConsumeRecord_Time")&"',p:'"&RS("i_User_ConsumeRecord_PayNum")&"',i:'"&RS("i_User_ConsumeRecord_InComeNum")&"',s:'"&RS("i_User_ConsumeRecord_Store")&"',n:'"&RS("i_User_ConsumeRecord_Note")&"'}"
		SumPay=SumPay+Clng(RS("i_User_ConsumeRecord_PayNum"))
		SumIncome=SumIncome+Clng(RS("i_User_ConsumeRecord_InComeNum"))
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"],recordcount:"&RS.recordcount&",pagenum:"&RS.pagecount&",currentpage:"&CurrentPage&",sumpay:"&SumPay&",sumincome:"&SumIncome&"}"";"
	RS_End
	RW Re
	Rend
end if
%>