<?php 
require "../commonincludefiles.php";
if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"]))
{
	$schoolid = $_SESSION["cCompany_id"];
	$yearid = $_SESSION["cYear"];
	
	$objAccountMaster = new AccountMasterMgmt();
	
	$limit=0;
	$start=0;
	$condition=" AND section_active='1' AND company_id= '$schoolid' AND year_id = '$yearid' " ;
	$order_field="section_id";
	$order_type="ASC";
	$result = $objSection->getAllRecords(0,0,$condition,$order_field,$order_type) ;
	$total = dbRows($result);
	$i=0;
	$sectionData = array("count" => $total, "rows" => array());
	if	(dbRows($result) > 0) 
		   {
				$temparray = array();
				while($row = dbArray($result)){
					$temparray["section_id"]  = $row["section_id"];
					$temparray["section_name"]   = $row["section_name"];
					$sectionData["rows"][$i] = $temparray;   
				$i++;
			}										
	}				   		 
 	echo json_encode($sectionData);	
}
?>