<?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->idDelivery) && isset($paramObj->token) && $paramObj->token == TOKEN_BRODEVO){
    $idDelivery=$paramObj->idDelivery;
    $delivery = new Delivery($idDelivery);
    $delivery->retrieve();
    $ack['result'] = $delivery->isLogged();
} else {
    $ack['result'] = -2;
}

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