<?php
include_once('../../../php/sessionStart.php');
include_once('../../../php/db/dbExec.php');
include_once('../../../php/functions.php');
include_once('../../../php/timezone.php');
include_once('../../../php/privileges.php');
include_once('../../../php/maxExecTime.php');

$bitForm = "iva1040";
$bitMod = "iva";
$empCod = $_SESSION['empCod'];
$empConso = $_SESSION['empConso'];
$usuCod = utf8_decode($_SESSION['usuCod']);
$usuNom = utf8_decode($_SESSION['usuNom']);

switch ($_POST['action']) {
	case 'consultarProvee':
		echo consultarProvee();
		break;
}


function consultarProvee() {
	global $empCod;
	$txtNit=utf8_decode($_POST['txtNit']);

	# QUERYS
	$sProvee = "SELECT TRIM(pro_nom) AS pro_nom FROM provee WHERE pro_nit='$txtNit'";
	
	# EJECUCION DE QUERYS
	$db = new dbExec();
	$resp = $db->sEx($sProvee, "provee");
	$db->close();

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