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

<%
Auto_Login2()

if Request.QueryString("ac")="GetSysGiftRecord" then 
	if Request.QueryString("n")="" then RW "var SGRe=""{data:[]}"";":REND
	if not IsNumeric(Request.QueryString("n")) then RW "var SGRe=""{data:[]}"";":REND
	dim SumPay,SumIncome,CurrentPage,k,Re,t,runick
	t = Request.QueryString("n")
	RS_End
	Re="var SGRe=""{data:["
	Set RS=DB_CONN.EXECUTE("select top "&t&" *,(select top 1 [i_User_NickName] from [i_User_Info] where [i_User_ID]=[i_User_Gift_SendRecord_UID]) as 'sunick',(select top 1 [i_Sys_Room_ID] from [i_Sys_Room] where [i_Sys_Room_AdminUserID]=[i_User_Gift_SendRecord_UID]) as 'suid',(select top 1 [i_User_NickName] from [i_User_Info] where [i_User_ID]=[i_User_Gift_SendRecord_GUID]) as 'runick',(select top 1 [i_Sys_Room_ID] from [i_Sys_Room] where [i_Sys_Room_AdminUserID]=[i_User_Gift_SendRecord_GUID]) as 'ruid' from [i_User_Gift_SendRecord] a join [i_User_Gift] b on a.[i_User_Gift_SendRecord_GiftID]=b.[i_User_Gift_ID]  where (select count(*) from [i_user_Info] where [i_user_ID]=[i_User_Gift_SendRecord_UID] )>0  order by [i_User_Gift_SendRecord_Time] desc")
	while (not RS.eof )
		if k>0 then Re=Re&","
		if isnull(RS("ruid")) or RS("ruid")=0 then 
			runick="大家"
		else
			runick=RS("runick")
		end if
		Re=Re&"{stime:'"&formatdate(RS("i_User_Gift_SendRecord_Time"),"14")&"',sunick:'"&RS("sunick")&"',suid:'"&RS("suid")&"',runick:'"&runick&"',ruid:'"&RS("ruid")&"',sgiftcount:'"&RS("i_User_Gift_SendRecord_GiftNum")&"',sgiftname:'"&RS("i_User_Gift_Name")&"',sgiftclass:'"&RS("i_User_Gift_Class")&"'}"
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RS_End
	RW Re
	Rend
end if

%>