<?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
	$sClien = "SELECT 
					TRIM(cli_nit) AS cli_nit,
					TRIM(cli_nom) AS cli_nom
				FROM clien WHERE cli_nom LIKE '%$txtNom%' AND cli_nit LIKE '$txtNit%'";

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

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