Example #1
0
<?php

$action = $_POST['action'];
$result = array('msg' => 'error', 'data' => 'Acción no valida');
if (strcmp($action, 'validar') == 0) {
    $reservas = array();
    if (isset($_POST['reservas'])) {
        $reservas = $_POST['reservas'];
    }
    $importes = array();
    if (isset($_POST['importe'])) {
        $importes = $_POST['importe'];
    }
    if ($importes && count($importes)) {
        $v = validarReservas($reservas, $importes);
        if ($v) {
            $lista = getReservasActualesByHotel($_POST['hotelId']);
            $smarty->assign('reservas', $lista);
            $html = $smarty->fetch('admin/validar_reservas.tpl');
            //Temporal enviarEmailFacturacion($_POST['hotelId'], $idFactura);
            $result = array('msg' => 'ok', 'html' => $html);
        }
    }
}
echo json_encode($result);
Example #2
0
<?php

if (isset($_REQUEST['login_code'])) {
    $login_code = $_REQUEST['login_code'];
    $hotelId = getHotelIdByLoginCode($login_code);
    if ($hotelId) {
        $moneda = 'EUR';
        $reservas = getReservasActualesByHotel($hotelId, $moneda);
        $hotel = getHotelById($hotelId);
        $smarty->assign('hotel', $hotel);
        $smarty->assign('reservas', $reservas);
        $smarty->display('admin/validar.tpl');
    } else {
        header('Location:' . $base_url . '/admin-login');
    }
} else {
    header('Location:' . $base_url . '/admin-login');
}