<?php
require_once '../../config.php';
$id = $_GET['pedido_id'] ?? 0;
$stmt = $pdo->prepare("SELECT status FROM pedidos WHERE id = ?");
$stmt->execute([$id]);
$res = $stmt->fetch();
echo json_encode(['status' => $res['status'] ?? 'pendente']);
?>