<?php header("Access-Control-Allow-Origin: *");?>


<?php

include 'concha.php';




$D = date(d);



$A = date(Y);



$M = date(m);







$date = "$A$M$D";







$A = substr($date, 0, 4); 



$M = substr($date, 4, 2); 



$D = substr($date, 6, 2); 



 



if ($M == '01') {$m = "enero";};







if ($M == '02') {$m = "febrero";};







if ($M == '03') {$m = "marzo";};







if ($M == '04') {$m = "abril";};







if ($M == '05') {$m = "mayo";};







if ($M == '06') {$m = "junio";};







if ($M == '07') {$m = "julio";};







if ($M == '08') {$m = "agosto";};







if ($M == '09') {$m = "septiembre";};







if ($M == '10') {$m = "octubre";};







if ($M == '11') {$m = "noviembre";};







if ($M == '12') {$m = "diciembre";};











?>

           

           

           

           

           

           <?php function dame_el_dia2 ($fecha)



{



$array_dias['Sunday'] = "domingo";



$array_dias['Monday'] = "lunes";



$array_dias['Tuesday'] = "martes";



$array_dias['Wednesday'] = "miercoles";



$array_dias['Thursday'] = "jueves";



$array_dias['Friday'] = "viernes";



$array_dias['Saturday'] = "sabado";



return $array_dias[date('l', strtotime($fecha))];



}?>

           

           

           

           

           

           <?php $dia = dame_el_dia2($date); ?>

           

           

           

           

           

           

           

           <?














$hora = date(H);



$min = date(i);



$hora = "$hora.$min";











include('concha.php');



mysql_connect ("$host", "$usuario", "$contra");



mysql_select_db ("$basedatos");







$sql = "SELECT * FROM programacion WHERE dia = '$dia'";







$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{



$programa= $row["programa"];



$ini = $row["ini"];



$fin = $row["fin"];















$ini = str_replace(".","",$ini);



$fin = str_replace(".","",$fin);



$hora = str_replace(".","",$hora);











$ini =  (int) $ini;



$fin = (int) $fin;



$hora = (int) $hora;















if ($hora > $ini) { 

if ($hora < $fin) { $ID_P = $programa; $ini2 = $row["ini"];



$fin2 = $row["fin"];};



















} else {};











$sql2 = "SELECT * FROM programas WHERE ID = '$ID_P'";







$consulta2 = mysql_query ($sql2);



while ($row2 = mysql_fetch_array($consulta2))



{



$nombre_pro = $row2["nombre"];



$imagen = $row2["imagen"];



$url = $row2["url"];







?>

           

           

           

           <?







}



mysql_free_result($consulta2);







}



mysql_free_result($consulta);



























?>

           

           

           

           <style type="text/css">



<!--



.Estilo19999 {font-family: "Trebuchet MS"}



.Estilo2888888 {font-size: 19px; font-family: "Trebuchet MS"}



-->



  </style>

           <?php if ($nombre_pro == '') {} else {?>

           <div align="center">
             
           <span style=";font-family:<?php echo $style_titulo ?>;font-size:16px;color:<?php echo $d_color_titulo?>;">Estamos escuchando</span><br />
             
          <span style=";font-family:<?php echo $style_titulo ?>;font-size:20px;color:<?php echo $d_color_titulo?>;">  <?php echo $nombre_pro ?><br /></span>
             
             
             
        <span style=";font-family:<?php echo $style_titulo ?>;font-size:16px;color:<?php echo $d_color_titulo?>;">de <?php echo  $ini2 ?> a <?php echo $fin2 ?></span>
             
             
             
             <?php if ($imagen == NULL) {} else {?>
             
             <?php if ($url == NULL) {} else {?>
             
             <a href="<?php echo $url ?>" target="_blank">
               
             <?php };?>
               
             <br />
             <img border="0" src="<? echo $dom;?>/upload_pic/resize_<?php echo $imagen ?>.jpg" />
               
             <?php if ($url == NULL) {} else {?>
               
             </a>
             
             <?php };?>
             
             <br />
             
             <?php };?>
             
             
             
             <br /> 
             
             <?php };?>
           </div>
           