Esempio n. 1
0
             $result['data'] = 'Se eliminó el hotel';
         } else {
             $result['data'] = 'No se pudo eliminar el hotel';
         }
     }
 } else {
     if (strcmp($action, 'favorito') == '0') {
         if ($_POST['favoritoId']) {
             $h = getHotelById($_POST['favoritoId']);
             updateHotelData($h->id, array('destacado' => $h->destacado ? 0 : 1));
         }
         $result = array('msg' => 'ok');
     } else {
         if (strcmp($action, "getFotos") == 0) {
             if (isset($_POST['idHotel'])) {
                 $himages = getAllHotelImages($_POST['idHotel'], true);
                 if ($himages) {
                     $images = array();
                     foreach ($himages as $image) {
                         if ($image->nombre && strlen(trim($image->nombre))) {
                             array_unshift($images, $image);
                         } else {
                             array_push($images, $image);
                         }
                     }
                     $smarty->assign('adjuntos', $images);
                     $html = $smarty->fetch('admin/hotel/fotos.tpl');
                     $smarty->assign('adjuntos', $images);
                     $result['msg'] = 'ok';
                     $result['data'] = 'Adjuntos encontrados';
                     $result['html'] = $html;
Esempio n. 2
0
    $inicio = $apartamento->inicio;
    $salida = $apartamento->final;
    $time_inicio = strtotime($inicio);
    $time_salida = strtotime($salida);
    $noches = ceil(($time_salida - $time_inicio) / (24 * 60 * 60));
    $inicio = date('l, d-F-Y', strtotime($inicio));
    $salida = date('l, d-F-Y', strtotime($salida));
    $smarty->assign('inicio', $inicio);
    $smarty->assign('salida', $salida);
    $smarty->assign('noches', $noches);
    unset($_SESSION['data_usuario']);
    $campania = $hotel->campania;
    $hotel->distribuidor = $hotel->distribuidor;
    $cart = getCart($reserva->cartId);
    if ($cart->apartamentoObj->pagoOnline) {
        $hotel->porcentageCobroAnticipado += $cart->apartamentoObj->pagoOnline;
        $cobroAnticipado += $cart->apartamentoObj->pagoOnline / 100;
        $hotel->tipoReserva = 'online';
        $smarty->assign('hotel', $hotel);
    }
    //$smarty->assign('hotel', $hotel);
    $images = getAllHotelImages($hotel->id);
    $servicios = getAllHotelServicios($hotel->id);
    $smarty->assign('images', $images);
    $smarty->assign('servicios', $servicios);
    if (isset($_REQUEST['print'])) {
        $smarty->display('cancelacionPrint.tpl');
    } else {
        $smarty->display('cancelacion.tpl');
    }
}
Esempio n. 3
0
        $configuracion = $_POST['configuracion'];
        $smarty->assign("configuracion", (object) $configuracion);
        $afiliado_id = $_POST['afiliado_id'];
        $afiliado_id_encriptado = urlencode(Encrypter::encrypt($afiliado_id, 'afiliado'));
        $smarty->assign("code", $afiliado_id_encriptado);
        $result['msg'] = 'ok';
        $enlace = $base_url . '?a=' . $afiliado_id_encriptado;
        $smarty->assign("enlace", $enlace);
        if ($_POST['tipo'] == "completo") {
            $destinos = getAfiliadoDestinos($afiliado_id);
            $smarty->assign("destinos", $destinos);
            $widget = $smarty->fetch('admin/widget/widget.tpl');
        } else {
            if ($_POST['tipo'] == "banner") {
                $rgb = Core_Util_General::hex2rgb($configuracion['backgroundBody']);
                $images = getAllHotelImages($_POST['hotel']);
                $smarty->assign('image', array_pop($images));
                $hotel_h = getHotelById($_POST['hotel']);
                $enlace = 'http://' . $hotel_h->dominioCampania . '?a=' . $afiliado_id_encriptado;
                $smarty->assign("enlace", $enlace);
                $smarty->assign("hotel_h", $hotel_h);
                $destino = getDestino($hotel->destinoId);
                $smarty->assign("destino", $destino);
                $smarty->assign("rgb", implode(",", $rgb));
                $widget = $smarty->fetch('admin/widget/banner.tpl');
            }
        }
        $result['data'] = array('html' => $widget, 'msg' => 'Se guardaron los cambios correctamente', 'enlace' => $enlace);
    }
} else {
    if (strcmp($action, 'insert') == 0) {
Esempio n. 4
0
<?php

if ($hotel) {
    if (strlen($hotel->lugares)) {
        $lugares = explode(',', $hotel->lugares);
        $smarty->assign("lugares", $lugares);
    } else {
        $smarty->assign("lugares", false);
    }
    $himages = getAllHotelImages($hotel->id, true);
    $images = array();
    foreach ($himages as $image) {
        if ($image->nombre && strlen(trim($image->nombre))) {
            array_unshift($images, $image);
        } else {
            array_push($images, $image);
        }
    }
    $smarty->assign('images', $images);
    if ($hotel->destinoId) {
        $imagesDestino = getAllDestinoImages($hotel->destinoId);
        $smarty->assign('imagesDestino', $imagesDestino);
    }
    $servicios = getAllHotelServicios($hotel->id);
    $smarty->assign('servicios', $servicios);
    $condiciones = getAllHotelCondiciones($hotel->id);
    $smarty->assign('condiciones', $condiciones);
    $logotipo = getHotelLogotipo($hotel->id);
    $smarty->assign('logotipo', $logotipo);
    $faq = getFaq(1);
    $contenido = json_decode($faq->contenido);
Esempio n. 5
0
require 'Logic/widget.php';
require 'Logic/afiliado.php';
if (isset($_GET["id"])) {
    $widget = getWidget($_GET["id"]);
    $usuario_id = $usuario->id;
    $afiliado = getAfiliadoByIdUsuario($usuario_id);
    $afiliado_id = $afiliado->id;
    $configuracion = $widget->configuracion;
    $smarty->assign("configuracion", (object) $configuracion);
    $afiliado_id_encriptado = urlencode(Encrypter::encrypt($afiliado_id, 'afiliado'));
    $smarty->assign("code", $afiliado_id_encriptado);
    $enlace = $base_url . '?a=' . $afiliado_id_encriptado;
    $smarty->assign("enlace", $enlace);
    if ($widget->tipo == 'banner') {
        $rgb = Core_Util_General::hex2rgb($configuracion['backgroundBody']);
        $images = getAllHotelImages($configuracion['hotelId']);
        $smarty->assign('image', array_pop($images));
        $hotel_h = getHotelById($configuracion['hotelId']);
        $smarty->assign("hotel_h", $hotel_h);
        $destino = getDestino($hotel->destinoId);
        $smarty->assign("destino", $destino);
        $smarty->assign("rgb", implode(",", $rgb));
        $enlace = 'http://' . $hotel_h->dominioCampania . '?a=' . $afiliado_id_encriptado;
        $smarty->assign("enlace", $enlace);
        $widget_html = $smarty->fetch('admin/widget/banner.tpl');
    } else {
        $destinos = getAfiliadoDestinos($afiliado_id);
        $smarty->assign("destinos", $destinos);
        $widget_html = $smarty->fetch('admin/widget/widget.tpl');
    }
    $smarty->assign('widget', $widget_html);