<?php
include "conex.php";
header('Content-Type: application/json');

$id = intval($_POST['id'] ?? 0);
$zona = trim($_POST['zona'] ?? '');

if ($id <= 0 || $zona === '') {
  echo json_encode(['success' => false, 'message' => 'Datos inválidos']);
  exit;
}

mysqli_query($conex, "UPDATE tb_zona SET zona = '$zona' WHERE id = $id");
echo json_encode(['success' => true]);
