<!--#include file="conn.asp"-->
<!--#include file="ajax_cart_set.asp"-->


<%
act=request.QueryString("act")
shopxpptid=request.QueryString("proid")
num=request.QueryString("num")
pro_color=vbsUnEscape(request.QueryString("color"))
pro_size=vbsUnEscape(request.QueryString("size"))
p_color_id=request.QueryString("p_color_id")
p_size_id=request.QueryString("p_size_id")
%>

<%
select case act
case "add_goods"
%>
<!--#include file="ajax_cart_add.asp"-->


<%
case "show_goods_num"

	set rs=server.CreateObject("adodb.recordset")
	rs.open "select shopxp_action.shopxpacid,shopxp_action.shopxpptid,shopxp_action.productcount,shopxp_action.zonger from com_books inner join  shopxp_action on com_books.id=shopxp_action.shopxpptid where shopxp_action.username='"&username&"'  and shopxp_action.zhuangtai=9",conn,1,1 
	shuliang=rs.recordcount
	jianshu=0
	zongji=0
	do while not rs.eof
	bookiid=rs("shopxpptid")
	jianshu=jianshu+rs("productcount")
	zongji=zongji+rs("zonger")
	rs.movenext
	loop
	session("S[CART_COUNT]")=shuliang
	'response.write "添加成功，感谢你的购买，目前选购商品共["&shuliang&"]款["&jianshu&"]件 合计:￥"&Formatnumber(zongji,2,-1,-1,0)
	response.write "{""result"":""success"",""data"":{""privilegeProductHtml"":""SHOWPRO"",""shoppingCartQuantity"":"&jianshu&",""shoppingCartPrice"":"&Formatnumber(zongji,2,-1,-1,0)&"}}"
	
	rs.close
	set rs=nothing
	
%>

<%
case "getTopCartData"

	set rs=server.CreateObject("adodb.recordset")
	rs.open "select shopxp_action.shopxpacid,shopxp_action.shopxpptid,shopxp_action.productcount,shopxp_action.zonger from com_books inner join  shopxp_action on com_books.id=shopxp_action.shopxpptid where shopxp_action.username='"&username&"'  and shopxp_action.zhuangtai=9",conn,1,1 
	shuliang=rs.recordcount
	jianshu=0
	zongji=0
	do while not rs.eof
	bookiid=rs("shopxpptid")
	jianshu=jianshu+rs("productcount")
	zongji=zongji+rs("zonger")
	rs.movenext
	loop
	session("S[CART_COUNT]")=shuliang
	'response.write "添加成功，感谢你的购买，目前选购商品共["&shuliang&"]款["&jianshu&"]件 合计:￥"&Formatnumber(zongji,2,-1,-1,0)
	response.write jianshu
	
	rs.close
	set rs=nothing
	
%>

<%
case else
	response.write ""
end select
%>
