<!--#include file="conn.asp"-->
<%
page_title=Eval("about_title"&Language)
page_keywords=Eval("about_keywords"&Language)
page_description=Eval("about_description"&Language)
if page_title="" then
page_title=city_title
page_keywords=city_keywords
page_description=city_description
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=page_title%></title>
<meta name="keywords" content="<%=page_keywords%>" />
<meta name="description" content="<%=page_description%>" />
<!--#include file="top.asp"-->
<!--#include file="header.asp"-->
<%
if session("user_xxx_name")="" then
response.Redirect("login.asp")
end if
%>
<link href="<%=filepath%>inc/mycenter.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/style.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/user.css" type="text/css" rel="stylesheet">

    <div id="wrap">
        <!--container-->
        <div class="main">
            
<!--sidebar-->
<!--#include file="Mb_left.asp"-->

<script type="text/javascript">
                try
                {
                    document.getElementById("User_ProCollection").className = "current"; //控制CSS
                }
                catch(e){}
</script>

<!--sidebar end-->

<script type="text/javascript">
//<![CDATA[

$(function(){

	$("#checkAll").click(function(){
		if($(this).attr("checked")) {
			//$("input[name='checkbox']").attr("checked","true");
			//$("input[name='checkbox']").each(function(){
			//	alert(this.id)
			//});
			$("input[id^=checkbox_]").each(function(){
				this.checked = true;
			});
		} else {
			$("input[id^=checkbox_]").each(function(){
				this.checked = false;
			});
			//$("input[name='checkbox']").removeAttr("checked"); 
		}
	});
	
	
	$("input[id^=checkbox_]").click(function(){
		if(this.checked) {
			if($("input[id^=checkbox_]").length == 2) {
				$("#checkAll").attr("checked","true");
			}
		} else {
			$("#checkAll").removeAttr("checked"); 
		}
	});
	
});

var batchCancelFavorites = function() {
	var itemIdList = [];
	$("input[id^=checkbox_]").each(function(){
		if (this.checked) {
			var itemId = this.id;
			itemId = itemId.split("_")[1];
			itemIdList.push(itemId);
		}
	});
	if (itemIdList.length > 0 && confirm("确定取消收藏吗？")) {
		cancelFavoritesByIds(itemIdList);
	} else {
		alert("请选择要取消收藏的商品？");
	}
	return;
};

var cancelFavorites = function(itemId) {
	if (itemId && confirm("确定要取消收藏吗")) {
		var array = new Array();
		array[0] = itemId;
		cancelFavoritesByIds(array)
	}
};

var cancelFavoritesByIds = function(itemIdArray) {
	
	var cancelFavoritesForm = $('<form action="ajaxDelFav.asp" method="post"></form>');
    cancelFavoritesForm.append('<input type="hidden" value=\''+itemIdArray+'\' name="ids"/>');
    cancelFavoritesForm.appendTo(document.body).submit();
	return;
};

//]]>
</script>
            <!--main-->
<div class="mainBox">
			<div class="mainContent">
				<h3 class="mainContent_title" style="margin-bottom: 15px">
					<span>收藏夹</span>
				</h3>
				<!--内容-->
				<span style="color: #000; font-weight: bold;">收藏总数：( <span id="lbl_Count" style="color: Red;">2</span> )
				</span>
				<span> <input type="checkbox" id="checkAll" name="checkAll">全选/反选 </span> <span> <a id="lbl_CancleCollect" href="javascript:batchCancelFavorites();"><img src="images/canclecollect.png" alt="取消收藏"></a></span>
				<p></p>

				<table cellspacing="0" cellpadding="0" align="center" border="1" class="listtable margin_bottom10">
					<thead>
						<tr>
							<th width="5%">选择</th>
							<th width="10%">商品图片</th>
							<th width="30%">商品名称</th>
							<th width="10%">原价</th>
							<th width="10%">促销价</th>
							<th width="15%">收藏时间</th>
							<th width="20%">操作</th>
						</tr>
					</thead>

					<tbody>
<%
username=session("user_xxx_name")
'//收藏，判断是否存在
set rs=server.CreateObject("adodb.recordset")
rs.open "select shopxp_action.shopxpacid,shopxp_action.shopxpptid,shopxp_action.productcount,shopxp_action.zonger,com_books.id,com_books.cid,com_books.titlecn,com_books.bookpicm,com_books.titlecn,com_books.shichangjia,com_books.shopxphyjia,com_books.jifeng,com_books.shopxpvjia from com_books inner join  shopxp_action on com_books.id=shopxp_action.shopxpptid where shopxp_action.username='"&username&"' and shopxp_action.zhuangtai=8",conn,1,1 
if not rs.eof and not rs.bof then
do while not rs.eof
%>
								<tr>
	                                <td>
	                                    <input type="checkbox" name="<%=rs("id")%>" id="checkbox_ce8a87f1-f037-4702-abd8-f412202446b6" value="<%=rs("id")%>">
	                                </td>
	                                <td>
	                                    <span id="rpt_DataBind_ctl01_lbl_Img"><img src="../<%=rs("bookpicm")%>" style="width:80px; height:80px;" alt="<%=rs("titlecn")%>"></span>
	                                </td>
	                                <td><a href="products_show.asp?typeid=<%=rs("cid")%>&id=<%=rs("id")%>" title="<%=rs("titlecn")%>" target="_blank">
	                                        <span id="rpt_DataBind_ctl01_lbl_ProName"><%=rs("titlecn")%></span>
	                                    </a>
	                                </td>
	                                <td>
	                                    <font style="color: red; font-weight: bold;">￥<%=Formatnumber(rs("shichangjia"),2,-1,-1,0)%></font>
	                                </td>
	                                <td>
	                                    <font style="color: red; font-weight: bold;">￥<%=Formatnumber(rs("shopxphyjia"),2,-1,-1,0)%></font>
	                                </td>
	                                <td>
	                                    <font style="color: red; font-weight: bold;">2013-09-23 09:52:17 </font>
	                                </td>
	
	                                <td style="text-align: left;"><a href="products_show.asp?typeid=<%=rs("cid")%>&id=<%=rs("id")%>" target="_blank"><img alt="加入购物车" src="images/joincart.png"></a><br>
	                                    <a href="javascript:cancelFavorites('ce8a87f1-f037-4702-abd8-f412202446b6')"><img alt="取消收藏" src="images/canclecollect.png"></a>
	                                </td>
	                            </tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
					</tbody>
				</table>

				<!--内容end-->
			</div>
		</div>
            <!--main end-->
        </div>
        <!--container end-->
        <div class="clr">
        </div>
        

  
<!--#include file="foot.asp"--> 