ruạṛ
<?php /** * Process login form * @version 0.9 * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package dreamdiamondstore */ /* * site data and definitions * @var string $include_path - for easy global search/replace if include location changes */ $include_path = $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/'; require_once $include_path.'universal.php'; /* * start the session (after includes so objects stored in $_SESSION are created properly) */ session_start(); $connID = connect_to_db(); /** * suhosin workaround - load from database data that should be able to be kept in $_SESSION * @var object $customer * @var object $anon need a copy for comparing carts after login * @var object $cart */ $anon_cart = new cart; $anon_cart->product(11,1); $anon_cart->product(14,1); $customer = user_load(); //print_r($customer); exit; /** * shouldn't be trying to access this script if already logged in */ if(!$customer->logged_in) { getout('',select_one('page_data','path','page_type','customer')); exit; } /** * @var string $message */ $message = ''; /* * merge carts * @var object $cart */ //* echo '<b>Anon</b>', print_r($anon_cart,true),'<br />'; $cart = $customer->load_cart(); echo '<b>Cart</b>',print_r($cart, true); echo '<br/>'; $cart->merge($anon_cart); echo '<b>Merged</b>', print_r($cart,true),'<br />'; //$customer->update_cart($cart); $message .= 'Items in the basket have been added to your saved basket <br />'; unset($cart); $cart = $customer->load_cart('wishlist'); echo '<b>Wishlist</b>', print_r($cart,true),'<br />'; $cart->merge($anon_cart); echo '<b>Merged</b>', print_r($cart,true),'<br />'; //$customer->update_cart($cart,'wishlist'); $message .= 'Items in the wishlist have been added to your saved wishlist <br />'; unset($cart); exit; ?>
cải xoăn