<?php

 require "../commonincludefiles.php";

error_reporting(1);
 if($_REQUEST['grno']!="" && $_REQUEST['branch_id']!="")
 {
	$grno			= 	$_REQUEST['grno'];
	$branch_id		= 	$_REQUEST['branch_id'];
	$active		    = 	isset($_REQUEST['active']) ?  $_REQUEST['active']  :  0;		
	
	$condition="";
	
	if($branch_id != ""){
		
		
		$condition .= " and sd.cur_branchid='$branch_id' ";
	}
	
	if($grno != ""){
		$condition .= " and sm.student_gturegno='$grno' ";
	}
	
 /*   if($active == "Yes" && $active != ""){
		$condition .= " and sm.student_active = 'Yes' ";
	}
*/	
	
	$objStudentMgmt = new StudentMgmt();	
	$out = $objStudentMgmt ->getAllStudentRecords(1,0,$condition,"","");
	
	$count=dbRows($out);
	if($count > 0){
		$row=dbArray($out);
		extract($row);		
		
		
		
		$studata = array("success" => true, "data" => array());	
	 //   $studata['data']['student_id'] = $student_id;
		$studata['data']['student_id'] = $student_name;
		$studata['data']['student_gturegno'] = $student_gturegno;
		$studata['data']['branch_id'] = $cur_branchid;
		$studata['data']['year_id'] = $year_id;//stnadrd_id //for get student detail in add fee 
		$studata['data']['branchyear_id'] = $cur_branchyearid;//standrd_name //for leave certificate std name view
		$studata['data']['semester_id'] = $cur_semesterid;//division_name
		
		$studata['data']['branch_name'] = $branch_name;
		$studata['data']['year_name'] = $year_name;//stnadrd_id //for get student detail in add fee 
		$studata['data']['branchyear_name'] = $branchyear_name;//standrd_name //for leave certificate std name view
		$studata['data']['semester_name'] = $semester_name;//division_name
		echo json_encode($studata);
	}else {
		echo '{"success":false}';
	}
}
?>