<?php

 require "commonincludefiles.php";
$task = '';
if ( isset($_POST['task'])){
   $task = $_POST['task'];
}
switch($task){
    case "deletecum":
        deletecum();
        break;
    default:
        echo "{failure:true}";
        break;
}

function deletecum(){
   $conduct_Ids = $_POST['ids']; 
   if (version_compare(PHP_VERSION,"5.2","<"))  {    
     require_once("./JSON.php"); 
     $json = new Services_JSON();
     $deletecumreliving_Id = $json->decode(stripslashes($conduct_Ids));
   } else {
     $deletecumreliving_Id = json_decode(stripslashes($conduct_Ids));
   }
    if(sizeof($deletecumreliving_Id)<1){
	  echo '0';
    }
	else {

		$objcum = new cumrelivingCertificateMgmt();
		$objcum ->deletecumreliving_Id = implode(",",$deletecumreliving_Id);			
		$objcum ->delete();
		echo '1';
	}        
}
?>
