<?php  
	require "commonincludefiles.php";
	
	if(isset($_SESSION["VedantnrCollegeId"]) && $_SESSION["VedantnrCollegeId"] != "")
	{
		$objdocument = new DocumentMgmt();
		$objdocument->document_id = $_POST['document_id'];
		$objdocument->document_name = $_POST['document_name'];
		$objdocument->branch_id = $_POST['branch_hidden'];

		
		if($objdocument->document_id == 0){
			$objdocument->adddocument();
		}
		else{			
			if(isset($_REQUEST['act']) && $_REQUEST['act'] == "del")
				$objdocument->deletedocument();
			else
				$objdocument->editdocument();
		}

		echo '{"success":"true"}';
	}
	else
	{
		echo '{"success":"false","msg":"session expiry"}';
	}
?>
