<?php

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

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

		$objconduct = new conductCertificateMgmt();
		$objconduct ->deleteconduct_Id = implode(",",$deleteconduct_Id);			
		$objconduct ->delete();
		echo '1';
	}        
}
?>
