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

echo buscar();

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

	# QUERYS
	$sCliencc = "SELECT 
					TRIM(cli_cod) AS cli_cod,
					TRIM(cli_nit) AS cli_nit,
					TRIM(cli_nom) AS cli_nom
				FROM cliencc WHERE cli_nom LIKE '%$txtNom%' AND cli_cod LIKE '%$txtCod%' AND cli_emp='{$_SESSION["empCod"]}'";

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

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