Próximas Novedades
ERROR AL EFECTUAR LA CONEXION"; } else { mysql_select_db("siicsalud", $co); putenv('TZ=America/Buenos_Aires'); setlocale(LC_ALL, 'es_AR'); //$fecha = AveriguaDia($co); $fecha = laborable(date("Y-m-d"), 1); $pe = "SELECT a.nroartic, a.codestilo, trim(getStrSinAcentos(a.titulocaste, 1)) AS titulocaste, b.ciudad, b.pais, a.esencia, c.nombre AS revista, b.nombre, b.apellido FROM articulos AS a INNER JOIN articautores AS b ON a.nroartic = b.nroartic INNER JOIN revistas AS c ON a.codrevista = c.codrevista WHERE a.fechapublicacion = '$fecha' AND b.principal = '1'"; $resu = mysql_query($pe, $co); if ($resu > 0) { while ($row = mysql_fetch_object($resu)) { $nroartic = (trim($row->nroartic)); $codestilo = (trim($row->codestilo)); $titulocaste = (trim($row->titulocaste)); $titulocaste = acentos($titulocaste); $titulocaste = strtoupper($titulocaste); $titulocaste = htmlentities($titulocaste); $titulocaste = str_replace("<", "<", $titulocaste); $titulocaste = str_replace(">", ">", $titulocaste); $ciudad = (trim($row->ciudad)); $ciudad = htmlentities($ciudad); $pais = (trim($row->pais)); $pais = htmlentities($pais); $esencia = (trim($row->esencia)); $esencia = htmlentities($esencia); $revista = (trim($row->revista)); $revista = htmlentities($revista); $nombre = (trim($row->nombre)); $nombre = htmlentities($nombre); $apellido = (trim($row->apellido)); $apellido = htmlentities($apellido); switch ($codestilo) { case "ARSIIC": $ima = 'flecha_rojo.gif'; break; case "ENSIIC": $ima = 'flecha_naranja.gif'; break; case "CROSIIC": $ima = 'flecha_celeste.gif'; break; case "RESIIC": $ima = 'flecha_rosa.gif'; break; case "INSIIC": $ima = '/imagenes/flecha_verde.gif'; break; } echo $ima . " " . $titulocaste . ""; if ($codestilo == "ARSIIC") echo $nombre . " " . $apellido . ", "; echo "" . $ciudad . ", " . $pais . "
\n"; } mysql_free_result($resu); } } function AveriguaDia($co) { $hacer = 1; $suma = 1; while ($hacer == 1) { $man = mktime(0, 0, 0, date("m"), date("d") + $suma, date("Y")); $fecha = date("Y-m-d", $man); $manu = date("w", $man); if ($manu == 6) { $man = mktime(0, 0, 0, date("m"), date("d") + 3, date("Y")); $fecha = date("Y-m-d", $man); } if ($manu == 0) { $man = mktime(0, 0, 0, date("m"), date("d") + 2, date("Y")); $fecha = date("Y-m-d", $man); } $es_feriado = AveriguarFeriado($fecha, $co); if ($es_feriado == 0) { $hacer = 0; } $suma++; } return $fecha; } function AveriguarFeriado($fecha, $co) { // retorna 0 si no es feriado 1 si es feriado $pe = "SELECT * FROM `feridado` WHERE `fecha` = $fecha"; $res = mysql_query($pe, $co); if ($res > 0) { $registros = mysql_num_rows($res); if ($registros >= 1) { $es_feridado = 1; } else { $es_feriado = 0; } } return $es_feriado; } ?>