<?php
include('../../../php/sessionStart.php');
include('../../../php/db/dbExec.php');
include('../../../php/functions.php');

echo buscar();

function buscar() {
	$txtNom=utf8_decode(TRIM($_POST['txtNom']));
	$txtNit=utf8_decode(TRIM($_POST['txtNit']));

	# QUERYS
	$sProvee = "SELECT 
					TRIM(pro_nit) AS pro_nit,
					TRIM(pro_nom) AS pro_nom
				FROM provee WHERE pro_nom LIKE '%$txtNom%' AND pro_nit LIKE '$txtNit%'";

	# EJECUCION DE QUERYS
	$db = new dbExec();
	$resp["provee"] = $db->sFetchAll($sProvee);
	$db->close();

	$func = new functions();
	return $func->jsonEncodeArray($resp, "provee");
}
?>