<?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 = "cxp2050";
$bitMod = "cxp";
$empCod = $_SESSION['empCod'];
$usuCod = utf8_decode($_SESSION['usuCod']);
$usuNom = utf8_decode($_SESSION['usuNom']);

switch ($_POST['action']) {

	case 'consultarProvcp':
		echo consultarProvcp();
		break;


}


function consultarProvcp() {
	global $empCod;
	$txtCod=utf8_decode($_POST['txtCod']);

	# QUERYS
	$sProvcp = "SELECT *, TRIM(pro_nom) AS pro_nom, TRIM(pro_retsn) AS pro_retsn FROM provcp WHERE pro_emp='$empCod' AND pro_cod='$txtCod'";

	# EJECUCION DE QUERYS
	$db = new dbExec();
	$resp = $db->sEx($sProvcp, "provcp");
	$db->close();

	$func = new functions();

	return $func->jsonEncodeArray($resp, "provcp");
}


?>