<?php
session_start();
include 'config.php';

$_SESSION['usuario'] = "REPLICA";
$_SESSION['clave'] = "REPLICA";

$sql = "SELECT NOMTERC, PREF, NUMERO, NOMVENDEDOR, NIT, CANT, ARTIDES, ARTICULO, FECHA, ANULADO, DIRECENT, BARRIOENT, DESCORTA, TELEFONO FROM IMPR_TRASFERENCIA_NUM('". $_GET["pref"] ."','". $_GET["num"] ."',". $_GET["vend"] .")";

try {
	$dbh = new PDO("firebird:dbname=$dbname", $_SESSION['usuario'], $_SESSION['clave']);	
	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$stmt = $dbh->prepare($sql);
	$stmt->execute();
	$vend = $stmt->fetchAll(PDO::FETCH_OBJ);
	$dbh = null;
	echo json_encode($vend); 
} catch(PDOException $e) {
	echo '[{"ERROR":"1","MSJ":"SE PRESENTO EL SIGUIENTE ERROR:","ERRORMSJ":"'.$e->getMessage().'","CODE":"'.$e->getCode().'"}]';
}


?>