require_once('Connections/data_back.php');
mysql_select_db($database_data, $data);
$mostrarCurso = false;
if (!isset($HTTP_GET_VARS['conecto'])){
require ('weather.php');
//guarda valores en variables
$tempc=$datos['temperature']['temp_c'];
$tempf=$datos['temperature']['temp_f'];
$imagenW=$icons->get_sky_image();
//update la BD
$sql="UPDATE tiempo SET tempc='".$tempc."',tempf='".$tempf."', imagenw='". $imagenW . "'";
$result = mysql_query($sql, $data);
}else{
//recupera valores de la BD
$sql = "SELECT * FROM tiempo";
$result = mysql_query($sql, $data);
$row = mysql_fetch_array($result);
$tempc=$row["tempc"];
$tempf=$row["tempf"];
$imagenW=$row["imagenw"];
}
if(isset($_COOKIE["language"])){
$colname_noticias = $_COOKIE["language"];}
else{
$colname_noticias = 2; //Opcion por defecto Ingles
}
mysql_select_db($database_data, $data);
//Toma los datos para mostrar el concurso o no
$sql = "select desde,hasta from concurso WHERE idioma=".$colname_noticias;
$result = mysql_query($sql, $data);
$estado = mysql_fetch_row($result);
//Tratamiento de fecha para el concurso.
$fechaAtras = date("m/j/Y",strtotime($estado[0]));
$fechaDelante = date("m/j/Y",strtotime($estado[1]));
$fechaActual = date("m/j/Y",strtotime("now"));
$fechaM = date("m",strtotime($estado[0]));
$fechaD = date("j",strtotime($estado[0]));
$fechaY = date("Y",strtotime($estado[0]));
$atras = mktime(0,0,0,$fechaM,$fechaD,$fechaY); //Tiempo inicial
$fechaM = date("m",strtotime($estado[1]));
$fechaD = date("j",strtotime($estado[1]));
$fechaY = date("Y",strtotime($estado[1]));
$adelante = mktime(0,0,0,$fechaM,$fechaD,$fechaY); //Tiempo final
$fechaM = date("m",strtotime("now"));
$fechaD = date("j",strtotime("now"));
$fechaY = date("Y",strtotime("now"));
$actual = mktime(0,0,0,$fechaM,$fechaD,$fechaY); //Tiempo actual
//Comparacion de las fechas
if(($atras <= $actual) && ($adelante >= $actual)){
$mostrarCurso = true;
}
mysql_free_result($result);
//Toma la mayor noticia
$sql = "select id,titulo from noticias WHERE idioma=".$colname_noticias." ORDER BY fecha DESC LIMIT 0, 1";
$result = mysql_query($sql, $data);
$NoticiaMax = mysql_fetch_row($result);
mysql_free_result($result);
$query_noticias = sprintf("SELECT id, fecha, titulo FROM noticias WHERE idioma = %d ORDER BY fecha DESC LIMIT 0, 5", $colname_noticias);
$noticias = mysql_query($query_noticias, $data) or die(mysql_error());
$result = mysql_query("SELECT * FROM tiempo", $data);
$tiempoRow = mysql_fetch_array($result);
$tempc=$tiempoRow["tempc"];
$tempf=$tiempoRow["tempf"];
$imagenW=$tiempoRow["imagenw"];
function cambio($folder){
$fileList = array();
$handle = opendir($folder);
while (false !== ($file = readdir($handle) ) ) {
if ( substr($file, -4) == ".gif" || substr($file, -4) == ".jpg" ) {
$fileList[count($fileList)] = $file;
}
}
closedir($handle);
$randNum = rand( 0, (sizeOf($fileList) -1) );
return $folder . $fileList[$randNum];
}
if($colname_noticias==1){
echo "";
}elseif($colname_noticias==2){
echo "";
}?>
">
cuba hotel - Brisas Guardalavaca, cuba beach resort owned by the internationally known Hotel Group Cubanacan. Brisas Guardalavaca, part of a brand of 4 star all inclusive resort of Cubanacan Hotels located on one of the best beaches in Cuba, Guardalava, Holguin. No doubt we are the Mega All inclusive resort for the family vacation. Wedding, diving, scuba diving, excursion and more is Brisas Guardalavaca.