<?php

 require "commonincludefiles.php";
$task = '';
if ( isset($_POST['task'])){
  $task = $_POST['task'];
}
switch($task){
    
    case "DELETEDIST":
        deleteUsers();
        break;
    default:
        echo "{failure:true}";
        break;
}
function deleteUsers(){
   $Dist_ids = $_POST['ids'];   
   if (version_compare(PHP_VERSION,"5.2","<"))  {    
     require_once("./JSON.php"); 
     $json = new Services_JSON();
     $deleteDist_Id = $json->decode(stripslashes($Dist_ids));;
   } else {
     $deleteDist_Id = json_decode(stripslashes($Dist_ids));
   }
    if(sizeof($deleteDist_Id)<1)
	{
	  echo "0";
    }
	else {

		$objDistMgmt= new DistMgmt();
		$objDistMgmt->deleteDist_Id = implode(",",$deleteDist_Id);
		$objDistMgmt ->delete();
		echo "1";		
	}        
}
?> 



