<?php
  header('Content-type: application/json');

  require_once("config.php");

  ob_start('ob_gzhandler');

  $sql = "select CASE WHEN coalesce(EM_CONTINGENCIA,'') = 'T' THEN 2 ELSE 1 END NFE_MODOEMISSAO FROM VENDEDORES WHERE CODVENDEDOR = ".$_GET["codvendedor"];

  $query = ibase_query($conexao, $sql);

  $query = ibase_fetch_object($query);

  $obj = new stdclass();

  $obj->NFE_MODOEMISSAO = $query->NFE_MODOEMISSAO;

  $array = array();
  $array[] = $obj;

  echo json_encode($array);

  ibase_close();

?>