<?php  
require "commonincludefiles.php";
if($_SESSION["VedantnrCollegeId"]!="" && isset($_SESSION["VedantnrCollegeId"]))
{
	$objsubject_allocationMgmt = new cms_subject_allocationMgmt();
	$objsubject_allocationMgmt->subject_allocation_id    = $_POST["subject_allocation_id"] ;
	$objsubject_allocationMgmt->college_id              = $_SESSION["VedantnrCollegeId"] ;
	$objsubject_allocationMgmt->branch_id				= $_POST['branch_hidden'];
	$objsubject_allocationMgmt->semester_id				= $_POST['semester_hidden'];
	$objsubject_allocationMgmt->div_id					= $_POST['division_id'] ;
	$objsubject_allocationMgmt->batch_id				= $_POST['batch_idhidden'] ;
	$objsubject_allocationMgmt->subject_id				= $_POST['subject_hidden'] ;
	$objsubject_allocationMgmt->lectype					= $_POST['lectype_hid'] ;
	$objsubject_allocationMgmt->shift					= $_POST['shift'] ;
	$objsubject_allocationMgmt->employee_id				= $_POST['employee_id_hid'] ;
	
	
	if($_REQUEST['act'] != "del"){
		if($_POST['subject_allocation_id'] !=""){
			$objsubject_allocationMgmt->edit();
		} else if($_POST['subject_allocation_id'] == ''){
			$objsubject_allocationMgmt->add();
		} 
	} else if($_REQUEST['act'] == "del"){
		$objsubject_allocationMgmt->delete();
	}	
	
	
	
	echo '{"success":"true","msg":""}';
}
else {
	echo '{"success":"false","msg":"session expiry"}';
}	         
?>
