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

echo buscar();

function buscar() {
    $empCod=$_SESSION['empCod'];
    $numCodvaca=$_SESSION['numCodvaca'];
    $numCiclovaca=$_SESSION['numCiclovaca'];

	# QUERYS
	$sVaca = "SELECT *, TRIM(rvd_obs) AS rvd_obs, TRIM(rvd_soli) AS rvd_soli
				FROM regvacd WHERE rvd_emp='$empCod' AND rvd_cod = '$numCodvaca' AND rvd_periodo = '$numCiclovaca' ORDER BY rvd_fdesi,rvd_fdesf";
	# EJECUCION DE QUERYS
	$db = new dbExec();
	$resp["regvacd"] = $db->sFetchAll($sVaca);
	$db->close();

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