<?php 
require "../commonincludefiles.php";
if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"])){	
	
	$condition="";
	$i=0;
	 $objProductMgmt = new ProductMgmt();	
 	
	 $where.=" And company_id= '".$_SESSION["cCompany_id"]."'";	
		
	 $result = $objProductMgmt->getAllRecords($limit,$start,$where,$order_field,$order_type);
	 $total  = dbRows($result);

	$productData = array("count" => $total, "product" => array());
	if	(dbRows($result) > 0){
		$temparray = array();
		while($row = dbArray($result)){
					$temparray["product_id"]  = $row["product_id"];
					$temparray["product_name"]   = $row["product_name"];
					/*$temparray["product_price"]  = $row["product_price"];
					$temparray["product_active"]   = $row["product_active"];
					$temparray["product_description"]   = $row["product_description"];*/
					$productData["product"][$i] = $temparray;   
					$i++;
		}										
	}				   		 
 	echo json_encode($productData);	
}
?>