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

<%
Auto_Login2()
'incomeclass,livetime,fansnum,attention,IsManager
dim SumPay,SumIncome,CurrentPage,k,Re,RID,isManager,UID,IsLive,IsOpenRoom
if Request.QueryString("ac")="GetRoomInfo" then 
	RS_End
	IsOpenRoom = ""
	if Cint(SysConfig("i_Sys_Config_OpenRoom"))=0 then IsOpenRoom = " a.[i_User_Signing]=1 and "
	if(Session(Session_UserID_Arg)<>"") then UID=Session(Session_UserID_Arg) else UID="0" end if
	if Request.QueryString("rid")="" then RW "var iRe=""{data:[]}"";":REND
	if not IsNumeric(Request.QueryString("rid")) then RW "var iRe=""{data:[]}"";":REND
	RID = Request.QueryString("rid")
	if isManager>0 then isManager="true" else isManager="false" end if
	Re="var iRe=""{data:["
	Set RS=DB_CONN.EXECUTE("select a.*,isnull(DateDiff(n,a.[i_User_ForUpdateTime],getdate()),100) as IsLive,b.*,(select count(*) from [i_User_Attention] where a.[i_User_ID]=[i_User_Attention_GUID] and [i_User_Attention_UID]="&UID&") as 'attention',(select [i_User_InComeLevel_Style] from [i_User_InComeLevel] where a.[i_User_IncomeNum]>=[i_User_InComeLevel_MinNum] and a.[i_User_IncomeNum]<[i_User_InComeLevel_MaxNum]) as 'incomeclass',(select count(*) from [i_User_Attention] where [i_User_Attention_GUID]=a.[i_User_ID]) as 'fansnum',(select CharIndex('|"&UID&"|',[i_Sys_Room_ManagerUsers])) as 'ismanager',isnull((select CharIndex('|"&UID&"|',[i_Sys_Room_ZBoUsers])),0) as 'isZBo' from [i_User_Info] a join [i_Sys_Room] b on a.[i_User_ID]=b.[i_Sys_Room_AdminUserID] where "&IsOpenRoom&" b.[i_Sys_Room_ID]="&RID)
	if RS.recordcount<1 then RW "location.href='/404.html';":REND
	isManager = RS("ismanager")
	IsLive = RS("IsLive")
	if(Cstr(RS("i_User_isStop"))="1") then
		IsLive = "10"
	end if
	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&"{islive:"&IsLive&",isHiFi:'"&RS("i_User_isHiFi")&"',record:'"&RS("i_Sys_Room_Record")&"',incomeclass:'"&RS("incomeclass")&"',uid:'"&RS("i_User_ID")&"',livetime:'"&RS("i_User_LastLiveTime")&"',fansnum:'"&RS("fansnum")&"',attention:"&RS("attention")&",isZBo:"&RS("isZBo")&",IsManager:"&isManager&",PayNum:"&RS("i_Sys_Room_Pay")&"}"
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RS_End
	RW Re
	Rend
elseif Request.QueryString("ac")="GetGroupRoomInfo" then
	RS_End
	if(Session(Session_UserID_Arg)<>"") then UID=Session(Session_UserID_Arg) else UID="0" end if
	if Request.QueryString("rid")="" then RW "var iRe=""{data:[]}"";":REND
	if not IsNumeric(Request.QueryString("rid")) then RW "var iRe=""{data:[]}"";":REND
	RID = Request.QueryString("rid")
	if isManager>0 then isManager="true" else isManager="false" end if
	Re="var iRe=""{data:["
	Set RS=DB_CONN.EXECUTE("select a.*,isnull(DateDiff(n,a.[i_User_ForUpdateTime],getdate()),100) as IsLive,isnull(DateDiff(n,b.[i_Sys_Room_Mic02_UpForTime],getdate()),100) as 'Mic02_IsLive',isnull(DateDiff(n,b.[i_Sys_Room_Mic03_UpForTime],getdate()),100) as 'Mic03_IsLive',b.* from [i_User_Info] a join [i_Sys_Room] b on a.[i_User_ID]=b.[i_Sys_Room_AdminUserID] where b.[i_Sys_Room_ID]="&RID)
	
	if RS.recordcount<1 then RW "location.href='/404.html';":REND
	IsLive = RS("IsLive")
	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&"{islive:"&IsLive&",Mic02_IsLive:"&RS("Mic02_IsLive")&",Mic03_IsLive:"&RS("Mic03_IsLive")&",isHiFi:'"&RS("i_User_isHiFi")&"',record:'"&RS("i_Sys_Room_Record")&"'}"
		k=k+1
		RS.MoveNext
	Wend
	Re=Re&"]}"";"
	RS_End
	RW Re
	Rend
end if



%>