<?php
	require "../commonincludefiles.php";
	
	$year_id = Escape($_REQUEST['year_id']);
	$branchyear_id = Escape($_REQUEST['branchyear_id']);
	$semester_id = Escape($_REQUEST['semester_id']);
	$feesrec_no  = Escape($_REQUEST['feesrec_no']);
    $date_entered 		= Escape($_REQUEST['date']);

	if ($feesrec_no != '') {
		$condition .= " AND receipt_no = '$feesrec_no'-1 ";
	}

	if ($year_id != '') {
		$condition .= " AND year_id = $year_id";
	}
	if ($_REQUEST['branchyear_id'] != '') {
		$condition .= " AND branchyear_id = $branchyear_id";
	}
	
	if ($semester_id != '') {
		$condition .= " AND semester_id = $semester_id";
	}
	$objStudentFeesRecMgmt = new StudentFeesRecMgmt();		
	$result = $objStudentFeesRecMgmt-> verifyDate($condition,$date_entered);	
	if($result=="true")
	{ 
 		echo "{success:true,valid:'".$result."'}";	    
	}else
	{ 
		echo "{success:true,valid:'".date('d M, Y',strtotime($result))."'}";	    
	
	}
?>