<?
        include 'concha.php'
mysql_connect ("$host", "$usuario", "$contra");
mysql_select_db ("$basedatos");

$sql = "SELECT * FROM rotativas";

$consulta = mysql_query ($sql);
while ($row = mysql_fetch_array($consulta))
{
$ID_ro = $row["ID"];
$tipo = $row["tipo"];
$lugar = $row["lugar"];
$fija = $row["fija"];
?>

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


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

$sql = "SELECT * 
FROM  `publicidades_gif`";

$consulta = mysql_query ($sql);
while ($row = mysql_fetch_array($consulta))
{
$ID_p = $row["ID"];

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

    ?><a target="_blank" href="<?php echo $url ?>"><img src="<?php echo $dom ?>/<?php echo $carpetafoto ?>/<?php echo $img ?>" width="680" /></a><?
	  }
mysql_free_result($consulta);


};


if ($tipo == 'JPG') {



  include 'concha.php';


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


mysql_select_db ("$basedatos");


$sql = "SELECT * FROM publicidades ORDER BY ID desc";


$consulta = mysql_query ($sql);


while ($row = mysql_fetch_array($consulta))


{


$ID = $row["ID"];


$img = $row["img"];

$url = $row["url"];

$carpetafoto = $row["carpetafoto"];


?> <a target="_blank" href="<?php echo $url ?>"><img src="<?php echo $dom ?>/<?php echo $carpetafoto?>/resize_<?php echo $img ?>.jpg" width="680" /></a> <?php }


mysql_free_result($consulta);




};





if ($tipo == 'SWF') {

   $tam_ancho = 680;

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

$sql = "SELECT * FROM publicidades_swf";

$consulta = mysql_query ($sql);
while ($row = mysql_fetch_array($consulta))
{
$ID_p = $row["ID"];

$swf = $row["swf"];
$carpetafoto = $row["carpetafoto"];



$ancho = $row["ancho"];

$alto = $row["alto"];

$lugar = $row["lugar"];


 
	
	$tam_alto = $alto * $tam_ancho / $ancho;
	
		
    
    ?>
          <object  width="<?php echo $tam_ancho ?>" height="<?php echo $tam_alto ?>">
            <param name="src" value="<?php echo $dom ?>/<? echo $carpetafoto ?>/<?php echo $swf ?>" />
            <embed src="<?php echo $dom ?>/<? echo $carpetafoto ?>/<?php echo $swf ?>" pluginspage="http://www.adobe.com/shockwave/download/" width="<?php echo $tam_ancho ?>" height="<?php echo $tam_alto ?>"></embed>
          </object>
          <?
	  }
mysql_free_result($consulta);



};?><?
	  }
mysql_free_result($consulta);
        ?>