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

<%
Auto_Login2()

dim CurrentPage,k,Re,tpid
if Request.Form("ac")="add" then 
	if Session(Session_UserID_Arg)="" then RWS "alert('您尚未登录!');history.back(-1);":REND
	if Request.Form("pid")="" then RWS "alert('参数错误!');history.back(-1);":REND
	if not IsNumeric(Request.Form("pid")) then RWS "alert('参数错误!');history.back(-1);":REND
	tpid = Request.Form("pid")
	if Valide_Str_Length(Request.Form("CommentContent"),4,200)=false then RWS "alert('评论内容请介于5到200个字符!');history.back(-1);":REND
	RS_End
	RS.OPEN "select top 1 * from [i_User_Log_Comment]" , DB_CONN , 1 , 3
	RS.addnew()
	RS("i_User_Log_Comment_Content")=vbsEscape(Get_SafeStr(ClearHtml(Request.Form("CommentContent"))))
	RS("i_User_Log_Comment_LogID")=Request.Form("PID")
	RS("i_User_Log_Comment_UID")=Session(Session_UserID_Arg)
	RS.Update()
	RS_End
	DB_CONN.EXECUTE("update [i_User_Log] set [i_User_Log_CommentNum]=[i_User_Log_CommentNum]+1 where [i_User_Log_ID]="&tpid)
	RWS "location.href='"&Request.Form("gourl")&"';"
	Rend
end if

if Request.QueryString("ac")="del" then 
	RS_End
	if Request.QueryString("cid")="" then REND
	if not IsNumeric(Request.QueryString("cid")) then REND
	tcid = Request.QueryString("cid")
	DB_CONN.EXECUTE("delete from [i_User_Log_Comment] where [i_User_Log_Comment_ID]="&tcid)
	RS_End
	Rend
end if
%>