    
	
	
	<?
$can = 0;
include('concha.php');

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

mysql_select_db ("$basedatos");



$sql = "SELECT * FROM avisos WHERE ver = 'si' AND IDS = '$subcat' ORDER BY rand() LIMIT 40";



$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{

$ID = $row["ID"];

$titulo = $row["titulo"];

$linea1 = $row["linea1"];

$linea2 = $row["linea2"];

$IDC = $row["IDC"];

$IDS = $row["IDS"];

$userp = $row["user"];


$can = $can + 1;
 ?>






<link href="estilo.css" rel="stylesheet" type="text/css" />
<table width="100%" border="0" cellpadding="0" cellspacing="1">

  <tr>

    <td>

        

        

        <table width="200" border="0" align="left" cellpadding="0" cellspacing="0">

          <tbody>

            <tr>

              <td width="14"><img src="imag/fdo_002.gif" width="14" height="22" /></td>

              <td width="200" background="imag/fdo-02_002.gif" class="Estilo1"><div align="left" class="Estilo42"><strong><?php echo $titulo ?></strong></div></td>

              <td width="11"><img src="imag/fdo-03_002.gif" width="11" height="22" /></td>
            </tr>

            <tr>

              <td background="imag/fdo-04.gif"><img src="imag/spacer.gif" width="7" height="7" /></td>

              <td valign="top" bgcolor="#ffffff"><img src="imag/spacer.gif" width="7" height="7" /></td>

              <td background="imag/fdo-06.gif"><img src="imag/spacer.gif" width="7" height="7" /></td>
            </tr>

            <tr>

              <td background="imag/fdo-04.gif">&nbsp;</td>

              <td valign="top" bgcolor="#ffffff"><table class="texto" width="200" border="0" cellpadding="0" cellspacing="0">

                </table>

                  <div align="left"></div>

              <table width="100%" border="0">

                    <tr>

                      <td class="Estilo42"><?php echo $linea1 ?></td>
                    </tr>

                    <tr>

                      <td class="Estilo42"><?php echo $linea2 ?></td>
                    </tr>

                    

                 <?php   

$sql2 = "SELECT * FROM cla_categorias WHERE ID = $IDC";



$consulta2 = mysql_query ($sql2);

while ($row2 = mysql_fetch_array($consulta2))

{



$nombrecat = $row2["nombre"];

}

mysql_free_result($consulta2);





$sql3 = "SELECT * FROM subcategorias where ID = $IDS";



$consulta3 = mysql_query ($sql3);

while ($row3 = mysql_fetch_array($consulta3))

{

$nombresub = $row3["nombresub"];

}

mysql_free_result($consulta3);?>

                    

                    

                    

                    <tr>

                      <td class="Estilo4">&raquo; <?php echo $nombrecat ?> &raquo; <?php echo $nombresub ?></td>
                    </tr>

                    <tr>

                      <td class="Estilo4"><div align="right"><a href="anuncio.php?ID=<?php echo $ID ?>">Ver Anuncio</a> &raquo;</div></td>
                    </tr>
                  </table></td>

              <td background="imag/fdo-06.gif">&nbsp;</td>
            </tr>

            <tr>

              <td height="10"><img src="imag/fdo-07.gif" width="10" height="10" /></td>

              <td><img src="imag/fdo-08.gif" width="310" height="10" /></td>

              <td><img src="imag/fdo-09.gif" width="11" height="10" /></td>
            </tr>
          </tbody>
        </table>    </td>
  </tr>
</table>





     

       
            <? }

mysql_free_result($consulta);

?>
          
          
           <div align="center"><br />
          <? if ($can == 0) { ?>
            <span class="Estilo42"> AUN NO HAY AVISOS PUBLICADOS EN ESTE RUBRO</span> 
          <? } ?>
          
        </div>
