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

echo buscar();

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

	# QUERYS
	$sEmpresas = "SELECT *, TRIM(emp_nom) AS emp_nom
				FROM empresas WHERE emp_nom LIKE '%$txtNom%'";

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

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