Ejemplo n.º 1
0
<h2 class="sub-header">Lista de Bebidas</h2>

<div id="listar">
	<?php 
$lista_bebidas = bebidaBLL::obtenerPorCriterio("descripcion", "", -1, 0, 10);
if ($lista_bebidas == false) {
    echo "<div class=\"alert alert-warning\" role\"alert\">\n\t\t\t\t\t<strong>Error!</strong> No hay registros para mostrar.\n\t\t\t\t </div>";
} else {
    echo "<div class=\"table-responsive\">";
    echo bebidaBLL::convertirTableHTML($lista_bebidas, false, false);
    echo "</div>";
}
?>
</div>
Ejemplo n.º 2
0
    echo '<li class="alert alert-info alert-dismissible" role="producto" id="' . $ingrediente->getId() . '"
        							object="' . get_class($ingrediente) . '" token="' . $ingrediente->getTotal() . '">
        							<strong>' . $ingrediente->getDescripcion() . ' - Precio: ₡ ' . number_format($ingrediente->getTotal(), 2) . '</strong>
        							</li>';
    echo "</div>";
}
?>
                </div>
            </div>

            <div class="tab-pane" id="tab_bebida">
                <div class="add-bebida">
                    <?php 
try {
    $lista_bebidas = bebidaBLL::obtenerTodos(1);
    $bebidas = bebidaBLL::separarBebidasPorAguaOLeche($lista_bebidas);
} catch (Exception $ex) {
    echo $ex->getMessage();
}
foreach ($bebidas as $bebida) {
    if ($bebida instanceof Natural) {
        $precio = $bebida->calcularPrecio();
    } else {
        $precio = $bebida->getPrecio();
    }
    echo "<div>";
    echo "<div class=\"hidden\">" . json_encode($bebida->parseArray()) . "</div>";
    echo '<li class="alert alert-info alert-dismissible" role="producto" id="' . $bebida->getId() . '"
        							object="' . get_class($bebida) . '" token="' . $precio . '">
        							<strong>' . $bebida->getDescripcion();
    if ($bebida instanceof Natural) {
Ejemplo n.º 3
0
    $mililitros = $_GET['mililitros'];
    $precio = $_GET['precio'];
    $tipo_bebida = $_GET['rdbBebida'];
    if (isset($_GET['cantidad'])) {
        $cantidad = $_GET['cantidad'];
    } else {
        $cantidad = 0;
    }
    if (isset($_GET['activo'])) {
        $activo = 1;
    } else {
        $activo = 0;
    }
    $bebida = FactoryBebida::getBebida(0, $descripcion, $mililitros, $precio, $cantidad, $activo, $tipo_bebida);
    try {
        $resultado = bebidaBLL::agregar($bebida);
    } catch (Exception $ex) {
        $resultado = $ex->getMessage();
    }
    if ($resultado === true) {
        echo "<div class=\"alert alert-success\" role=\"alert\">\n                    <strong>Exito!</strong> Bebida <strong>{$descripcion}</strong> agregado correctamente.\n                 </div>";
    } else {
        echo "<div class=\"alert alert-danger\" role=\"alert\">\n                    <strong>Error!</strong> No se pudo agregar la bebida, <strong>{$resultado}</strong>\n                 </div>";
    }
    echo "<p class=\"text-right\">\n                <a href=\"mantenimiento.php?view=nueva_bebida\" class=\"btn btn-primary\">\n                    <span class=\"glyphicon glyphicon-plus-sign\"></span> Agregar nueva Bebida\n                </a>\n            </p>";
    return;
}
?>

<form class="form-horizontal" role="form" method="get">
    <input type="hidden" name="view" id="view" value="nueva_bebida">