<?php

//call for cats
if(isset($_SESSION['uzi']) && isset($_SESSION['pzi']) && isset($_SESSION['czi']) && isset($_SESSION['ucid'])){
    
    $qw = $_SESSION['uzi'];
    $qe = $_SESSION['pzi'];
    $qr = $_SESSION['ucid']; 
    $catsinfo = $queries -> getproductcategories("EXEC GetPrc_group_sp @p1= ".$qw." , @p2 = ".$qe.", @ucid = ".$qr);
}else{
    
    $qw = 'a';
    $qe = 'a';
    $qr = 'a';
    $catsinfo = $queries -> getproductcategories("EXEC GetPrc_group_sp_nu");
}

$dataz = array();
$data = array();
if(is_array($catsinfo) && sizeof($catsinfo) > 0){
    
  $cninfo = $catsinfo[0]['catinfo'];
    
    if(is_array($cninfo) && sizeof($cninfo) > 0){
		$dataz = $cninfo;
	}
}

for($i=0;$i<sizeof($dataz);$i++){
 
$cat_img = $imgfadd.$dataz[$i]['pic'];   
$cat_name = $dataz[$i]['name'];   
$cat_id = $dataz[$i]['id'];   

    
 
echo'<a href="products.php?cat='.$cat_id.'" class="badge badge-light p-3 m-1 bg-white text-primary font-weight-normal" style="font-size: 0.75rem;"><div class="">'.$cat_name.'</div></a>';
                                            
           
 
}

                 

$qw = null;
$qe = null;
$qr = null;
     

                          
                          
                         

                          
                          
                     

                                       
                                       
?>   