Ejemplo n.º 1
0
 public static function loginRedirect()
 {
     global $base_url;
     $url = Core_Util_General::getCurrentUrl();
     if (strpos('Scripts', $url) === false) {
         $_SESSION['user_redirect'] = $url;
     } else {
         $_SESSION['user_redirect'] = $base_url;
     }
     header('Location:' . $base_url . '/admin-login');
 }
Ejemplo n.º 2
0
                /*if(!$beneficio)
                      $beneficio = $hotel->distribuidor->porcentajeBeneficio;
                  */
                if ($usuario_core->getUsuario()->usuarioGrupoId != 3 && $usuario_core->getUsuario()->usuarioGrupoId != 1) {
                    $beneficio = 100 - $beneficio;
                }
                foreach ($reserva->pagos as $k => $pago) {
                    $reserva->pagos[$k]->importe = $pago->importe * $beneficio / 100;
                }
            }
            //print_r($reserva->pagos);
            $smarty->assign('reserva', $reserva);
            $smarty->assign('edit', true);
            $smarty->assign('meses', array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'));
            $smarty->assign('estadosPago', array('Pendiente', 'Denegado', 'Confirmado'));
            $smarty->assign('estadosReserva', Core_Util_General::getEstadosReserva($reserva->tipoCobro));
            $html = $smarty->fetch('admin/reserva/pagos.tpl');
            $result['msg'] = 'ok';
            $result['html'] = $html;
        } else {
            $result['data'] = 'La clave no es válida';
        }
    } else {
        $result['data'] = 'La clave no es válida';
    }
}
if (strcmp($action, 'search') == 0) {
    $term = $_POST['term'];
    $usuario = $usuario_core->getUsuario();
    $elementos = busquedaReservas($term, $usuario->id);
    $result['msg'] = 'ok';
Ejemplo n.º 3
0
<?php

error_reporting(E_ALL);
$hoteles = getHotelesFavoritos();
$columns = array('Campaign', 'Campaign Daily Budget', 'Languages', 'Location ID', 'Location', 'Networks', 'Ad Group', 'Max CPC', 'Flexible Reach', 'Display Network Custom Bid Type', 'Keyword', 'Type', 'Bid adjustment', 'Headline', 'Description Line 1', 'Description Line 2', 'Sitelink text', 'Display URL', 'Destination URL', 'Platform targeting', 'Device Preference', 'Ad Schedule');
$exported = array();
$exported[] = $columns;
$exported_data = array();
$exported_data[] = $columns;
$counter = 1;
$util = new Core_Util_General();
if ($hoteles && is_array($hoteles)) {
    foreach ($hoteles as $k => $hotel) {
        foreach ($columns as $column) {
            switch ($column) {
                case 'Campaign':
                    $exported_data[$counter][] = 'Vikahotel - Canarias';
                    break;
                case 'Campaign Daily Budget':
                    $exported_data[$counter][] = '50';
                    break;
                case 'Languages':
                    $exported_data[$counter][] = 'es';
                    break;
                default:
                    $exported_data[$counter][] = '';
                    break;
            }
            switch ($column) {
                case 'Campaign':
                    $exported_data[$counter + 1][] = 'Vikahotel - Canarias';
Ejemplo n.º 4
0
    if (isset($_POST['configuracion'])) {
        $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 {
Ejemplo n.º 5
0
     $lang_set = $_REQUEST['l'];
     $_SESSION['lang'] = $lang_set;
     //$end_url .= '/l:' . $_REQUEST['l'];
 } elseif (isset($_SESSION['lang'])) {
     $smarty->assign('lang', $_SESSION['lang']);
     $lang_set = $_SESSION['lang'];
 } else {
     $lang_set = 'en';
     if ($hotel->idiomaId) {
         $lang_set = getIdioma($hotel->idiomaId)->codigo;
     }
     $smarty->assign('lang', $lang_set);
     $_SESSION['lang'] = $lang_set;
 }
 $smarty->configLoad($lang_set . '.conf');
 setlocale(LC_ALL, Core_Util_General::getLocaleName($lang_set));
 if ($_REQUEST['a']) {
     $afiliado_id = urldecode(Encrypter::decrypt($_REQUEST['a'], 'afiliado'));
     if (is_numeric($afiliado_id)) {
         $month = 2592000 + time();
         setcookie('afiliado', $_REQUEST['a'], $month, "/", "." . $smarty->getConfigVariable('sistema_nombre_web'));
     }
 }
 /*
     if(isset($_REQUEST['m'])) {
         $smarty->assign('money', $_REQUEST['m']);
         $end_url .= '/m:' . $_REQUEST['m'];
         $smarty->assign('currency', getMonedaByCodigo($_REQUEST['m'])->simbolo);
         $money = $_REQUEST['m'];
     } else {
         $smarty->assign('money', 'EUR');
Ejemplo n.º 6
0
                                             $params['descuentoTipo'] = $regla->tipoDescuento;
                                             $client->debug_flag = true;
                                             $result = $client->call('registrarPorCanal', array('params' => $params));
                 
                                             $result = json_decode($result);
                 
                                             $cupon = $result->data;
                 
                                             $smarty->assign('cupon', $cupon);
                                             $smarty->assign('regla_cupon', $regla);
                                         }*/
             }
         }
         $smarty->assign('cart', $cart);
         $paises = getPaises();
         $smarty->assign('paises', Core_Util_General::countries());
         if ($invalid) {
             $backData = array('nombre' => NULL, 'apellido' => NULL, 'email' => NULL, 'telefono' => NULL, 'paisId' => NULL, 'peticionesEspeciales' => NULL);
             foreach ($backData as $k => $val) {
                 if (isset($_POST[$k])) {
                     $backData[$k] = $_POST[$k];
                 }
             }
             $smarty->assign('backData', $backData);
         }
         $smarty->display('reservar.tpl');
     }
 } else {
     if (!isset($_POST['cartID'])) {
         header('Location: ' . $base_url);
     }