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

//subject allocation
	
	$sql = "select employee_id from cms_employeemaster where user_id ='".$_SESSION["VedantnrUserId"]."'";
	$sql_res = dbQuery($sql);
	$sql_rec = dbArray($sql_res);
	$faculty_id = $sql_rec[0];
	$batch_id="";
	
	
	
	
	$objcms_batchmasterMgmt= new cms_batchmasterMgmt();
	
	if($batch_id!=""){
		$condition = " And batch_id in(".$batch_id.")";
	}
	
	$result = $objcms_batchmasterMgmt->getAllRecords(0,0,$condition,$order_field,$order_type);
	$total = dbRows($result);
	$i=0;
	$yearData = array("count" => $total, "data" => array());
	
	if(dbRows($result) > 0){
		$temparray = array();
			while($row = dbArray($result)){
			$temparray["batch_id"]  = $row["batch_id"];
			$temparray["batch_name"]   = $row["batch_name"];
			$yearData["data"][$i] = $temparray;   
			$i++;
		}										
	}				   		 
	echo json_encode($yearData);	

?>