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

	$result = array (
			"status"	=> 'KO',
			"results"	=> array ()
	);

	$sto_ids_str = "";

	if ( isset ( $_POST['sto_ids']) && is_array($_POST['sto_ids'])) 
	{
    	$sto_ids = $_POST['sto_ids'];

    	$sto_ids_str = implode(',', $sto_ids );
    }

	$pdo = getPDO ();
		
	if ( $pdo )
	{
		$sql = "update storagelist set status=0 where sto_id in (".$sto_ids_str.")";

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

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