<?php

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

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

		$objattempt = new attemptCertificateMgmt();
		$objattempt ->deleteattempt_Id = implode(",",$deleteattempt_Id);			
		$objattempt ->delete();
		echo '1';
	}        
}
?>
