#!/usr/bin/perl
use strict;
$ENV{DOCUMENT_ROOT}.='/' if $ENV{DOCUMENT_ROOT};
use Time::Local 'timelocal';
my $html;
my $linea;
my $check;
require $ENV{DOCUMENT_ROOT}.'_adm/incs/clCuaderno.pm';
require $ENV{DOCUMENT_ROOT}.'_adm/incs/Generales.pm';
my $ref=Generales::Entrada();
my %para=%$ref;
######################################################################
open (ARCHI, $ENV{DOCUMENT_ROOT}.'calendario/tpl/cuadernos.htm')||print $!."- cuadernos.pl
\n";
while ($linea = ){
$html .= $linea;
}
close ARCHI;
$html =Generales::sacaLineas($html);
######################################################################
my $oCuaderno=clCuaderno->new();
my @Lista=$oCuaderno->lista("tcuaderno.cOrden ASC", '','',"tcuaderno.cEstado='1'", 'tcuaderno.idCuaderno as c01, tcuaderno.cVolanta as c02, tcuaderno.cTitulo as c03, tcuaderno.cCopete as c04, tcuaderno.cCuerpo as c05, tcuaderno.cDias as c06');
my @ListaDeParametros;
foreach my $Puntero (@Lista) {
my %ParametrosInternos;
$ParametrosInternos{ID}=$$Puntero[0];
$ParametrosInternos{VOLANTA}=$$Puntero[1];
$ParametrosInternos{TITULO}=$$Puntero[2];
$ParametrosInternos{COPETE}=$$Puntero[3];
$ParametrosInternos{CUERPO}=$$Puntero[4];
$ParametrosInternos{DIAS}=$$Puntero[5];
push @ListaDeParametros, {%ParametrosInternos};
}
$html=Generales::LoopDatos2Html($html, \@ListaDeParametros, 'CUADERNOS');
$html=~ s/.*//;
########################## IMPRIMISION ############################################
$html =Generales::procesarDinamico($html,1);
$html =Generales::poneLineas($html);
Generales::imprimir($html);
#############################################################################################