<%temp_shopping_wishlist_add_handle=site.object_p%>
<!-- object[<%=site.object_p%>]::temp_shopping_wishlist_add_handle -->
<%
dim ids_goods
dim i_goods

ids_goods=trim(request("id"))

if ids_goods="" then
	site.Error.info="请选择要加入收藏夹的商品！"
	site.Error.location="back"
	site.Error.err()
end if

ids_goods=replace(ids_goods," ","")

ids_goods=split(ids_goods,",")

for i_goods=0 to ubound(ids_goods)

	site.object(site.object_p).rs.open "select * from jins_customer_wishlist_list where customer_name='"&site.temp.customer.info.reg_name&"' and goods_id="&ids_goods(i_goods)&" ",conn,1,3
	
	if site.object(site.object_p).rs.eof then
		site.object(site.object_p).rs.addnew
		site.object(site.object_p).rs("customer_name")=site.functions.SafeCode(site.temp.customer.info.reg_name,0)
		site.object(site.object_p).rs("customer_wishlist_addtime")=now()
		site.object(site.object_p).rs("goods_id")=ids_goods(i_goods)
		site.object(site.object_p).rs("goods_num")=1
	else
		site.object(site.object_p).rs("goods_num")=site.object(site.object_p).rs("goods_num")+1
	end if
	
	site.object(site.object_p).rs.update
	site.object(site.object_p).rs.close
	
next

set site.object(site.object_p).rs=nothing

site.Error.info="添加商品到收藏夹成功！"
site.Error.location="do.asp?tr=shopping|wishlist"
site.Error.suc()
%>