コード例 #1
0
ファイル: llenarhotel.php プロジェクト: randyibarrola/active
    if (strlen($element->getAttribute('data-resized')) > 0) {
        $ruta = trim($element->getAttribute('data-resized'));
        $arr = explode(".", $ruta);
        $img_ext = $arr[count($arr) - 1];
        $new_name = md5($ruta);
        $new_file_name = $template_dir . "/images/apartamentos/" . $new_name . "." . $img_ext;
        if (!file_exists($new_file_name)) {
            file_put_contents($new_file_name, file_get_contents($ruta));
        }
        $new_ruta = $template_url . "/images/apartamentos/" . $new_name . "." . $img_ext;
        $imagenes[$e_k]['ruta'] = $new_ruta;
    }
    $imagenes[$e_k]['tipo'] = 'imagen';
    $imagenes[$e_k]['extension'] = 'jpg';
}
$hoteles = getHotelByUrl($hotel_url);
if ($hoteles && count($hoteles) > 0) {
    foreach ($hoteles as $h) {
        deleteHotelServicios($h->id);
        deleteHotelImages($h->id);
        deleteHotel($h->id);
    }
}
$descripcion = $html('#summary');
$descripcion_larga = trim($descripcion[0]->getInnerText());
$nombre = $html('#hp_hotel_name');
$nombre = trim($nombre[0]->getInnerText());
$rating = $html('#wrap-hotelpage-top h1 span.use_sprites');
if (isset($rating[0]) && strlen($rating[0]->getAttribute('title')) > 0) {
    $rating = filter_var($rating[0]->getAttribute('title'), FILTER_SANITIZE_NUMBER_INT);
} else {
コード例 #2
0
ファイル: index.php プロジェクト: randyibarrola/active
$money = 'EUR';
$hotel_domain = $_SERVER['SERVER_NAME'];
$usar_moneda_hotel = false;
if (isset($_REQUEST['m'])) {
    $money = $_REQUEST['m'];
    actualizarCambioMoneda();
    $_SESSION['money'] = $money;
    //$end_url .= '/m:' . $_REQUEST['m'];
} elseif (isset($_SESSION['money'])) {
    $money = $_SESSION['money'];
} else {
    $usar_moneda_hotel = true;
}
$hotel = getHotelByDominio($hotel_domain);
if (!$hotel) {
    $hotel = getHotelByUrl($hotel_url);
}
if ($hotel) {
    $moneda = getMoneda($hotel->monedaId);
    if ($usar_moneda_hotel && $hotel->monedaId) {
        $money = $moneda->codigo;
    }
    $m = getMonedaByCodigo($money);
    $currency = $m->simbolo;
    $showSubPrice = $currency != $moneda->simbolo;
    $smarty->assign('money', $money);
    $smarty->assign('moneda', $m);
    $smarty->assign('currency', $currency);
    $smarty->assign('showSubPrice', $showSubPrice);
    //actualizarCambioMoneda();
    $campania = getCampania($hotel->campaniaId);