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

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

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



