<?php require "../commonincludefiles.php"; ?>
<?php
$objStudentMgmt = new StudentMgmt();
$objStudentFeesRecMgmt = new StudentFeesRecMgmt();
$objSemesterMgmt = new SemesterMgmt();
$objFeessetupMgmt = new FeessetupMgmt();
$objStudentFeesRecDetailMgmt = new StudentFeesRecDetailMgmt();
$objUserMgmt = new UserMgmt();
if ($_REQUEST['action'] == "branch") {

	$branch_id = Escape($_REQUEST['branch_id']);

	$result = $objStudentMgmt->getStudentbranch($branch_id);
	if (dbRows($result) > 0) {
		$present .= "Student Master,";
	} else {
		$present .= "";
	}
	dbResult($result);

	$result1 = $objStudentFeesRecMgmt->getStudentbranch($branch_id);

	if (dbRows($result1) > 0) {
		$present .= "Fee Receive,";
	} else {
		$present .= "";
	}
	dbResult($result1);
	echo $present;
}
if ($_REQUEST['action'] == "semester") {
	$semester_id = Escape($_REQUEST['semester_id']);

	$result3 = $objSemesterMgmt->getStudentSemester($semester_id);

	if (dbRows($result3) > 0) {
		$present .= "Student Master,";
	} else {
		$present .= "";
	}
	dbResult($result3);


	$result4 = $objFeessetupMgmt->getStudentSemester($semester_id);

	if (dbRows($result4) > 0) {
		$present .= "Fee Setup,";
	} else {
		$present .= "";
	}
	dbResult($result4);


	$result5 = $objStudentFeesRecMgmt->getStudentSemester($semester_id);
	$row = dbQuery($qry);
	if (dbRows($result5) > 0) {
		$present .= "Fee Receive,";
	} else {
		$present .= "";
	}
	dbResult($result5);
	echo $present;
}

if ($_REQUEST['action'] == "student") {
	$student_id = $_REQUEST['student_id'];
	$deleteStudent_Id = json_decode(stripslashes($student_id));
	$student_id = implode(",", $deleteStudent_Id);
	$student_id = Escape($student_id);

	$result6 = $objStudentFeesRecMgmt->getStudentSemesters($student_id);

	if (dbRows($result6) > 0) {
		$present .= "Fee Receive";
	} else {
		$present .= "";
	}
	dbResult($result6);
	echo $present;

}

if ($_REQUEST['action'] == "head") {
	$head_id = Escape($_REQUEST['head_id']);

	$result7 = $objFeessetupMgmt->getStudenthead($head_id);

	if (dbRows($result7) > 0) {
		$present .= "Fee Setup,";
	} else {
		$present .= "";
	}
	dbResult($result7);

	$result8 = $objStudentFeesRecDetailMgmt->getStudenthead($head_id);

	if (dbRows($result8) > 0) {
		$present .= "Fee Receive,";
	} else {
		$present .= "";
	}
	dbResult($result8);
	echo $present;
}

if ($_REQUEST['action'] == "setup") {

	$result8 = $objFeessetupMgmt->getStudentsetup($setup_id);

	if (dbRows($result8) > 0) {
		$present .= "Fee Receive,";
	} else {
		$present .= "";
	}
	dbResult($result8);

	if ($present != '') {
		$present = substr($present, 0, strlen($present) - 1) . ". ";
	}
	echo $present;
}

if ($_REQUEST['action'] == "password") {
	$username = Escape($_REQUEST['username']);
	$password = Escape($_REQUEST['password']);
	$result9 = $objUserMgmt->getuser($username, $password);
	if (dbRows($result9) > 0) {
		echo "right";
	} else {
		echo "wrong";
	}
}

?>