

<?php


if(sizeof($ultimateprodata) > 0){

$brandsq='(';
for($i=0;$i<sizeof($ultimateprodata);$i++){
    

    
    
    $brandsids = $ultimateprodata[$i]['groupid2'];
    $brandsids = ($i == (sizeof($ultimateprodata)-1)) ? $brandsids :  $brandsids.', '; 
    $brandsq.=$brandsids;
    
    


}

$brandsq.=')'; 
$brandsinfo = $queries -> getproductbrands('SELECT distinct (a.nam) as gname, a.rowi as cid from kalagroup2 as a left join prc as b on a.rowi = b.groupid2 where GROUPID IN'.$brandsq.' ORDER BY cid');

}else{
$brandsinfo = $queries -> getproductbrands('SELECT distinct (a.nam) as gname, a.rowi as cid from kalagroup2 as a left join prc as b on a.rowi = b.groupid2 ORDER BY cid');
}


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

for($i=0;$i<sizeof($dataz);$i++){
 
$brand_name = $dataz[$i]['name'];   
$brand_id = $dataz[$i]['id'];   

$urltocall = $iscatcalled ? $calledcatcode."&brands=".$brand_id: $calledcatcode."?brands=".$brand_id;   
     
                                
           
   
echo'<a href="'.$urltocall.'" class="badge badge-light p-3 m-1 bg-white text-primary font-weight-normal" style="font-size: 0.85rem;"><div class="">'.$brand_name.'</div></a>';
                                            
           
     
 
}
                  
                          
                         

                          
                          
                     

                                       
                                       
?>   