Пример #1
0
                                <h2 class="box-title">Listado de Productos </h2></p>

                                <!-- /.box-header -->

                                <table id="example" class="table table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php 
require '../facades/FacadeProducto.php';
$producto = new Facade();
if (isset($_GET['resultado'])) {
    $Productos = $producto->buscarProducto($_GET['resultado']);
} else {
    $Productos = $producto->getProductos();
}
foreach ($Productos as $iterator) {
    ?>


                                               <ul class="col-xs-6 col-centered" style="list-style-type: none">
                                                    <li class="span4">
                                                        <div class="thumbnail" style="text-align: center">
                                                            <span
                                                                class="badge badge-inverse pull-right price">$<?php 
    echo $iterator['ValorBase'];
    ?>
</span>
Пример #2
0
    echo json_encode($msg);
}
if (isset($_POST['search'])) {
    $mensaje = $_POST['searchProduct'];
    header("Location: ../views/productoListar.php?resultado=" . $mensaje);
}
if (isset($_GET['buscar'])) {
    $criterio = $_POST['criterio'];
    $busqueda = $_POST['busqueda'];
    $comobuscar = $_POST['comobuscar'];
    $resul = $fachada->buscarConCriterio($criterio, $busqueda, $comobuscar);
    $_SESSION['consulta'] = $resul;
    if ($resul == null) {
        header("Location: ../views/productoListar.php?encontrados=false&criterio=" . $criterio . "&busqueda=" . $busqueda . "&comobuscar=" . $comobuscar);
    } else {
        header("Location: ../views/productoListar.php?encontrados=true&criterio=" . $criterio . "&busqueda=" . $busqueda . "&comobuscar=" . $comobuscar);
    }
}
if (isset($_GET['listar'])) {
    $resul = $fachada->buscarProducto($_SESSION['datosLogin']['id']);
    $_SESSION['consulta'] = $resul;
    if ($resul == null) {
        header("Location: ../views/productoListar.php?encontrados=false&criterio=" . $criterio . "&busqueda=" . $busqueda . "&comobuscar=" . $comobuscar);
    } else {
        header("Location: ../views/productoListar.php?encontrados=true&criterio=" . $criterio . "&busqueda=" . $busqueda . "&comobuscar=" . $comobuscar);
    }
}
if (isset($_POST['detailProduct'])) {
    $response = $fachada->obtenerProducto($_POST['detailProduct']);
    echo json_encode($response);
}