<?php session_start();
include ('../inc/dbcon.php');
include ('../inc/functions.php');
include ('../inc/repfunctions.php');
if(isset($_SESSION["axeslogin"]) && $_SESSION["axeslogin"] == true){    
$aid=$_SESSION['uid'];
$brid=$_SESSION['abrid'];    
}else{
header('Location:../index.php');
exit;    
}
$output='';
if(isset($_POST['catid'])){
   $id=$_POST['catid'];
    $sql="SELECT * FROM tbl_subcat WHERE catid='$id' ORDER BY name ASC";
    $query=mysqli_query($con,$sql)or die(mysqli_error($con));
    while ($rowc=mysqli_fetch_array($query)){
    $sid=$rowc['id'];
    $output.='<button id="subcat_'.$rowc['id'].'" type="button" title="'.$rowc['name'].'" class="btn-prni btn-outline-primary subcat" data-container="body"><img src="../img/product/';
    if(empty($rowc['image'])){$output.='no_image.png';}else{$output.=$rowc['image'];}
    $output.='" alt="'.$rowc['name'].'" class="img-rounded" /><span>'.$rowc['name'].'</span></button>';
    }
}
echo $output;
exit;