<?php
require "commonincludefiles.php";
error_reporting(1);
if ($_SESSION["VedantnrCollegeId"] != "" && isset($_SESSION["VedantnrCollegeId"])) {
	$objrelievingorder = new relievingorderCertificateMgmt();
	$objrelievingorder->relievingordercertificate_id  		= $_REQUEST['relievingordercertificate_id'];
	$objrelievingorder->branch_id     		= $_REQUEST['branch_hidden'];
	$objrelievingorder->year_id       		= $_REQUEST['year_hidden'];
	$objrelievingorder->branchyear_id 		= $_REQUEST['branchyear_hidden'];
	$objrelievingorder->semester_id   		= $_REQUEST['semester_hidden'];
    $objrelievingorder->certificate_no 		= $_REQUEST['certificate_no'];
	$objrelievingorder->student_id 			= $_REQUEST['student_hidden'];
	$objrelievingorder->student_gturegno 	= $_REQUEST['student_gturegno'];
	$objrelievingorder->relievingorder_date 	= $_REQUEST['relievingorder_date'];
	$objrelievingorder->college_id 			    = 	$_SESSION['VedantnrCollegeId'];

	if ($objrelievingorder->relievingordercertificate_id == 0 || $objrelievingorder->relievingordercertificate_id == "" ) {
		// Add Part
		$objrelievingorder->add();

		if ($objrelievingorder->relievingordercertificate_id == 0) {
			echo '{"success":"false","msg":"duplicate"}';
		} else {
			echo '{"success":"true","msg":"success"}';
		}
	
	} else {
		// Edit Part
		$objrelievingorder->edit();
		echo '{"success":"true","msg":"success"}';
	}
} else {
	echo '{"success":"false","msg":"session expiry"}';
}



