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

	$result = array (
			"status"	=> 'KO',
			"results"	=> -1
	);
	
	$pdo = getPDO ();
		
	if ( $pdo )
	{
		$modident_id				= -1;
				
		if ( isset($_POST['modident_id']) )		$modident_id	= $_POST['modident_id'];

		$sql = 'update modality_identity set mod_id = -1 where modident_id = :modident_id;';

		$s0 = $pdo->prepare ( $sql );

		$s0->bindParam ( ':modident_id',	$modident_id 	);
		
		if ( $s0->execute () == true )
		{
			$result['status'] = 'OK';
			$result['results'] = $mod_id;
		}
	}
	
	header('Content-type: application/json');
	
	echo json_encode ( $result );
?>