<?php require_once '/home/nmaxx/public_html/marketingNet/libs.php'; $stock = new TempMaxCompra(); $expiredShoppingCart = $stock->getExpiredShoppingCard(); $shoppingCart = new ShoppingCart(); if (!empty($expiredShoppingCart)) { foreach ($expiredShoppingCart as $k => $v) { $type = $shoppingCart->getType($v->talle, $v->color); $user = $v->idUsuario; $id = $v->intContador; $stock->storeRemains($type); if (isset($type)) { switch ($type) { case '1': try { $x = new TempStock(); $x->liberarStockTalle($id, $user); } catch (Exception $e) { echo $e->getMessage(); } break; case '2': try { $x = new TempStock(); $x->liberarStockColor($id, $user); } catch (Exception $e) { echo $e->getMessage(); } break; case '3':
if (!isset($_SESSION)) { @session_start(); } // function redirect(){ // header('location: http://nufarm-maxx.com/marketingNetDesarrollo/carrito.php'); // } function redirect() { echo '<script>window.location.href="carrito.php";</script>'; } // error_reporting(E_ALL); // ini_set('display_errors', 'On'); // error_reporting(0); ini_set('display_errors', 'Off'); $tempMaxCompra = new TempMaxCompra(); // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; }
public function refund($id) { $compra = new Compra(); $usuario = new Usuario(); $stock = new Stock(); $tempMaxCompra = new TempMaxCompra(); $info = $this->joinCompra($id); /** * @internal Resto de la compra * @param num * @param user * @param id */ $newTotal = $info->total - $info->pagado; try { /** * @php Seteo la devolucion del stock personal (maximos y minimos) */ $remains = new stdClass(); $remains->{'intCantidad'} = $info->cantidad; $remains->{'idProducto'} = $info->producto; $remains->{'idUsuario'} = $info->user; $tempMaxCompra->setUser($info->user); $tempMaxCompra->storeRemains(null, $remains); $compra->setTotal($newTotal, $info->user, $info->compra); $usuario->sumarCredito($info->pagado, $info->user); $stock->sumStock($info->talle, $info->color, $info->cantidad, $info->producto); $this->delete($id); if ($compra->isEmpty($info->compra)) { $compra->delete($info->compra); } @header('location: v_compras.php?activo=1&sub=c'); exit; } catch (PDOException $e) { echo $e->getMessage(); } }
<?php ob_start(); require_once 'Connections/conexion.php'; require_once 'libs.php'; if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; // require_once('/control/resources/pdo.php'); require_once 'control/productos/classes/class.tallesColores.php'; $cond = isset($_GET['recordID']) && !empty($_GET['recordID']) && !isset($_GET['talle_colores']); $tempMaxCompra = new TempMaxCompra(); if (isset($_GET['require'])) { switch ($_GET['require']) { case '1': try { $x = new TempStock(); $x->liberarStockTalle($_GET['recordID'], $_SESSION['MM_IdUsuario']); $tempMaxCompra->storeRemains($_GET['recordID']); } catch (Exception $e) { echo $e->getMessage(); } break; case '2': try { $x = new TempStock(); $x->liberarStockColor($_GET['recordID'], $_SESSION['MM_IdUsuario']); $tempMaxCompra->storeRemains($_GET['recordID']); } catch (Exception $e) {
<?php if (!isset($_SESSION)) { session_start(); if (empty($_SESSION["MM_Username"])) { header('location: login.php'); exit; } } require 'libs.php'; $TempMaxCompra = new TempMaxCompra(); $TempMaxCompra->init(); ?> <!DOCTYPE html> <html lang="es"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Marketing Net</title> <!-- librerías opcionales que activan el soporte de HTML5 para IE8 --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <!-- CSS de Bootstrap --> <link href="assets/bootstrap-3.3.4/css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="assets/bootstrap-3.3.4/css/bootstrap-social.css" rel="stylesheet" media="screen">
<?php require 'inc/header.php'; $producto = new producto($_GET['producto']); $detalles = $producto->details(); $tempMaxCompra = new TempMaxCompra(); $tempMaxCompra->haveMaxCompra(); $limitCompraProd = $tempMaxCompra->getMaxProd(); $limitCompra = $tempMaxCompra->getMaxCompra(); $intMinCompra = $tempMaxCompra->getMinCompra(); ?> <!-- Header --> <!--detalle productos--> <div class="detalle-productos col-xs-12 col-sm-12 col-md-12 col-lg-12"> <!--buscador--> <div class="buscador col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="filtros"> <!--<input type="text" name="" value="">--> </div> </div> <!--end / buscador--> <!--col-a--> <div class="col-a block background-a col-xs-12 col-sm-4 col-md-4 col-lg-4"> <div class="img"> <img src="images_productos/<?php echo $detalles->strImagen; ?> " alt="">
<?php ob_start(); require_once 'libs.php'; $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; if (!isset($_SESSION)) { @session_start(); } $tempMaxCompra = new TempMaxCompra(); require_once 'Connections/conexion.php'; // ================================= Cantida minima de producto ============================== // $query = mysql_query("SELECT intMinCompra FROM productos WHERE idProducto = '" . $_POST['idProducto'] . "'"); while ($row = mysql_fetch_array($query)) { $minCantidad = $row["intMinCompra"]; } // if ($_POST['cantidad'] < $minCantidad) { // header("Location: index.php?activo=1&prod=1"); // } /** * Objetivo : Proteger por php la cantidad minima requerida de producto a comprar **/ // =========================================================================================== // $id_producto = $_POST['idProducto']; $cantidad_elegida = $_POST['cantidad']; include_once "includes/class.productos.php"; $productos = new productos(); $productos->select($id_producto); $categoria = $productos->getintCategoria(); $StockActual = $productos->getintStock(); include_once "includes/class.categorias.php";