<!--#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")="SendSysTip" then 
	dim RGuid,RGunick,GiftID,GiftNum,StoreMoney,GiftPrice,GiftSumParice,GiftName,TipWords,TipHref
	if Request.QueryString("TipWords")="" then REND
	TipWords=vbsEscape(ClearHtml(Request.QueryString("TipWords")))
	TipHref=vbsEscape(ClearHtml(Request.QueryString("TipHref")))
	if Session(Session_UserID_Arg)="" then RW "var SysTipRe='操作超时请重新登录！';":Rend
	RS_End
	StoreMoney = Clng(GUInfo("i_User_Money"))
	RS_End
	GiftPrice = SysConfig("i_Sys_Config_SysTipMoney")
	GiftSumParice = Clng(GiftPrice)
	if StoreMoney<GiftSumParice then RW "var SysTipRe='余额不足，请充值！';":Rend
	RS_End
	RS.Open "select * from [i_User_Info] where [i_User_ID]="&Session(Session_UserID_Arg), DB_CONN , 1 , 3
		RS("i_User_Money")=StoreMoney-GiftSumParice
		RS("i_User_PayNum")=Clng(RS("i_User_PayNum"))+GiftSumParice
		RS.Update()
		InsertSysTip TipWords,TipHref
		RecordConsume GiftSumParice,0," 发送一次广播，支出"&Trim(Cstr(GiftSumParice)),Session(Session_UserID_Arg)
		RW "var SysTipRe=true;var Money="&StoreMoney-GiftSumParice&";"
	RS_End
	Rend
end if

function InsertSysTip(TipWords,TipHref)
	dim TipRS
	set TipRS = Server.CreateObject("ADODB.Recordset")
	TipRS.Open "select top 1 * from [i_Sys_Tip]", DB_CONN , 1 , 3
	TipRS.addnew()
		TipRS("i_Sys_Tip_Name")=Session(Session_UserNickName_Arg)
		TipRS("i_Sys_Tip_UID")=session(Session_UserID_Arg)
		TipRS("i_Sys_Tip_Words")=TipWords
		TipRS("i_Sys_Tip_Href")=TipHref
	TipRS.Update()
	TipRS.Close()
end function

%>