<div class="w3-row w3-margin-bottom w3-hide-small w3-hide-medium">
<div class="w3-container w3-card w3-bluepm">
<h3 style="margin-top:8px;font-size:22px;"><i class="fa fa-th"></i> Categorii</h3>
</div>
<div class="w3-bar-block w3-white">
<?php
$qcateg = "SELECT * FROM `categorii` WHERE 1=1 ORDER BY data_m ASC";
$rcateg = $dbc->query($qcateg);

 if($rcateg->num_rows > 0){
     while($rowcat = $rcateg->fetch_assoc()){
       $qscateg = "SELECT * FROM `scategorii` WHERE `cat_id`='".$rowcat['cat_id']."'";
       $rscateg = $dbc->query($qscateg);    
        
echo '<a href="'.PATH.$rowcat['seo'].'.html" class="w3-bar-item w3-button w3-hover-seagreen w3-card" style="margin-bottom:4px;"><i class="fa fa-th-list"></i> &nbsp;'.$rowcat['titlu'].'</a>';   
     } 
   }else{
      echo '<div class="w3-padding w3-center">Nu sunt categorii adăugate</div>';
 } ?>
</div>
</div>

<div class="w3-row w3-card w3-margin-bottom w3-hide-small w3-hide-medium">
<div class="w3-container w3-bluepm">
<h4 style="margin-top:3px; font-size:22px;"><i class="fa fa-search-plus"></i> Căutări populare</h4>
</div>
<div class="">
<?php
$qsrcpop = "SELECT * FROM `cautari` ORDER BY `valoare` DESC LIMIT 15";
$rsrcpop = $dbc->query($qsrcpop);
if($rsrcpop->num_rows > 0){
while($srcpop = $rsrcpop->fetch_assoc()){ ?>
<form class="" action="cautare.html" method="post">
<div class="w3-col" style="width:33.33%;max-width:98%;padding:1%;">
<button class="w3-button w3-hover-seagreen w3-bluepm" title="<?=$srcpop['titlu']?>" style="width:100%;"><?=$srcpop['titlu']?></button>
</div>
<input type="hidden" name="caut" value="<?=$srcpop['titlu']?>"/>
</form>
<?php } } ?>
</div>
</div>