Ejemplo n.º 1
0
function menu()
{
    require_once 'funcionesPHP/funcionesGenerales.php';
    require_once 'modulos/platillos/modelos/platilloModelo.php';
    require_once 'modulos/restaurantes/modelos/RestauranteModelo.php';
    $idRestaurante = $_GET['i'];
    //obtenemos el id del restaurante por get
    $idColonia = $_GET['ic'];
    //colonia desde la que se hizo la búsqueda
    $habilitado = false;
    //bandera que nos permite hacer las validaciones
    $restaurante = getRestaurante($idRestaurante);
    //obtenemos la información del restaurante por su id
    $platillos = getPlatillosDeRestaurante($idRestaurante);
    //obtenemos todos los platillos de ese restaurante
    //*********************VALIDACIÓN DEL HORARIO DEL RESTAURANTE********************
    //Esto se movió a una función en funcionesPHP/funcionesGenerales.php
    //
    $habilitado = restauranteAbiertoAhorita($idRestaurante);
    //*******************************************************************************
    //Hace arreglo esa parte de la sesión para poder asignar platillos a diferentes restaurantes
    if (empty($_SESSION["'rest" . $restaurante->idRestaurante . "'"])) {
        $_SESSION["'rest" . $restaurante->idRestaurante . "'"] = array();
    }
    //***************************************************************************
    require_once 'modulos/tipoComida/modelos/tipoComidaModelo.php';
    $tiposDeComida = getTiposComida();
    require_once 'modulos/colonias/modelos/ColoniaModelo.php';
    $colonias = getColonias();
    $colonia = getColonia($idColonia);
    $coloniaRestaurante = getColonia($restaurante->idColonia);
    $restaurante->nombreColonia = $coloniaRestaurante->nombre;
    require_once 'modulos/colonias/modelos/DelegacionModelo.php';
    $restaurante->delegacion = getDelegacion($coloniaRestaurante->idDelegacion);
    require_once 'modulos/platillos/vistas/mostrarPlatillosPedido.php';
}
Ejemplo n.º 2
0
        foreach ($restaurante->tiposComida as $tipoComida) {
            $aux = $aux . " tipoComida" . $tipoComida->idTipoComida;
        }
    }
    switch ($restaurante->metodoEntrega) {
        case 0:
            $aux = $aux . " tipoEntrega0";
            break;
        case 1:
            $aux = $aux . " tipoEntrega1";
            break;
        case 2:
            $aux = $aux . " tipoEntrega0 tipoEntrega1 tipoEntrega2";
            break;
    }
    $restauranteAbierto = restauranteAbiertoAhorita($restaurante->idRestaurante);
    if ($restauranteAbierto) {
        $aux = $aux . " restauranteAbierto";
    } else {
        $aux = $aux . " restauranteCerrado";
    }
    ?>
        <div class="restaurante ui-corner-all <?php 
    echo $aux;
    ?>
">
            <?php 
    if (!$restauranteAbierto) {
        ?>
                <div class="restauranteHeader">
                    <?php