<?php
session_start();
header('Content-Type: application/json; charset=utf-8');

$response = [];

if (isset($_SESSION['UpdateAbastecimientoGalonera'])) {
    $response['id'] = $_SESSION['UpdateAbastecimientoGalonera'];
} elseif (isset($_SESSION['abast_gal_edit_id'])) {
    $response['id'] = $_SESSION['abast_gal_edit_id'];
}

if (isset($_SESSION['abast_gal_edit_nonce'])) {
    $response['nonce'] = $_SESSION['abast_gal_edit_nonce'];
}

if (!isset($response['id'])) {
    $response['error'] = "No existe sesión de edición de galonera.";
}

echo json_encode($response);
