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

echo buscar();

function buscar() {
	$txtNom=utf8_decode(TRIM($_POST['txtNom']));
	$txtCel=utf8_decode(TRIM($_POST['txtCel']));
	$txtTel=utf8_decode(TRIM($_POST['txtTel']));

	# QUERYS
	$sClienPed = "SELECT *,
					TRIM(clip_cel) AS clip_cel,
					TRIM(clip_nom) AS clip_nom,
					TRIM(clip_dir) AS clip_dir
				FROM clien_ped WHERE clip_nom LIKE '%$txtNom%' AND clip_cel LIKE '$txtCel%' AND clip_tel LIKE '$txtTel%'";

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

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