<?php  
require "commonincludefiles.php";
if($_SESSION["VedantnrCollegeId"]!="" && isset($_SESSION["VedantnrCollegeId"]))
{
	$objsubject_allocationMgmt = new cms_subject_allocationMgmt();
	$objsubject_allocationMgmt->work_allotment_subject_id    = $_POST["work_allotment_subject_id"] ;
//	$objsubject_allocationMgmt->college_id              = $_SESSION["VedantnrCollegeId"] ;
	//$objsubject_allocationMgmt->batch_id				= $_POST['batch_idhidden'] ;
	//	$objsubject_allocationMgmt->shift					= $_POST['shift'] ;
	
	$objsubject_allocationMgmt->time_id = $_POST['time_id']; 
	$objsubject_allocationMgmt->day_name = $_POST['day_name']; 
	$objsubject_allocationMgmt->room_id = $_POST['hidden_room_id']; 
	$objsubject_allocationMgmt->branch_id				= $_POST['branch_hidden'];
	$objsubject_allocationMgmt->year_id				= $_POST['year_hidden'];
	$objsubject_allocationMgmt->branchyear_id				= $_POST['branchyear_hidden'];
	$objsubject_allocationMgmt->semester_id				= $_POST['semester_hidden'];
	$objsubject_allocationMgmt->div_id					= $_POST['division_id'] ;
	$objsubject_allocationMgmt->subject_id				= $_POST['subject_hidden'] ;
	$objsubject_allocationMgmt->lectype					= $_POST['lectype_hid'] ;
	$objsubject_allocationMgmt->employee_id				= $_POST['employee_id_hid'] ;
		$objsubject_allocationMgmt->lec_id				= $_POST['hidden_lecture_id'] ;
	
	if($_REQUEST['act'] != "del"){
		if($_POST['work_allotment_subject_id'] !=""){
			$objsubject_allocationMgmt->edit_work();
		} else if($_POST['work_allotment_subject_id'] == ''){
			$objsubject_allocationMgmt->add_work();
		} 
	} else if($_REQUEST['act'] == "del"){
		$objsubject_allocationMgmt->delete_work();
	}	
	
	
	
	echo '{"success":"true","msg":""}';
}
else {
	echo '{"success":"false","msg":"session expiry"}';
}	         
?>
