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

$sql = "select * from TRAE_CLIENTES_MOVIL('" . $_GET["buscar"] . "'," . $_GET["vend"] . ")"; 

try {
	$dbh = new PDO("firebird:dbname=$dbname", $_SESSION['usuario'], $_SESSION['clave']);	
	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$stmt = $dbh->query($sql);  
	$clientes = $stmt->fetchAll(PDO::FETCH_OBJ);
	$dbh = null;
	echo '{"items":'. json_encode($clientes) .'}'; 
} catch(PDOException $e) {
	echo '{"error":{"text":'. $e->getMessage() .'}}'; 
}


?>