<?php




include 'concha.php';
$cat=(int)$_GET['cat'];
$subcat=(int)$_GET['subcat'];
$titulo = "$nombresitio / Archivo";
include 'arriba_full.php';

?>


 <div class="news-summary <? if ($estiloweb == 4 || 61) { ?> col-lg-8 col-md-8<? } else { ?>col-lg-9 col-md-9 <? } ?> col-sm-12 col-12 p-0" >

    <div class="widget-head">
        
        <h3 <? if ($estiloweb <= 3){echo 'style="padding: 1px 5px 1px 5px; background-color:'; echo $d_color_fondo_menu; echo ';font-family:'; echo $style_titulo; echo ';font-size:25px;color:#ffffff;"'; } else {echo 'class="widget-title"';} ?>>

            <span><? echo $lang_100083?></span>

        </h3>

    </div>

    <div class="col-12">

        <div class="col-12 p-0">
    
            <div class="">
                
                 <a class="btn btn-primary" href="publicar1.php">
                    <img src="PUBLICARAVISO.jpg" class="img-fluid" />
                 </a>
            
            </div> 
    
            <div class="grid">
    
                <?  
                    $sql = "SELECT * FROM cla_categorias ORDER BY nombre";
                    $consulta = $conn->query($sql);
                    while ($row = $consulta->fetch_assoc())
                    {
                        $ID = $row["ID"];
                        $nombre = $row["nombre"]; 
                ?> 
        
                <div class="grid-item col-6 col-sm-4" >
        
                  <a class="btn btn-outline-primary col-12 p-0" href="clasificados.php?cat=<?php echo $ID ?>" class=""><?php echo $nombre ?></a>
        
                </div>
        
                <?
                if ($ID == $cat) {
                    
                    $sql2 = "SELECT * FROM subcategorias WHERE IDC = '$cat'";
                    
                    $consulta2 = $conn->query($sql2);
                    
                    while ($row2 = $consulta2->fetch_assoc())
                    
                    {
                        $ID = $row2["ID"];
                        $nombre = $row2["nombresub"]; 
                ?>
                
                <div class="row">
                    <div class="grid-item3" style="background-color:#FFFF99;">
                        <span class="Estilo43">
                            <a href="clasificados.php?subcat=<?php echo $ID ?>&cat=<?php echo $cat ?>"><?php echo $nombre ?></a>
                        </span>
                    </div> 
                 </div>
                <?
                   
                    }
                    
                    $consulta2->free_result();
                ?>
                
        
                <?  } }
                
                $consulta->free_result();
                ?>
    
            </div>
            
    </div>
    
        <div class="grid" style="">
    
                
        
        <? 
        if ($cat == NULL) {} else { 
            
           
            $sql = "SELECT * FROM cla_categorias WHERE ID = '$cat';";
            $consulta = $conn->query($sql);
            while ($row = $consulta->fetch_assoc())
            {
                $categoria = $row["nombre"];
            } $consulta->free_result(); 
            
            echo "$categoria"; 
        
        }; 
        
        ?>
        
        <?
        
        if ($subcat == NULL) {} else { 
          
            $sql = "SELECT * FROM subcategorias WHERE ID = '$subcat';";
            $consulta = $conn->query($sql);
            while ($row = $consulta->fetch_assoc())
            {
                $subcategoria = $row["nombresub"];
                
            } $consulta->free_result(); 
        ?> 
        
             <? echo $subcategoria; }; ?>
        
        
        <?
        if ($cat == NULL and $subcat == NULL) {
        ?>
        
            <p><?php include 'clasi_mostrar_sin_cat.php';?></p>
    
         <? };
         
         if ($cat == NULL) {} else { 
             
             if ($subcat == NULL) {
                 
                 include 'clasi_mostrar_cat.php';
                 
             } else {}; 
             
         };
         
        if ($cat == NULL) {} else { 
            
            if ($subcat == NULL) {} else {
                
             include 'clasi_mostrar_subcat.php';
             
            };
        
        };
        
        ?>
     
     </div>

    </div>

</div>

<?php include 'abajo_full.php';?>