<?php

//call for cats
$catsinfo = $queries -> getproductcategories("EXEC GetPrc_group_sp @p1= ".$_SESSION['uzi']." , @p2 = ".$_SESSION['pzi'].", @ucid = ".$_SESSION['ucid']);
$dataz = array();
$data = array();
if(is_array($catsinfo) && sizeof($catsinfo) > 0){
    
  $cninfo = $catsinfo[0]['catinfo'];
    
    if(is_array($cninfo) && sizeof($cninfo) > 0){
        
        for($i=0;$i<sizeof($cninfo);$i++){
            
             $images = $queries -> getproductcategoriesimg("EXEC GetPrc_group_pic_sp @p1= ".$_SESSION['uzi']." , @p2 = ".$_SESSION['pzi'].", @ucid = ".$_SESSION['ucid'].", @id = ".$cninfo[$i]['id']);
             $images = $imgfadd.$images;
			 
            $temp =array('img' => $images,"name" => $cninfo[$i]['name'],"count" => $cninfo[$i]['count'], "id" => $cninfo[$i]['id']);
            array_push($dataz,$temp);
            
        }
        
        
    }
 
    
}


for($i=0;$i<sizeof($dataz);$i++){
 
$cat_img = $dataz[$i]['img'];   
$cat_name = $dataz[$i]['name'];   
$cat_cat = $dataz[$i]['count'];   
$cat_id = $dataz[$i]['id'];   

echo '<div class="col-xl-3 col-lg-4 col-6 mb-xl-4 mb-lg-3 mb-2 px-0">';
echo '<a href="products.php?cat='.$cat_id.'" class="text-decoration-none">';
echo '<div class="cat-card mx-1">';
echo '<div class="cat-img-backlayer"></div>';
echo '<div class="cat-img" style="background-image: url('.$cat_img.');"></div>';
echo ' <div class="cat-title text-right d-flex align-items-center justify-content-end text-truncate">'.$cat_name.'</div>';
echo ' <div class="cat-countovelay"> </div>';
echo ' <div class="cat-count d-flex align-items-center justify-content-center">'.$cat_cat.'</div>';
echo ' </div></a></div>';
                  
 
}

                 


                          
                          
                         

                          
                          
                     

                                       
                                       
?>   