<?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->idLocal) && isset($paramObj->tarjeta) && isset($paramObj->token) && $paramObj->token == TOKEN_BRODEVO){
if(isset($paramObj->token)){
    $delivery = new Delivery();
    $ack['result'] = ($delivery->retrieveFromToken($paramObj->token) >= 0)?1:0;
} else {
    $ack['result'] = -1;
}

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