<div id="cart"><a href="#"><img src="images/products/cartfinal.png" /></a></div> </div> </div> <?php require_once 'library/config.php'; require_once 'library/cart-functions.php'; $action = isset($_GET['action']) && $_GET['action'] != '' ? $_GET['action'] : 'view'; switch ($action) { case 'add': addToCart(); break; case 'update': updateCart(); break; case 'delete': deleteFromCart(); break; case 'view': } $cartContent = getCartContent(); $numItem = count($cartContent); $pageTitle = 'Shopping Cart'; // show the error message ( if we have any ) displayError(); if ($numItem > 0) { ?> <table width="780" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
$order->desc = $product->descr; $order->total_price = $product->price; $order->pid = $_GET['id']; $order->insert(); // $Q=$product->quantity - $_session['quentity']; $Q = $product->quantity - 1; $product->updateQ($Q); $totalPrice = $order->OrdersPrice($_SESSION['uid']); $_SESSION['sum'] = $totalPrice['sum']; } else { //make pop up window to show that user don`t have enough credite echo "<script>alert('sorry,You don\\'t have enough credit.')</script>"; } } $demand = $order->userOrder($_SESSION['uid']); updateCart(count($demand)); } ?> <!--main div--> <!--- display user cart info and update it--> <h1>Shopping Cart</h1> <div class="shopping-cart"> <div class="column-labels"> <label class="product-image">Image</label> <label class="product-details">Details</label> <label class="product-price">Price</label> <label class="product-quantity">Quantity</label>
<!DOCTYPE> <?php session_start(); include('functions/functions.php'); include('includes/db.php'); $DBConn = setDBConn(); $ip = getIp(); /* if add/remove/update has occurred */ if(!empty($_POST)){ updateCart($DBConn, $ip, $_POST); } $cartData = getCart($DBConn, $ip); $totalPrice = $cartData['total_price'] . "€"; $totalItems = $cartData['total_items']; $cartMarkup = $cartData['cart_markup']; ?> <html> <head> <title>ANIKI - Animu&Mangu merchandise</title> <link rel="stylesheet" href="styles/style3.css" media="all"> </head> <body> <!--Main container starts here--> <div class="main_wrapper"> <!-- Header starts here --> <div class="header_wrapper"> <a href="index.php"><img id="image1" src="images/aniki_titulo3.png"></a> </div>
include_once 'fragments/plist.php'; ?> <!DOCTYPE html> <html> <?php require 'fragments/head.php'; ?> <body> <?php require 'fragments/header.php'; if (isset($_POST['update'])) { if (isset($_POST['qty']) && $_POST['qty'] != "" && is_numeric($_POST['qty'])) { updateCart($_POST['product_id'], $_POST['qty']); } } if (isset($_POST['delete'])) { removeItem($_POST['product_id']); } ?> <nav> <ul> <li><a href="index.php">Home</a></li> <li><a href="movies.php">Movies</a></li> <li><a href="booking.php">Booking</a></li> <li><a href="contact-us.php">Contact Us</a></li> </ul> </nav>
function AddRemoveItem($xml, $action) { //find detail of item with id $id = $_POST["id"]; $price = findItem($xml, $id, "price"); $curQty = findItem($xml, $id, "quantity"); if ($_SESSION["cart"] != "") { $cart = $_SESSION["cart"]; //read the cart session into local variable if ($action == "Add") { if ($curQty > 0) { if (!isset($cart[$id])) { $qty = 1; // increase no of books by 1 $value = array(); $value["price"] = $price; $value["qty"] = $qty; $cart[$id] = $value; $_SESSION["cart"] = $cart; // save the adjusted cart to session variable //echo (toXml($cart)); // send XML form of CART to client } else { //if $value["qty"] > curQty //=> error $value = $cart[$id]; $value["price"] = $price; $value["qty"] = $value["qty"] + 1; $cart[$id] = $value; $_SESSION["cart"] = $cart; //subtracting 1 from the quantity available and adding 1 to the quantity on hold //echo (toXml($cart)); } } else { echo "sorry"; return; } } else { $value = $cart[$id]; $value["price"] = $price; $value["qty"] = $value["qty"] - 1; $cart[$id] = $value; if ($value["qty"] == 0) { unset($cart[$id]); } $_SESSION["cart"] = $cart; //echo (toXml($cart)); } } elseif ($action == "Add") { $value = array(); $value["price"] = $price; $value["qty"] = "1"; $cart = array(); $cart[$id] = $value; $_SESSION["cart"] = $cart; //echo (toXml($cart)); } updateCart($xml, $cart, $id, $action); }
}*/ $precio = $precio = str_replace(",", ".", $precioApto); $cobroAnticipado *= $precio; $smarty->assign('cobro_anticipado_hotel', number_format($cobroAnticipado, 2, ',', '')); foreach ($excursiones as $e_k => $exc) { if ($exc['forma_cobro'] == 'online') { $precio_anticipado = $exc['total'] * $exc['porcientoInicial'] / 100; $excursiones[$e_k]['totalInicial'] = $hotel->moneda->simbolo . convertFromMonedaToMoneda($precio_anticipado, $hotel->moneda->codigo, $hotel->moneda->codigo) . ' <span class="subprice">(' . $currency . convertFromMonedaToMoneda($precio_anticipado, $hotel->moneda->codigo, $money) . ')</span>'; $cobroAnticipado += $precio_anticipado; } $precio += $exc['total']; } $precioApto = $hotel->moneda->simbolo . convertFromMonedaToMoneda($precio, $hotel->moneda->codigo, $hotel->moneda->codigo) . ' <span class="subprice">(' . $currency . convertFromMonedaToMoneda($precio, $hotel->moneda->codigo, $money) . ')</span>'; $data_resp = array('id' => $data['timeId'], 'evento' => $evento->nombre, 'fecha' => $_POST['fecha'], 'hora' => $data['sesion'], 'entradas' => $entradas_resp, 'total' => $_POST['total'], 'total_format' => $total_format, 'precioTotal' => $precioApto, 'cobroAnticipado' => $moneda . " " . number_format($cobroAnticipado, 2, ',', ''), 'forma_cobro' => $evento->cobro->forma); $cart = getCart($_SESSION['cartID']); updateCart($cart->id, array('excursiones' => $excursiones)); $apartamento = $cart->apartamentoObj; $result['msg'] = 'ok'; $result['data'] = $data_resp; $result['online'] = $cobroAnticipado > 0 || $hotel->tipoReserva == 'online'; $smarty->assign('pagar_ahora', $cobroAnticipado > 0 || $hotel->tipoReserva == 'online'); $smarty->assign('cobro_anticipado', $moneda . number_format($cobroAnticipado, 2, ',', '')); $smarty->assign('apartamento', $apartamento); $smarty->assign('currencyHotel', $hotel->moneda->simbolo); $smarty->assign('reservas_excursiones', $excursiones); $html = $smarty->fetch('cobraremos.tpl'); $result['html'] = $html; } else { $result['data'] = "Faltan datos"; } }