<?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
	$sTipomaq = "SELECT *,
					TRIM(tm_nom) AS gru_nom
				FROM tipomaquina WHERE tm_nom LIKE '%$txtNom%'";

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

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