<?php

/* 
 * ROMAN DIGITAL - Autor: Américo Patetta
 */

set_include_path("../../");
include_once("server/class/Delivery.php");

$jsonParams = file_get_contents('php://input');
$paramObj = json_decode($jsonParams);

if(isset($paramObj->idDelivery) && isset($paramObj->token) && $paramObj->token == TOKEN_BRODEVO){
    $idDelivery=$paramObj->idDelivery;
   // $idLocal=$paramObj->idLocal;
    
    $delivery = new Delivery($idDelivery);
    if($delivery->dismiss($idDelivery)){
        $ack['result'] = 0;
    } else {
        $ack['result'] = -1;
    }
} else {
    $ack['result'] = -2;
}

header('Content-Type: application/json; charset=utf-8');
echo json_encode($ack);