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

<%

'uroomid,uface,unick,upaylevelcalss,upaynum
if Request.QueryString("ac")="GetFansTop" then 
	RS_End
	dim SumPay,SumIncome,CurrentPage,k,Re,RID,isManager,UID
	if Request.QueryString("rid")="" then RW "var iGFAllRe=""{data:[]}"";var iGFRe=""{data:[]}"";":REND
	if not IsNumeric(Request.QueryString("rid")) then RW "var iGFAllRe=""{data:[]}"";var iGFRe=""{data:[]}"";":REND
	RID = Request.QueryString("rid")
	
	Re="var iGFAllRe=""{data:["
	Set RS=DB_CONN.EXECUTE("select top 6 sum([sumpay]) as [allsumpay],[uRoomID],[i_User_NickName],[i_User_Face],[i_User_PayNum],(select [i_User_PaymentLevel_Style] from [i_User_PaymentLevel] where [i_User_PayNum]>=[i_User_PaymentLevel_MinNum] and [i_User_PayNum]<[i_User_PaymentLevel_MaxNum]) as [payclass] from (select (b.[i_User_Gift_SendRecord_GiftNum]*(select [i_User_Gift_Price] from [i_User_Gift] where [i_User_Gift_ID]=b.[i_User_Gift_SendRecord_GiftID]) ) as [sumpay],a.[i_User_ID],a.[i_User_NickName],a.[i_User_PayNum],a.[i_User_Face],(select top 1 [i_Sys_Room_ID] from [i_Sys_Room] where [i_Sys_Room_AdminUserID]=a.[i_User_ID]) as 'uRoomID'  from [i_User_Info] a join [i_User_Gift_SendRecord] b on a.[i_User_ID]=b.[i_User_Gift_SendRecord_UID] where [i_User_Gift_SendRecord_GUID]="&RID&" group by a.[i_User_ID],a.[i_User_NickName],a.[i_User_PayNum],a.[i_User_Face],b.[i_User_Gift_SendRecord_GiftID],b.[i_User_Gift_SendRecord_GiftNum]) a group by [i_User_ID],[uRoomID],[i_User_NickName],[i_User_Face],[i_User_PayNum] order by [allsumpay] desc")
	while (not RS.eof)
		if k>0 then Re=Re&","		
		Re=Re&"{uroomid:'"&RS("uRoomID")&"',uface:'"&RS("i_User_Face")&"',unick:'"&RS("i_User_NickName")&"',upaylevelcalss:'"&RS("payclass")&"',upaynum:'"&RS("allsumpay")&"'}"
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RS_End
	Re=Re&"var iGFRe=""{data:["
	Set RS=DB_CONN.EXECUTE("select top 6 sum([sumpay]) as [allsumpay],[uRoomID],[i_User_NickName],[i_User_Face],[i_User_PayNum],(select [i_User_PaymentLevel_Style] from [i_User_PaymentLevel] where [i_User_PayNum]>=[i_User_PaymentLevel_MinNum] and [i_User_PayNum]<[i_User_PaymentLevel_MaxNum]) as [payclass] from (select (b.[i_User_Gift_SendRecord_GiftNum]*(select [i_User_Gift_Price] from [i_User_Gift] where [i_User_Gift_ID]=b.[i_User_Gift_SendRecord_GiftID]) ) as [sumpay],a.[i_User_ID],a.[i_User_NickName],a.[i_User_PayNum],a.[i_User_Face],(select [i_Sys_Room_ID] from [i_Sys_Room] where [i_Sys_Room_AdminUserID]=a.[i_User_ID]) as 'uRoomID'  from [i_User_Info] a join [i_User_Gift_SendRecord] b on a.[i_User_ID]=b.[i_User_Gift_SendRecord_UID] where [i_User_Gift_SendRecord_GUID]="&RID&" and DATEDIFF(d,[i_User_Gift_SendRecord_Time],getdate())<30 group by a.[i_User_ID],a.[i_User_NickName],a.[i_User_PayNum],a.[i_User_Face],b.[i_User_Gift_SendRecord_GiftID],b.[i_User_Gift_SendRecord_GiftNum]) a group by [i_User_ID],[uRoomID],[i_User_NickName],[i_User_Face],[i_User_PayNum] order by [allsumpay] desc")
	k=0
	while (not RS.eof)
		if k>0 then Re=Re&","		
		Re=Re&"{uroomid:'"&RS("uRoomID")&"',uface:'"&RS("i_User_Face")&"',unick:'"&RS("i_User_NickName")&"',upaylevelcalss:'"&RS("payclass")&"',upaynum:'"&RS("allsumpay")&"'}"
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RW Re
	Rend
end if



%>