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

echo buscar();

function buscar() {
	$dtFecIni=utf8_decode(TRIM($_POST['dtFecIni']));
	$dtFecFin=utf8_decode(TRIM($_POST['dtFecFin']));
	$empCod=$_SESSION['empCod'];

	# QUERYS
	$sCtrpla = "SELECT * 
			FROM ctrpla 
			WHERE ctrp_emp='$empCod' AND ctrp_fini>='$dtFecIni' AND ctrp_ffin<='$dtFecFin'";
	# EJECUCION DE QUERYS
	$db = new dbExec();
	$resp["ctrpla"] = $db->sFetchAll($sCtrpla);
	$db->close();

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