<!--#include file="conn.asp"-->
<!--#include file="ajax_cart_set.asp"-->
<%
productId=request.form("productId")
pro_color_id=request.form("colorId")
pro_size_id=request.form("sizeId")
pro_color=request.form("aaa")
pro_size=request.form("bbb")


'//收藏，判断是否存在
if session("user_xxx_name")<>"" then
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select username,shopxpptid from com_fav where username='"&username&"' and shopxpptid="&productId&"",conn,1,1
	if not rs.eof and not rs.bof then
		response.Write "{""result"":""success"",""data"":{""isLogin"":true,""isExist"":true}}"
		'response.Write("对不起，此商品已存在于您的收藏架中，不可以重复添加！")
		response.end
		rs.close
		set rs=nothing
	else
				rs.close
				set rs=nothing
				'//添加收藏
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select shopxpptid,userid,username from com_fav",conn,1,3
				rs.addnew
				rs("shopxpptid")=productId
				rs("username")=username
				rs("userid")=session("UserID")
				rs.update
                rs.close
	response.Write "{""result"":""success"",""data"":{""isLogin"":true,""isExist"":false}}"
	end if
else
response.Write "{""result"":""success"",""data"":{""isLogin"":false,""isExist"":false}}"
end if
%>
