
<?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');







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



$consulta = $conn->query($sql);



while ($row = $consulta->fetch_assoc())



{



$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 = $conn->query($sql2);



while ($row2 = $consulta2->fetch_assoc())



{



$nombre_pro = $row2["nombre"];



$imagen = $row2["imagen"];



$url = $row2["url"];







?>

           

           

           

           <?







}



$consulta2->free_result();







}



$consulta->free_result();




?>

         

<style type="text/css">






  </style>

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

           <div class="row" style="margin:30px auto;">
               
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
               
                <?php if ($imagen == NULL) {} else {?>
             
             <?php if ($url == NULL) { ?>
    
    
    
<? } else {?>
             
             <a href="<?php echo $url ?>" target="_blank">
               
             <?php };?>
               
             <img  class="img-responsive" style="margin:auto;" src="<? echo $dom;?>/upload_pic/resize_<?php echo $imagen ?>.jpg" />
               
             <?php if ($url == NULL) {} else {?>
               
             </a>
             
             <?php };?>
             
             
             
             <?php };?>

</div>

             
            
               
               <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                   
                   <h4 style=";font-family:<?php echo $style_titulo ?>;color:<?php echo $d_color_titulo?>;">Estamos escuchando</h4>
             
          <h2 style=";font-family:<?php echo $style_titulo ?>;color:<?php echo $d_color_titulo?>;"><?php echo $nombre_pro ?></h2>
             
             
             
        <p style=";font-family:<?php echo $style_titulo ?>;color:<?php echo $d_color_titulo?>;">de <?php echo  $ini2 ?> a <?php echo $fin2 ?></p>
             

</div>

             
           
            
             
            </div>
             
             <?php };?>
           
           