<?php 
require "commonincludefiles.php";
require "data/sendingsms_studentpresant.php";

if($_SESSION["VedantnrCollegeId"]!="" && isset($_SESSION["VedantnrCollegeId"]))
{
 
		
 
 	$objStudent = new StudentMgmt();




	$objStudent->college_id           =$_SESSION["VedantnrCollegeId"] ;
	$objStudent->branch_id 	         	=$_REQUEST["branch_hidden1"] ;
	$objStudent->semester_id 	        =$_REQUEST["semester_hidden1"] ;
	$objStudent->student_gturegno 	  =$_REQUEST["enrollment_no"] ;
	$objStudent->student_surname 	    =$_REQUEST["student_surname"] ;
	$objStudent->student_firstname 	  =$_REQUEST["student_firstname"] ;
	$objStudent->student_lastname 	  =$_REQUEST["student_lastname"] ;
		$objStudent->student_gender 	  =$_REQUEST["gender_hidden"] ;
		$objStudent->student_city 	  =$_REQUEST["student_city"] ;
		$objStudent->student_mobilestudents 	  =$_REQUEST["student_mobilestudents"] ;
		
		
		$objStudent->student_category 	  =$_REQUEST["category_hidden"] ;
		
	$objStudent->fees_flag 	  =1 ;
	$objStudent->computer_fee 					=($_REQUEST["computer_fee"] == "on") ? '1' : '0';
	
 	// edit mode 
	if ($_REQUEST["ID"] > 0 && isset($_REQUEST["ID"])){   
	 	$objStudent->student_id = $_REQUEST["ID"];
		$objStudent -> edit(); 
	
    }
	else if ($_REQUEST["ID"] ==0 && isset($_REQUEST["ID"])){    
		$objStudent -> add();
		$student_id = $objStudent->student_id;
	}
				
	if($objStudent->student_id > 0){							
		//$student_id1 = $objStudent->student_id;
		/* START DATA SAVE IN DETAIL */ 
		$objStudDetail = new StudentDetailMgmt();
		$objStudDetail->student_id = $student_id;	
		$objStudDetail->cur_branchid = $_REQUEST["branch_hidden1"];
		$objStudDetail->cur_semesterid = $_REQUEST["semester_hidden1"];
		$objStudDetail->cur_divison = $_REQUEST["division_hidden"];
		$objStudDetail->ba_core 	  =$_REQUEST["ba_hiddencore"] ;
		$objStudDetail->ba_el1 	  =$_REQUEST["ba_hiddenel1"] ;
		$objStudDetail->ba_el2 	  =$_REQUEST["ba_hiddenel2"] ;
		$objStudDetail->bsc_group 	  =$_REQUEST["bsc_hiddengroup"] ;
		$objStudDetail->msc_group 	  =$_REQUEST["msc_hiddengroup"] ;
		$objStudDetail->current_active = 1;
		
		if($_REQUEST["ID"] == 0){
			$objStudDetail->AddNewSemester();
			
		}
		else{
			$objStudDetail->EditNewSemester();
		}
		
	

	}
	
	echo '{"success":"true"}';
}	         
?>
