<?php
require "../commonincludefiles.php";
$task = '';
if ( isset($_POST['task'])){
  $task = $_POST['task'];
}
switch($task){
    case "LISTING":
        getList();
        break;
    case "DELETESTU":
        deletePresidents();
        break;
    default:
        echo "{failure:true}";
        break;
}

function deletePresidents(){

   $Student_Ids = $_POST['ids']; 
   $deleteStudent_Id = json_decode(stripslashes($Student_Ids));
	
    if(sizeof($deleteStudent_Id)<1){
	  echo '0';
    }
	else {

		$objStudentMgmt = new StudentMgmt();
		$objStudentMgmt->deleteStudent_Id 	= implode(",",$deleteStudent_Id);
		$objStudentMgmt ->delete();
		
		$StudentDetailMgmt = new StudentDetailMgmt();
		$StudentDetailMgmt->student_id		= implode(",",$deleteStudent_Id); 
		$StudentDetailMgmt->DeleteStudentDetail();
		
		echo '1';
	}        
}
?> 