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

<%
dim pid,xmlre
if Request.QueryString("ac")="del" then 
	RS_End
	if Request.QueryString("pid")="" then REND
	if not IsNumeric(Request.QueryString("pid")) then REND
	pid=Request.QueryString("pid")
	DB_CONN.EXECUTE("delete [i_User_Log] where [i_User_Log_ID]="&pid&" and [i_User_Log_RID]="&Session(Session_RoomID_Arg))
	CreatXml
	RW "pageto(1);"
	Rend
end if

if Request.QueryString("ac")="up" then 
	RS_End
	if Request.QueryString("pid")="" then REND
	if not IsNumeric(Request.QueryString("pid")) then REND
	pid=Request.QueryString("pid")
	RS.OPEN "select top 1 * from [i_User_Log] where [i_User_Log_ID]="&pid&" and [i_User_Log_RID]="&Session(Session_RoomID_Arg) , DB_CONN , 1 , 3
	RS("i_User_Log_Title") = Get_SafeStr(ClearHtml(Request.QueryString("title")))
	RS.Update()
	CreatXml
	RW "pageto(1);"
	Rend
end if

if Request.QueryString("ac")="setshow" then 
	RS_End
	if Request.QueryString("pid")="" then REND
	if not IsNumeric(Request.QueryString("pid")) then REND
	pid=Request.QueryString("pid")
	RS.OPEN "select top 1 * from [i_User_Log] where [i_User_Log_ID]="&pid&" and [i_User_Log_RID]="&Session(Session_RoomID_Arg) , DB_CONN , 1 , 3
	RS("i_User_Log_IsShow") = 1
	RS.Update()
	CreatXml
	RW "pageto(1);"
	Rend
end if

if Request.QueryString("ac")="disshow" then 
	RS_End
	if Request.QueryString("pid")="" then REND
	if not IsNumeric(Request.QueryString("pid")) then REND
	pid=Request.QueryString("pid")
	RS.OPEN "select top 1 * from [i_User_Log] where [i_User_Log_ID]="&pid&" and [i_User_Log_RID]="&Session(Session_RoomID_Arg) , DB_CONN , 1 , 3
	RS("i_User_Log_IsShow") = 0
	RS.Update()
	CreatXml
	RW "pageto(1);"
	Rend
end if

function CreatXml()
	RS_End
	RS.OPEN "select * from [i_User_Log] where [i_User_Log_IsShow]=1 and [i_User_Log_RID]="&Session(Session_RoomID_Arg) , DB_CONN , 1 , 3
	xmlre=xmlre&"<?xml version=""1.0"" encoding=""utf-8""?>"&vbCrLf
	xmlre=xmlre&"<photos>"&vbCrLf
	while (not RS.eof)
		xmlre=xmlre&"<photo desc="""&RS("i_User_Log_Title")&""" url="""&replace(RS("i_User_Log_Pic"),"\/","/")&""" />"&vbCrLf
		RS.MoveNext
	Wend
	xmlre=xmlre&"</photos>"&vbCrLf
	RW "/*"&vbCrLf
	CreatFile "/d/xml/"&Session(Session_RoomID_Arg)&".xml",xmlre
	RW "*/"&vbCrLf
	RS_End
end function
%>