<?php

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

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

		$objrelievingorder = new relievingorderCertificateMgmt();
		$objrelievingorder ->deletemoicertificate_Id = implode(",",$deletemoicertificate_Id);			
		$objrelievingorder ->delete();
		echo '1';
	}        
}
?>
