<?php
  	header('Content-type: text/xml');
  	ob_start('ob_gzhandler');
  	require_once('config.php');
  	require_once('config_ini.php');
  	$sql = "select CHAVEACESSO from VENDAS V where V.SITUACAO = 'I' and V.CHAVEACESSO = '".
         $_GET["chaveacesso"] . "'";
  	$query = ibase_query($conexao, $sql) or die(ibase_errmsg());
  	$row = ibase_fetch_row($query);

  	if ($row != null) {
    	$file = file_get_contents($local_nfes.'NFes Autorizadas\\'.$_GET["chaveacesso"].'-nfe.xml');
    	echo $file;
  	}
?>