<?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
	$sSubFamii = "SELECT *,
					TRIM(sdep_dep) AS sdep_dep,
					TRIM(sdep_cod) AS sdep_cod,
					TRIM(sdep_nom) AS sdep_nom
				FROM subdeptosi WHERE sdep_nom LIKE '%$txtNom%'";

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

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