Ejemplo n.º 1
0
<?php

include './conf.php';
include './daos/dao.php';
include './daos/daoReserva.php';
include './model/reserva.php';
session_start();
$dao = new dao(DB_HOST, $_SESSION['db_user'], $_SESSION['db_pass'], DB_NAME);
$dao->conectar();
$daoReserva = new daoReserva($dao);
if ($_POST) {
} else {
    $res = $daoReserva->getReservas("");
    $tablaReservas = $dao->transformarResultado($res);
    $titulos = $dao->getTitulos($res);
}
<?php

include '../conf.php';
include '../daos/dao.php';
include '../daos/daoReserva.php';
include '../model/reserva.php';
session_start();
$dao = new dao(DB_HOST, $_SESSION['db_user'], $_SESSION['db_pass'], DB_NAME);
$dao->conectar();
$daoReserva = new daoReserva($dao);
if ($_POST) {
    $sillas = split(",", $_POST['nombres']);
    $no = count($sillas);
    $telefono = $_POST['telefono'];
    $email = $_POST['email'];
    $tarjeta = $_POST['tarjeta'];
    $vuelos = split("_", $_POST['vuelos_ida']);
    $reserva = new Reserva(0, 1, 1, 'now()', $telefono, $email, $tarjeta);
    $daoReserva->insertReserva($reserva);
    for ($i = 0; $i < $no - 1; $i++) {
        $daoReserva->insertSillaReserva($reserva->k_reserva, $sillas[$i]);
    }
    header('Location: ../reservas.php');
}
Ejemplo n.º 3
0
<?php

include '../conf.php';
include '../daos/dao.php';
include './daos/daoReserva.php';
session_start();
$dao = new dao(DB_HOST, $_SESSION['db_user'], $_SESSION['db_pass'], DB_NAME);
$dao->conectar();
$daoReserva = new daoReserva($dao);
if ($_POST) {
    require_once "lib/nusoap.php";
    $cliente = new nusoap_client("http://localhost:81/cardServiceSoap/producto.php");
    $error = $cliente->getError();
    if ($error) {
        echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
    }
    $total = $daoReserva->getTotalReserva($_GET['id']);
    $tarjeta = $daoReserva->getTarjetaCredito($_GET['id']);
    $result = $cliente->call("pago", array("categoria" => "{$tarjeta},{$total}"));
    if ($cliente->fault) {
        echo "<h2>Fault</h2><pre>";
        print_r($result);
        echo "</pre>";
    } else {
        $error = $cliente->getError();
        if ($error) {
            echo "<h2>Error</h2><pre>" . $error . "</pre>";
        } else {
            echo "<h2>Libros</h2><pre>";
            echo $result;
            echo "</pre>";