echo "<tr><th>Comensales</th><td>" . $_SESSION['comensales'] . "</td></tr>"; ?> <tr> <th>MENU</th> <th></th> </tr> <?php list($platos) = Menu::getByMenu($_SESSION['id_menu']); foreach ($platos as $plato) { echo "<tr><td>" . $plato->getValueEncoded("nombre") . "</td><td></td></tr>"; } $menu = Menu::getById($_SESSION['id_menu']); $_SESSION['precio'] += $menu->getValueEncoded("precio"); $_SESSION['precio'] *= $_SESSION['comensales']; echo "<tr><th>DECORACION</th><th></th></tr>"; $decoracion = Decoracion::getById($_SESSION['id_decoracion']); echo "<tr><td>" . $decoracion->getValueEncoded("nombre") . "</td><td></td></tr>"; echo "<tr><th>VINO</th>\n <th></th>\n\t\t\t\t</tr>"; $bebida = $_SESSION['bebidas']; $cantidad = $_SESSION['cantidad']; $bebidas = Bebida::getById($bebida); echo "<tr><th>Nombre</th><td>" . $bebidas->getValueEncoded("nombre") . "</td></tr>"; echo "<tr><th>Precio</th><td>" . $bebidas->getValueEncoded("precio") . "€</td></tr>"; echo "<tr><th>Cantidad</th><td>" . $cantidad . "</td></tr>"; $_SESSION['precio'] += $bebidas->getValueEncoded("precio") * $cantidad; echo "<tr><th>TOTAL</th>\n <th></th>\n\t\t\t\t</tr>"; echo "<tr><th>" . $_SESSION['precio'] . "€</th><td></td></tr>"; ?> </tbody> </table> <input type="submit" value="enviar" name="insertar">
</div> <a class="left carousel-control" href="#carousel-935538" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a> <a class="right carousel-control" href="#carousel-935538" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a> </div> </div> </div> <div id="main"> <?php if (isset($_POST['finalizar'])) { confirmar(); } else { ?> <form action="pedidosmenu-decoracion.php" method="post"> <h3 class="text-center">Decoraciones</h3> <label for="decoracion"><select name="decoracion"></label> <option value="0">Selecciona una decoracion</option> <?php list($decoraciones) = Decoracion::getDecoracion(); foreach ($decoraciones as $decoracion) { echo "<option value='" . $decoracion->getValueEncoded("id_decoracion") . "'>" . $decoracion->getValueEncoded("nombre") . "</option>"; } ?> </select> <input type="submit" value="enviar" name="finalizar"> </form> <?php } function confirmar() { $_SESSION['id_decoracion'] = $_POST['decoracion']; header('Location: confirmarmenu.php'); }