<?php
  ob_start('ob_gzhandler');
  require_once('config.php');
  $sql = "select NRODOCUMENTO, NROSERIE from VENDAS V ".
         "where SITUACAO = 'I' and NROVENDA = ".$_GET["nrovenda"];
  $query = ibase_query($conexao, $sql) or die(ibase_errmsg());
  $row = ibase_fetch_object($query);
  if ($row != null) {
    $array = array();
    $array[] = $row;
    //echo "NRODOCUMENTO:".$row[0]."\n NROSERIE:".$row[1];
    echo json_encode($array);
  } else
    echo "";
?>