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

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

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



