Exemple #1
0
function generarDominioByNombreHotel($hotel, $default = "vikahotel.com")
{
    try {
        $h = strtolower(StringUtils::clean($hotel));
        $dominio = $h . '.' . $default;
        $campanias = DAOFactory::getCampaniaDAO()->queryBySubdominio($dominio);
        if (count($campanias)) {
            $dominios = getDominiosLike($h);
            $i = 1;
            foreach ($dominios as $d) {
                $dd = str_replace($h, '', str_replace('.' . $default, '', $d));
                if (is_numeric($dd)) {
                    $i = 1 + $dd;
                }
            }
            $dominio = $h . $i . '.' . $default;
        }
        return $dominio;
    } catch (Exception $e) {
        var_dump($e);
        return false;
    }
}
Exemple #2
0
     continue;
 }
 $aparts[$k]['es_diferente'] = $es_diferente;
 //if($es_diferente){
 $cleanBlackList = array();
 foreach ($blacklist as $b) {
     $cleanBlackList[] = trim(StringUtils::clean($b));
 }
 foreach ($x->query('div/div[contains(@class,"room_info_wrapp")]/p', $n) as $info_k => $info) {
     if ($info_k == 0) {
         if ($es_diferente) {
             $aparts[$k]['descripcion'] = $info->nodeValue;
         }
     } else {
         $string = preg_replace('/\\s+/', ' ', trim($info->nodeValue));
         if (strlen(trim(str_replace($cleanBlackList, '', trim(StringUtils::clean($string))))) < strlen(trim(StringUtils::clean($string)))) {
             continue;
         } else {
             $aparts[$k]['servicios'][] = $info->nodeValue;
         }
     }
     if ($promociones && (!$promocionesPC || count($promocionesPC) < count($promociones))) {
         foreach ($promociones as $promocion) {
             if (!$promocionesPC[$promocion->id] && verificarPromocion(array($promocion), $info->nodeValue)) {
                 if (!$promocionesPC) {
                     $promocionesPC = array();
                 }
                 $promocionesPC[$promocion->id] = $promocion;
             }
         }
     }
Exemple #3
0
function getWordsInBlacklist()
{
    try {
        $words = array();
        $bl = DAOFactory::getBlacklistDAO()->queryAll();
        foreach ($bl as $b) {
            array_push($words, StringUtils::clean($b->palabra));
        }
        return $words;
    } catch (Exception $e) {
        var_dump($e);
        return false;
    }
}