<?php
require "commonincludefiles.php";

if ($_SESSION["VedantnrCollegeId"] != "" && isset($_SESSION["VedantnrCollegeId"])) {

	$objStudentDetailMgmt = new StudentDetailMgmt();
 	$feeData = json_decode(stripslashes($_REQUEST['fee_data']));
	$studentids = json_decode(stripslashes($_REQUEST['student_ids']));
	$mafifees_refname = json_decode(stripslashes($_POST['mafifees_refname']));
    $mafifees_date = json_decode(stripslashes($_POST['mafifees_date']));
	
	$branch_id = $_REQUEST['branch_hidden'];
	$year_id = $_REQUEST['year_hidden'];
	$branchyear_id = $_REQUEST['branchyear_hidden'];
	$semester_id = $_REQUEST['semester_hidden'];

	$j = count($studentids);


	for ($i = 0; $i < $j; $i++) {
	
		foreach ($feeData as $fee_head => $amount) {
			

			$objStudentDetailMgmt->updatmafifee($fee_head, $amount[$i], $studentids[$i], $mafifees_date[$i],$mafifees_refname[$i], $branch_id, $year_id, $branchyear_id, $semester_id);
		
	}
	
	}
	echo '{"success":"true"}';


} else {
	echo '{"success":"false","msg":"session expiry"}';
}
?>