<?php 
include("../db_connection.php");
if(isset($_POST['mcatid']))
{

$sql=mysql_query("select * from tbl_category where mcid='".$_POST['mcatid']."' and status='Enable' order by name asc");
while($res=mysql_fetch_assoc($sql))
{
	?>
		<li><input type="checkbox" name="category" class="category" value="<?php echo $res['cid']?>"> <?php echo $res['name']?>
        
         	<ul class="list-unstyled long-list Subcategories_<?php echo $res['cid'];?>" style="height:auto; overflow-y:scroll; display:none;">		    </ul>
        </li>
	<?php
}
}


if(isset($_POST['catid']))
{

$sql=mysql_query("select * from tbl_subcategory where cid='".$_POST['catid']."' and status='Enable' order by name asc");
while($res=mysql_fetch_assoc($sql))
{
	?>
		<li><input type="checkbox" name="subcategory" class="subcategory" value="<?php echo $res['sid']?>"> <?php echo $res['name']?></li>
	<?php
}
}


?>

