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

echo buscar();

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

	# QUERYS
	$sArtic = "SELECT *, 
			TRIM(art.art_desc) AS art_desc,
			TRIM(art.art_desd)  AS art_desd,
			TRIM(art.art_cod) AS art_cod,
			TRIM(art.art_codf) AS art_codf
			FROM mp_artic art
			WHERE art_emp='$empCod' AND art_desc LIKE '%$txtDescb%' AND art_codf LIKE '%$txtCodFab%' AND art_cod LIKE '%$txtCodb%'";

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

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