Example #1
0
<?php

include 'IncluirClases.php';
$title = 'Pagina de Inicio';
$tipoPlatos = new TipoPlatoBLL();
$vTipoPlatos = $tipoPlatos->Listar();
$content = "<!-- Jumbotron Header -->\n<header class='jumbotron hero-spacer'>\n<div id='carousel-example-generic' class='carousel slide'\ndata-ride='carousel'>\n<!-- Indicators -->\n<ol class='carousel-indicators'>\n<li data-target='#carousel-example-generic' data-slide-to='0'\nclass='active'></li>\n<li data-target='#carousel-example-generic' data-slide-to='1'></li>\n<li data-target='#carousel-example-generic' data-slide-to='2'></li>\n</ol>\n\n<!-- Wrapper for slides -->\n<div class='carousel-inner'>\n<div class='item active'>\n<img class='img-responsive center-block' src='img/banners/banner1.jpg' alt='...'  style='width:1200px;height:260px'>\n\n</div>\n<div class='item'>\n<img class='img-responsive center-block' src='img/banners/banner2.jpg' alt='...'  style='width:1200px;height:260px'>\n\n</div>\n<div class='item'>\n<img  class='img-responsive center-block'src='img/banners/banner3.jpg' alt='...'  style='width:1200px;height:260px'>\n\n</div>\n</div>\n\n<!-- Controls -->\n<a class='left carousel-control' href='#carousel-example-generic'\nrole='button' data-slide='prev'> <span\nclass='glyphicon glyphicon-chevron-left'></span>\n</a> <a class='right carousel-control'\nhref='#carousel-example-generic' role='button' data-slide='next'> <span\nclass='glyphicon glyphicon-chevron-right'></span>\n</a>\n</div>\n<!-- Carousel -->\n\n</header>\n<hr>\n<div class='row'><div class='col-lg-12'><h3>Men&uacute;</h3></div></div>\n<div class='row text-center'>";
foreach ($vTipoPlatos as $tipo) {
    $content .= "<div class='col-md-3 col-sm-6 hero-feature'>\n\t<div class='thumbnail'>\n\t<img src='img/{$tipo['2']}' alt=''  >\n\t<div class='caption'>\n\t<h3>{$tipo['1']}</h3>\n\t<p>{$tipo['1']}.</p>\n\t<p>";
    $url = strtolower($tipo[1]) . '.php?id=' . $tipo[0];
    // pasa el nombre a minusculas con el id de la categoria del plato.
    $url = preg_replace('/\\s+/', '_', $url);
    // sustituye el espacio en blanco del nombre por guion bajo
    $content .= "<a href='{$url}' class='btn btn-primary'>Ver men&uacute;</a>\n\t</p>\n\t</div>\n\t</div>\n\t</div>";
}
$content .= "</div><hr>";
include "master.php";
?>








Example #2
0
<?php

include "IncluirClases.php";
$title = "Bebidas";
$PlatoEntidad = new Plato();
if (isset($_GET['id'])) {
    $id = $_GET['id'];
} else {
    // hacer select de postres cuando se cargue del menu
    $tipoPlatosEntidad = new TipoPlato();
    $tipoPlatosEntidad->__set('descripcion', $title);
    $tipoPlatos = new TipoPlatoBLL();
    $vTipoPlatos = $tipoPlatos->ConsultarNombre($tipoPlatosEntidad);
    if (!empty($vTipoPlatos)) {
        foreach ($vTipoPlatos as $tipoPlatoSelect) {
            $id = $tipoPlatoSelect[0];
        }
    }
}
$PlatoEntidad->__set('id_tipo_plato', $id);
$Plato = new PlatoBLL();
$vPlatos = $Plato->Consultar($PlatoEntidad);
$content = "<hr>\n<div class='row'><div class='col-lg-12'><h3>{$title}</h3></div></div>\n<div class='row text-center'>";
foreach ($vPlatos as $plato) {
    $content .= "<div class='col-md-3 col-sm-6 hero-feature'>\n\t<div class='thumbnail'>\n\t<img src='img/{$plato['3']}' alt=''  >\n\t<div class='caption'>\n\t<h3>{$plato['1']}</h3>\n\t<p><span class='label label-success'>Valor: ยข{$plato['2']}</span></p>\n\t<p>";
    // guarda la receta de cada plato(array) para mostrarlo.
    $RecetaBLL = new RecetaBLL();
    $Receta = $RecetaBLL->ConsultarRegistro($plato[0]);
    $ingredienteReceta = 'Receta:<br/>';
    if (!empty($Receta)) {
        foreach ($Receta as $ingrediente) {