<?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]['piccat'];   
$cat_name = $dataz[$i]['name'];   
$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-box mx-1">';
echo '<div class="cat-box-backlayer"></div>';
echo '<div class="cat-box-img" style="background-image: url('.$cat_img.');"></div>';
echo '<div class="cat-box-shape"><svg viewBox="0 0 500 150" preserveAspectRatio="none" style="height: 100%; width: 100%;"><path d="M0.00,49.98 C165.06,72.53 424.09,132.72 500.00,49.98 L500.00,0.00 L0.00,0.00 Z" style="stroke: none; fill: #fefefe88;"></path></svg></div>';
echo '<div class="cat-box-title text-right d-flex align-items-center justify-content-end text-truncate font-weight-light">'.$cat_name.'</div>';
echo ' </div></a></div>';
                  
 
}

                 

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

                          
                          
                         

                          
                          
                     

                                       
                                       
?>   