public function index() { if (empty($_GET['seo_url'])) { $this->notFound(); return; } $promoDAO = new PromoDAO(DataSource::getInstance()); $promo = $promoDAO->findBySeoUrl($_GET['seo_url']); if (!$promo) { $this->notFound(); return; } $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->is_promo_active = TRUE; $this->registry->template->promo = $promo; $this->registry->template->related_promos = $promoDAO->findNewestList(); $this->registry->template->tile_title = $promo['subject']; $this->registry->template->tile_content = 'promo.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
function calculateCartPrice() { $price = 0; foreach (getCart() as $item) { $price += $item['price']; } return $price; }
public function showError777() { $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = 'Không có quyền truy cập'; $this->registry->template->tile_content = 'error777.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('help'); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_help_active = TRUE; $this->registry->template->tile_title = 'Trợ Giúp'; $this->registry->template->tile_content = 'help.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->promo_subject_newest = $promoDAO->findNewestSubject(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = __SITE_SLOGAN; $this->registry->template->body_class = 'index-template'; $this->registry->template->body_id = 'index-page'; $this->registry->template->tile_content = 'index.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('about'); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_about_active = TRUE; $this->registry->template->tile_title = 'Giới Thiệu'; $this->registry->template->body_class = 'page-template'; $this->registry->template->tile_content = 'about.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('contact'); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_contact_active = TRUE; $this->registry->template->facebook_description = 'Ms. Phương Thanh - 0987918796 - pttran87@gmail.com | Ms. Thùy Linh - 0983871412 - ptlinh1412@yahoo.com.vn'; $this->registry->template->tile_title = 'Liên Hệ'; $this->registry->template->tile_content = 'contact.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { if (empty($_GET['seo_url'])) { $this->notFound(); return; } $productDAO = new ProductDAO(DataSource::getInstance()); $product = $productDAO->findBySeoUrl($_GET['seo_url']); if (!$product) { $this->notFound(); return; } $categoryDAO = new CatDAO(DataSource::getInstance()); $brandDAO = new BrandDAO(DataSource::getInstance()); $cat_id = $product['category_id']; $brand_id = $product['brand_id']; $categories_list = $categoryDAO->findByAll_Navigation(); $brands_list = $brandDAO->findByAll(); $products_list_in_cat = $productDAO->findByCatId($cat_id); $products_list_in_brand = $productDAO->findByBrandId($brand_id); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->brands_list = $brands_list; $this->registry->template->current_cat_id = $cat_id; $this->registry->template->current_brand_id = $brand_id; $this->registry->template->products_list_in_cat = $products_list_in_cat; $this->registry->template->products_list_in_brand = $products_list_in_brand; $this->registry->template->product = $product; $this->registry->template->product_pics = explode_pics($product['pics']); $this->registry->template->tile_title = $categories_list[$cat_id]['name'] . ' / ' . $brands_list[$brand_id] . ' / ' . $product['code']; $this->registry->template->facebook_description = $product['description']; $this->registry->template->facebook_image = __SITE_CONTEXT . __UPLOAD_DIR . get_pic_at($product['pics'], 1); $this->registry->template->body_class = 'product-template'; $this->registry->template->tile_content = 'product.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { echo 'zzzzzzzzzzz 1'; if ($this->findGroupId() > 0) { header('Location: ' . __SITE_CONTEXT . 'admin/dashboard/'); return; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $username = remove_slashes($_POST['username']); $password = remove_slashes($_POST['password']); $memberDAO = new MemberDAO(DataSource::getInstance()); $group_id = $memberDAO->checkLogin($username, $password); if ($group_id == 0) { // login failed $message = 'Sai username hoặc password!'; $this->registry->template->message = $message; $this->registry->template->username = $username; } else { $_SESSION['member'] = array('group_id' => $group_id); header('Location: ' . __SITE_CONTEXT . 'admin/dashboard/'); return; } } $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = 'Login'; $this->registry->template->body_class = 'page-template'; $this->registry->template->tile_content = 'login.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
$smarty->assign('usuario', $usuario); $smarty->assign('reserva', $reserva); $inicio = $apartamento->inicio; $salida = $apartamento->final; $time_inicio = strtotime($inicio); $time_salida = strtotime($salida); $noches = ceil(($time_salida - $time_inicio) / (24 * 60 * 60)); $inicio = date('l, d-F-Y', strtotime($inicio)); $salida = date('l, d-F-Y', strtotime($salida)); $smarty->assign('inicio', $inicio); $smarty->assign('salida', $salida); $smarty->assign('noches', $noches); unset($_SESSION['data_usuario']); $campania = $hotel->campania; $hotel->distribuidor = $hotel->distribuidor; $cart = getCart($reserva->cartId); if ($cart->apartamentoObj->pagoOnline) { $hotel->porcentageCobroAnticipado += $cart->apartamentoObj->pagoOnline; $cobroAnticipado += $cart->apartamentoObj->pagoOnline / 100; $hotel->tipoReserva = 'online'; $smarty->assign('hotel', $hotel); } //$smarty->assign('hotel', $hotel); $images = getAllHotelImages($hotel->id); $servicios = getAllHotelServicios($hotel->id); $smarty->assign('images', $images); $smarty->assign('servicios', $servicios); if (isset($_REQUEST['print'])) { $smarty->display('cancelacionPrint.tpl'); } else { $smarty->display('cancelacion.tpl');
<?php getManu($DBConn); ?> </ul> </div> <div id="sidebar2">This is the second side bar</div> <div id="content_area"> <?php getCart($DBConn, $ip); ?> <div id="shopping_cart"> <span id="cart"> <?php if(isset($_SESSION['customer_email'])){ echo "<b>Welcome:</b>" . $_SESSION['customer_email'] . "<b style='color:gray;'>Your</b>"; } else{ echo "<b>Welcome Guest</b>"; }
</div> <!-- Space --> <div class="col-md-12" style = "background-color:#CCCCCC; height: 20px;"> </div> <div class="col-md-10" style = "background-color:#DDDDDD; margin-left: 100px;"> <h1 align = "center">Checkout</h1> <div class="col-md-11" style = "background-color:#CCCCCC; margin-bottom:50px; margin-left: 50px; margin-top: 20px"> <div style = "margin-top:50px"> <?php if (!isset($_SESSION['email'])) { echo "<h1>You have to login!</h1><br>\n\t\t\t\t\t\t\t<a href = 'customer/signinform.php'><h2>Sign in<h2></a><br>\n\t\t\t\t\t\t\tNew user? <a href='customer/signupform.php' >sign up now!</a>"; } else { getCart(); } ?> </div> </div> </div> <!-- Space --> <div class="col-md-12" style = "background-color:#CCCCCC; height: 20px;"> </div> <!-- Footer --> <div class="col-md-10" style="background-color:#EEEEEE; height: 50px; margin-left: 100px;"> </div> </body> </html>
alert("Error Occured!"); } } }); } </script> </head> <body> <div class="container"> <header class=""> <div class="logo"><a href="javascript:void(0);" title="Shop page" onClick="window.location.href='shop.php'"><img src="images/logo.jpg" alt=""></a></div> <div class="spacer"></div> </header> <span class="toggleMenu" href="shop.php"><big style="float:left; position:relative; top:10px;">SHOP</big> <div class="carttxt" onClick="javascript: window.location.href='cart_details.php'" style="cursor:pointer"><p class="itmlft">Total Items Added : <span id="cartNo"><?php echo getCart(); ?> </span></p> <div class="spacer"></div> <p class="itmrgt">Total Amount: Rs.<span id="cartPrice"><?php echo number_format(floatval(getCartAmount()), 2, '.', ''); ?> </span></p></div> <div class="spacer"></div> </span> <section class="cart_detl_pan"> <form method="post" id="frm1"> <?php $sql = mysql_query("SELECT * FROM temp_order WHERE status='unsuccessfull' AND ip='" . $ip . "' AND session_id='" . $_SESSION['session_id'] . "'"); $num = mysql_num_rows($sql);
<?php require_once 'includes/login-check.php'; require_once 'includes/helper.php'; require_once 'includes/codemojo.php'; $cartItems = getCart(); /* * =================================================================================== * CodeMojo Integration * =================================================================================== */ /* * Getting the maximum value that can be redeemed for this transaction */ $maximumRedemption = $loyaltyService->maximumRedemption(getUserID(), calculateCartPrice()); /* * Calculate how much points will the user be getting for this transaction */ $reward_points = $loyaltyService->calculateLoyaltyPoints(getUserID(), calculateCartPrice()); /* * Handling the checkout * In actual case you will be doing this in an Controller */ if (count($_POST) > 0) { $redeem = (int) $_POST['redeem']; $checkout_price = calculateCartPrice(); $linkBack = "<br/><br/><a href='/index.php'>Please click here to go back</a>"; /* * In this specific scenario, we will allow the user to either get cashback or redeem; But not both */ if ($redeem > 0) {
$excursiones = array(); if ($cart->excursionesArray) { foreach ($cart->excursionesArray as $exc) { $entradas = $exc->entradas; $earray = array(); foreach ($entradas as $en) { $earray[] = get_object_vars($en); } $excur = get_object_vars($exc); $excur['entradas'] = $earray; $excursiones[] = $excur; } } $_SESSION['excursiones'] = $excursiones; } else { $cart = getCart($_POST['cartID']); if (!$cart) { header('Location:' . $base_url); return; } } if ($cart) { $apartamento = get_object_vars($cart->apartamentoObj); $inicio = $cart->inicio; $salida = $cart->salida; $noches = $cart->noches; $time_inicio = strtotime($inicio); $time_salida = strtotime($salida); $inicio = strftime("%A, %d-%m-%G", strtotime($inicio)); $salida = strftime('%A, %d-%m-%G', strtotime($salida)); $smarty->assign('inicio', $inicio);
<?php if (isset($_SESSION['user'])) { echo "<li><h4> Welcome back</h4> </li>"; } else { echo "<li><a href='signIn.php'><h5> Sign In/Register </h5></a></li>"; } ?> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <div class="container"> <div id="products_display"> <?php getCart($_SESSION['user']); ?> </div> <a id="btn" href="cart.php?checkout=true"><h3> Checkout </h3></a> </div> </body> </html>
<body> <center> <?php require_once '../includes/session-start.req-inc.php'; require_once '../functions/cart-functions.php'; require_once '../functions/dbconnect.php'; require_once '../functions/util.php'; require_once '../functions/category-functions.php'; require_once '../functions/products-functions.php'; $action = filter_input(INPUT_POST, 'action'); if ($action == 'Empty cart') { emptyCart(); } startCart(); $total = 0; $checkoutProducts = array(); $items = getCart(); foreach ($items as $id) { $checkoutProducts[] = getProduct($id); } include '../includes/checkout.html.php'; ?> <form action="#" method="post"> <a href="index.php">Go Back</a> <input type="submit" name="action" value="Empty cart"> </form> </center> </body> </html>
<!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>
?> </b>人</span> <?php } ?> <span class="price" style=""><?php echo $_MODULE['price_pre']; ?> <em><?php echo number_format($item['discountPrice'], $_MODULE['jinpinzs_pricexshu']); ?> </em></span> <span class="nprice"></span> </div> </div> <?php echo getCart('', $item['url'], 'buy-cart'); ?> </div></div> </li> <?php } ?> </ul> </div> </div> </div> </div>
else if(strlen(trim($p))) $moneda = $p; }*/ $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"; }