<?php 
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 * PHP version 5
 *
 * @category Admin_Tool
 * @package  Admin_Tool
 * @author   Aum Infosys <admin@auminfosys.com>
 * @license  ACE
 * @version  CVS:1.0.1
 * @link     http://auminfosys.com/
 * @filesource
 */
 
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 */
	require "../commonincludefiles.php";

	if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"])){	
		$objProductMgmt = new ProductMgmt();	
		
		$qry="Select distinct product_category from lms_productmaster where company_id='".$_SESSION["cCompany_id"]."'";
		$result =dbquery($qry);
		$total = dbRows($result);
		$i=0;
		
		$GroupData = array("count" => $total, "rows" => array());
		if(dbRows($result) > 0){
			$temparray = array();
			while($row = dbArray($result)){
				$temparray["product_category"]   = $row["product_category"];
				$GroupData["rows"][$i] = $temparray;   
				$i++;
			}										
		}				   		 
		echo json_encode($GroupData);
	}
?>