<?php



require_once(dirname(dirname(__FILE__)) . '/app.php');
need_login();


$condition['user_id'] = $login_user_id;
$count = Table::Count('cart', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$sql = "select a.*,b.name as provider_name,b.province as provider_province,c.name as category_name
        from cart as a,provider as b,category as c
        where a.provider_id=b.id and a.category_id=c.id and a.user_id=".$login_user_id."
        order by a.provider_id ASC,a.id ASC";
$cart = DB::GetQueryResult($sql, FALSE);

if(count($cart)==0){
    Session::Set('error','购物车里没有任何商品！');
}
$sum = OCart::sum(); 
$sum1 = array_pop($sum); 


$provider_id = "";






include template('cart_order');
?>
