<?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"];
	
	$objAccountGroupMgmt = new AccountGroupMgmt();
	
	$i=0;
	$limit=0;
	$start=0;
	$condition="";
	$order_field="";
	$order_type="";
	
	$result = $objAccountGroupMgmt ->getAllRecords(0,0,$condition,"","") ;
	$total = dbRows($result);
	
	$AccountGroupData = array("total" => $total, "rows" => array());
	if	(dbRows($result) > 0) 
		   {
				$temparray = array();
				while($row = dbArray($result)){
					$temparray["account_groupid"]  = $row["account_groupid"];
					$temparray["account_groupname"]   = $row["account_groupname"];
					$temparray["account_type"]   = $row["account_type"];
					$temparray["acc_type_code"]   = $row["acc_type_code"];
					$AccountGroupData["rows"][$i] = $temparray;   
				$i++;
			}										
	}				   		 
 	echo json_encode($AccountGroupData);	
}
?>