Exemplo n.º 1
0
<?php

include "IncluirClases.php";
include "../funciones.php";
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $Plato = new PlatoBLL();
    $vPlato = $Plato->ConsultarRegistro($id);
    $imagenAlmacenada = $vPlato[0][3];
}
// verificar el action
// se guarda el registro del plato en edicion.
//
if (isset($_POST['submit'])) {
    $id = $_POST['idHidden'];
    //$nombre = $_POST ['nombre'];
    //$precio = $_POST ['precio'];
    // guardar imagen
    // Comprueba si han subido una nueva imagen o deja la que había almacenada.
    /*if (! empty ( $_FILES ['foto'] ['name'] )) {
    		$nombreFichero = guardarImagen ( $_FILES );
    	} else {
    		$nombreFichero = $_POST ['imagenHidden'];
    	}*/
    //$id_tipo_plato = $_POST ['tipoPlato'];
    $PlatoEntidad = new Plato();
    $PlatoEntidad->__set('id_plato', $id);
    /*$PlatoEntidad->__set ( 'nombre', $nombre );
    	$PlatoEntidad->__set ( 'precio', $precio );
    	$PlatoEntidad->__set ( 'imagen', $nombreFichero );
    	$PlatoEntidad->__set ( 'id_tipo_plato', $id_tipo_plato );*/
Exemplo n.º 2
0
 public function ConsultarRegistro($idPlato)
 {
     return $this->oPlato->ConsultarRegistro($idPlato);
 }
Exemplo n.º 3
0
<?php

include "IncluirClases.php";
$title = "Pedido";
$carrito = new Carrito();
$pedidoFacturaBLL = new PedidoFacturaBLL();
$pedidoFacturaEntidad = new PedidoFactura();
$lineaDetallePedidoFacturaBLL = new PedidoFacturaDetalleBLL();
$lineaDetalleEntidad = new PedidoFacturaDetalle();
if (isset($_GET['id']) && isset($_GET['action'])) {
    $accion = $_GET['action'];
    switch ($accion) {
        case 'add':
            $platoBLL = new PlatoBLL();
            $id = $_GET['id'];
            $vPlato = $platoBLL->ConsultarRegistro($id);
            $idProducto = $vPlato[0][0];
            $nombre = $vPlato[0][1];
            $precio = $vPlato[0][2];
            $foto = $vPlato[0][3];
            $cantidad = $_GET['cantidad'];
            $productoAlCarro = array("id" => $idProducto, "nombre" => $nombre, "precio" => $precio, "foto" => $foto, "cantidad" => $cantidad);
            $carrito->add($productoAlCarro);
            //header ( 'Location: pedido.php' );
            break;
        case 'delete':
            $unique_id = $_GET['id'];
            $carrito->remove_producto($unique_id);
            // header ( 'Location: pedido.php' );
            break;
        case 'update':