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

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

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



