<?php
require '../config/config.php';
require '../config/database.php';
require '../config/auth.php';

$id = (int)$_GET['id'];
$stmt = $pdo->prepare("SELECT * FROM notas_fiscais WHERE id=?");
$stmt->execute([$id]);
$nota = $stmt->fetch();

header("Content-Type: text/xml");
readfile($nota['xml_path']);
