<?php
 require "../commonincludefiles.php";

 if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"]))
 {
	$product_id     	 = Escape($_REQUEST['product_id'])  ? Escape($_REQUEST['product_id'])  :  0;
	
	$condition="";
	$arr = array();
    $total = 0;	

			if($product_id != ""){
				$condition .= " and lp.product_id='$product_id' ";
			}
 
             
			
			$objProductTaxMgmt = new ProductTaxMgmt();	
			$result = $objProductTaxMgmt -> getAllRecords(0,0,$condition,"","");
			$total = dbRows($result);
		    
			$i=0;
		    $producttaxData = array("count" => $total, "result" => array());
			 	 	 	
			if	(dbRows($result) > 0) {
					$temparray = array();
					while($row = dbArray($result)){
						$temparray["tax_id"]          = $row["tax_id"];
						$temparray["tax_name"]        = $row["tax_name"];
						$temparray["amount"]      = $row["tax_amount"];
						$producttaxData["result"][$i]   = $temparray;   
         				$i++;
					}										
		   }				   		 
		 echo json_encode($producttaxData);				
}
?>