Exemple #1
0
/*
	25/09/2015 Vicente Giraldo
*/
if ($_POST) {
    // ¡¡¡ Es un bot !!!
    if (!empty($_POST['email'])) {
        exit;
    }
    require "../BD.class.php";
    require "../GM_usuarios.class.php";
    require "../GM_general.class.php";
    BD::conectar();
    $datos = GM_usuarios::obtener_datos_para_contacto($_POST['ref']);
    BD::desconectar();
    if ($datos != 0) {
        $email["accion"] = "contacto_anuncio";
        $email["nombre"] = $datos["nombre"];
        $email["email"] = $datos["email"];
        $email["nombre_contactante"] = $_POST["nombre_contactante"];
        $email["email_contactante"] = $_POST["y7687s"];
        $email["tlf_contactante"] = $_POST["tlf_contactante"];
        $email["referencia"] = $_POST["ref"];
        $email["msj"] = $_POST["comment"];
        $email["titulo"] = $datos["titulo"];
        $email["enlace"] = "http://" . $_SERVER['HTTP_HOST'] . "/" . $datos['nombre_rr'] . "/" . GM_general::slugify($datos['titulo']) . "-gm" . $_POST["ref"] . ".htm";
        echo GM_usuarios::enviar_email($email);
    }
} else {
    return 0;
}
Exemple #2
0
	                <a href="#" class="vrTp">Ver todos <i class="fa fa-angle-double-right"></i></a>
	                <!--<a href="#" class="navTp desNav iz"><i class="fa fa-chevron-left"></i></a>
	                <a href="#" class="navTp de"><i class="fa fa-chevron-right"></i></a>-->
	            </div>
	            
	        </div>
	        
	        <div class="formaFichas">
	            
	            <div class="grupoFichasTop gftac">';
    }
    if ($result) {
        while ($row = mysqli_fetch_assoc($result)) {
            $str .= '<div class="fichaInfo">
                    <div class="listaFichaIzq">';
            $ficha = '/' . GM_general::obtener_nombre_rr_categoria($row[$cat]) . '/' . GM_general::slugify($row['titulo']) . '-gm' . $prefijo . $row['id'] . '.htm';
            switch ($categoria) {
                case -2:
                    $img_arr = GM_busquedas_motor::obtener_fotos_anuncio($row['id']);
                    break;
                case -3:
                    $img_arr = GM_busquedas_inmo::obtener_fotos_anuncio($row['id']);
                    break;
                default:
                    $img_arr = GM_busquedas_motor::obtener_fotos_anuncio($row['id']);
                    break;
            }
            if (empty($img_arr)) {
                $img = '/img/templates/no-foto.gif';
            } else {
                $img = "/img/img_anuncios/" . $img_arr[0]['url'];
					FROM anuncios AS a JOIN motor AS m ON m.anuncio_id = a.id ';
                            break;
                    }
                    BD::conectar();
                    $result = BD::consultar("SELECT hijos FROM categorias WHERE id = '{$categoria_actual}'");
                    $row = mysqli_fetch_row($result);
                    mysqli_free_result($result);
                    $sql = empty(trim($row[0])) ? $sql_cab . "WHERE a.categoria_id2 = '{$_GET['categoria-actual']}'" : $sql_cab . "WHERE a.categoria_id2 IN ({$row[0]}) ";
                    $sql .= ' AND a.id=' . $f_rel . ' ';
                    $result = BD::consultar($sql);
                    if ($result) {
                        $data = array();
                        while ($row = mysqli_fetch_assoc($result)) {
                            $data[] = $row;
                        }
                        mysqli_free_result($result);
                        foreach ($data as &$anuncio) {
                            $anuncio['fch'] = GM_general::slugify($anuncio['titulo']) . '-gmm' . $anuncio['id'];
                            $anuncio['imagenes'] = GM_busquedas_motor::obtener_fotos_anuncio($anuncio['id']);
                        }
                        // echo ($sql);
                        echo json_encode($data);
                        BD::desconectar();
                    } else {
                        echo 0;
                    }
                }
            }
        }
    }
}