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

echo buscar();

function buscar() {
	$txtNom=utf8_decode(TRIM($_POST['txtNom']));
	
	# QUERYS
	$sTipoc = "SELECT 
					TRIM(tc_cod) AS tc_cod,
					TRIM(tc_nom) AS tc_nom
				FROM tipoc WHERE tc_nom LIKE '%$txtNom%'";

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

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