$page_found = true; $navigation[] = array("url" => 'order_later', "title" => 'Товары отложенные на потом'); /*if (isset($_POST['order_later_remove'])) { unset($_SESSION['fw_basket']); $location=$_SERVER['HTTP_REFERER']; header("Location: $location"); die(); }*/ if (!empty($_COOKIE['order_later'])) { $products = @unserialize($_COOKIE['order_later']); if (!empty($products)) { $sql = "\n\t\t\t\tSELECT p.*,\n\t\t\t\t\t\t(SELECT id FROM fw_products_images i WHERE i.parent=p.id ORDER BY sort_order ASC LIMIT 1) AS image,\n\t\t\t\t\t\t(SELECT ext FROM fw_products_images WHERE parent=p.id ORDER BY insert_date DESC LIMIT 1) AS ext,\n\t\t\t\t\t\t(SELECT name FROM fw_products_types WHERE id=p.product_type LIMIT 0,1) AS type_name,\n\t\t\t\t\t\t(SELECT id FROM fw_products_types WHERE id=p.product_type LIMIT 0,1) AS type_id\n\t\t\t\t\tFROM fw_products AS p\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.status='1' and p.id in (" . implode(',', $products) . ")"; $products_list = $db->get_all($sql); foreach ($products_list as $v => $key) { $products_list[$v]['full_url'] = $shop->getFullUrlProduct($products_list[$v]['id'], "catalog"); $products_list[$v]['sizes'] = $shop->getProductPropertiesByEntity($products_list[$v]['id'], PROPERTY_ENTITY_SIZE); } $smarty->assign("products_list", $products_list); } } $template = 'shop.order_later.html'; break; //добавляем продукт в корзину //добавляем продукт в корзину case @$url[$n - 1] == 'basket' && @$url[$n] == 'add': //header("Content-type: text/html; charset=Windows-1251"); if (!empty($_POST) && !empty($_POST['product_id']) && !empty($_POST['product_count'])) { $productId = (int) $_POST['product_id']; $size = null; $color = null;
$db->query("update fw_users set `name`='{$name}', `phone_1`='{$phone_1}', `address`='{$address}', `delivery`='{$delivery}', `info`='{$info}' where id='{$userId}' "); //$users->save_data($userId, $name, $phone_1, $address, $delivery, $info); $location = $_SERVER['HTTP_REFERER']; header("Location: {$location}"); die; } die; break; case $url[$n] == 'orders' && count($url) == 2: $navigation[] = array("url" => 'orders', "title" => 'История заказов'); $orders_list = $db->get_all("SELECT * FROM fw_orders WHERE user='******'fw_user']['id'] . "' ORDER BY insert_date DESC"); $orders_list = String::unformat_array($orders_list, 'front'); foreach ($orders_list as $key => $val) { $orders_list[$key]['products_list'] = $db->get_all("\n \tselect a.*, b.name, b.price, b.article, (a.product_count * a.product_price) as total_price\n \tfrom fw_orders_products as a\n \tleft join fw_products as b on a.product_id = b.id \n \twhere a.order_id = '{$val['id']}' "); foreach ($orders_list[$key]['products_list'] as $key2 => $val2) { $orders_list[$key]['products_list'][$key2]['full_url'] = $shop->getFullUrlProduct($val2['product_id'], "catalog"); $orders_list[$key]['products_list'][$key2]['properties'] = unserialize($val2['properties']); } } $page_found = true; $smarty->assign("orders_list", $orders_list); $smarty->assign("currency", DEFAULT_CURRENCY); $template = 'orders.html'; break; case $url[$n] == 'restore' && count($url) == 2: //echo $pwd->replaceMailContent(array("{login}"=>$login,"{password}"=>$password,"{site_url}"=>$site_url), $item['template']); $navigation[] = array("url" => 'profile', "title" => 'Восстановление пароля'); $page_found = true; $template = 'restore_pwd.html'; break; case $url[$n] == 'history_orders' && count($url) == 2: