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

$sql = "select DES, DESCORTA, GRUPO, SUBGR, MARCA, UNIDAD, ALTERNATIVA, IVA, CONSUMO, EXISTEN, PRECIO, OBS ".
 "from TRAE_ARTICULO_MOVIL('" . $_GET["codart"] . "', ". $_GET["codven"] . ", '". $_GET["cliente"] . "')";

try {
//	$dbh = new PDO("firebird:dbname=$dbname", 'SYSDBA', 'MASTER123');	
	$dbh = new PDO("firebird:dbname=$dbname", $_SESSION['usuario'], $_SESSION['clave']);	
	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$stmt = $dbh->prepare($sql);
	$stmt->execute();
	$nomc = $stmt->fetchAll(PDO::FETCH_OBJ);
	$dbh = null;
	echo '{"items":'. json_encode($nomc) .'}'; 
} catch(PDOException $e) {
	echo '{"items":[{"DES":""}]}'; 
}


?>