<? include 'concha.php';


$sql = "SELECT * FROM rotativas WHERE lugar = 'abajo' ORDER BY rand() LIMIT 1";

$consulta = $conn->query($sql);
while ($row = $consulta->fetch_assoc())
{
$ID_ro = $row["ID_publicidad"];
$tipo = $row["tipo"];
$lugar = $row["lugar"];
$fija = $row["fija"];
?>

<?php 
if ($tipo == 'GIF/PNG/JPG') {


$sql12 = "SELECT * FROM  `publicidades_gif` WHERE ID = '$ID_ro' ";

$consulta12 = $conn->query($sql12);;
while ($row12 = $consulta12->fetch_assoc())
{
$ID_p = $row12["ID"];

$img = $row12["img"];
$carpetafoto = $row12["carpetafoto"];
$url = $row12["url"];

    ?>
    <?php if ($url == '') {} else {?>
    <a target="_blank" href="<?php echo $url ?>"><?php };?><img src="<?php echo $dom ?>/<?php echo $carpetafoto ?>/<?php echo $img ?>"  class="img-fluid  img-responsive" /><?php if ($url == '') {} else {?></a><?php };?><?
	  
    
}
$consulta12->free_result();


};


	  }
$consulta->free_result();
        ?>