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

if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"]))
{	

	
	$objDist = new DistMgmt();
	
	$limit=0;
	$start=0;
	$condition="";
	$order_field="dist_nameeng";
	$order_type="ASC";
	
	$result = $objDist->getAllRecords(0,0,$condition,$order_field,$order_type) ;
	$total = dbRows($result);
	$i=0;
	$distictData = array("count" => $total, "rows" => array());
	if	(dbRows($result) > 0) 
		   {
				$temparray = array();
				while($row = dbArray($result)){
					
					$temparray["dist_id"]  = $row["dist_id"];
					$temparray["dist_nameeng"]   = $row["dist_nameeng"];
					$distictData["rows"][$i] = $temparray;   
				$i++;
			}										
	}				   		 
 	echo json_encode($distictData);	
}
?>