<?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
	$sClasii = "SELECT 
					TRIM(cla_cod) AS cla_cod,
					TRIM(cla_nom) AS cla_nom
				FROM clasii WHERE cla_emp='$empCod' AND cla_nom LIKE '%$txtNom%'";

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

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