productpinglun_inc.asp

来自「网店批发系统,很好很强大,很好很强大很好很强大」· ASP 代码 · 共 53 行

ASP
53
字号
<%
	call CheckType(39)	
	dim rs,i,j,Pinglun,PinglunNum,PageNum,PageEnd,DataNum,DataName,action,ID
	dim MsgTo,MsgContent,Timenow,ProductID,lx
	
	PageNum = 20
	DataName = "条评论"
	PinglunNum = 0
	
	action = sqlchg(Request.QueryString("action"))
	ID =Sqlcheck(Request.QueryString("ID"))
	ProductID =Sqlcheck(Request.QueryString("ProductID"))
	MsgTo =sqlchg(Request.QueryString("MsgTo"))
	MsgContent =sqlchg(Request.Form("MsgContent"))
	lx =sqlchg(Request.QueryString("lx"))
	if lx = "" then
		lx = 0
	end if
	
	Timenow = now()
	
	if action = "save" then
		conn.execute("insert into Message (MsgFrom,MsgTo,MsgContent,MsgDate,ProductID,MsgType,ReUserName) values ('管理员','"&ID&"','"&MsgContent&"','"&Timenow&"',"&Cint(ProductID)&",1,'"&MsgTo&"')")
		'给标记
		conn.execute("Update Message set MsgReFlag = 1 where MsgID = "&ID&"")
		Response.Write("<script language='javascript'>alert('回复成功');window.location.href='productPinglun.asp?lx="&lx&"';</script>")
		Response.End()
	end if
	
	if action = "del" then
		conn.execute("Delete from Message where MsgID = "&ID&"")
		Response.Write("<script language='javascript'>alert('删除成功');window.location.href='productPinglun.asp?lx="&lx&"';</script>")
		Response.End()
	end if
	
	if lx = 0 or lx = "" then
		set rs = conn.execute("Select m.MsgID,p.ProductName,m.MsgFrom,m.MsgDate,p.ProductID,m.MsgContent from Message m inner join Product p on m.ProductID = p.ProductID where m.MsgType = 1 and m.MsgFrom <> '管理员' order by m.MsgID desc")
	elseif lx = 1 then
		set rs = conn.execute("Select m.MsgID,p.ProductName,m.MsgFrom,m.MsgDate,p.ProductID,m.MsgContent from Message m inner join Product p on m.ProductID = p.ProductID where m.MsgType = 1 and m.MsgFrom <> '管理员' and m.MsgReFlag = 1 order by m.MsgID desc")
	elseif lx = 2 then
		set rs = conn.execute("Select m.MsgID,p.ProductName,m.MsgFrom,m.MsgDate,p.ProductID,m.MsgContent from Message m inner join Product p on m.ProductID = p.ProductID where m.MsgType = 1 and m.MsgFrom <> '管理员' and m.MsgReFlag = 0 order by m.MsgID desc")	
	end if
	 
	if not rs.eof then
		Pinglun = rs.getrows
		PinglunNum = ubound(Pinglun,2)
		if not isnumeric(PinglunNum) then
			PinglunNum = 1
		end if
	else
		PinglunNum = -1
	end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?