<?php

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

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

		$objmidwifery = new midwiferyCertificateMgmt();
		$objmidwifery ->deletemidwifery_Id = implode(",",$deletemidwifery_Id);			
		$objmidwifery ->delete();
		echo '1';
	}        
}
?>
