<?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"]))
{
	$schoolid = $_SESSION["cCompany_id"];
	
	$objAccountSubGroupMgmt = new AccountSubGroupMgmt();
	
	$i=0;
	$limit=0;
	$start=0;
	$condition="";
	$order_field="subgroup_id";
	$order_type="ASC";
	
	$result = $objAccountSubGroupMgmt ->getAllRecords(0,0,$condition,$order_field,$order_type) ;
	$total = dbRows($result);
	
	$SubGroupData = array("total" => $total, "rows" => array());
	if	(dbRows($result) > 0) 
		   {
				$temparray = array();
				while($row = dbArray($result)){
					$temparray["subgroup_id"]  = $row["subgroup_id"];
					$temparray["subgroup_name"]   = $row["subgroup_name"];
					$SubGroupData["rows"][$i] = $temparray;   
				$i++;
			}										
	}				   		 
 	echo json_encode($SubGroupData);	
}
?>