<?php
	require_once '../../autoload.php';

	$result = array (
			"status"	=> 'KO',
			"id"	=> -1
	);

	$id				= $_POST["id"];

	error_log ( " id : " .$id );

	$pdo = getPDO ();
	
	if ( $pdo )
	{
		$s1 = null;
		if ( $id != -1 )
		{
			$s1 = $pdo->prepare ( "update task_master set removed=true where id=:id" );
			$s1->bindParam ( ':id', 	$id 			);
		}
		
		if ( $s1->execute () == true )
		{
			$result['status'] 	= 'OK';
			$result['id']		= $id;
		}
	}

	header('Content-type: application/json');
	
	echo json_encode ( $result );
?>