#!/usr/bin/perl
use strict;
$ENV{DOCUMENT_ROOT}.='/' if $ENV{DOCUMENT_ROOT};
require $ENV{DOCUMENT_ROOT}.'_adm/incs/Generales.pm';
require $ENV{DOCUMENT_ROOT}.'_adm/incs/clNota.pm';
my $ref=Generales::Entrada();
my %para=%$ref;
use CGI::Carp "fatalsToBrowser";
my $html;
my $linea;
my $check;
my $hoy = time;
my $fotoTapa;
my $epigrafeTapa;
my @Eventos;
require $ENV{DOCUMENT_ROOT}.'_adm/incs/clArtista.pm';
my $oArtista = clArtista->new();
open (ARCHI, $ENV{DOCUMENT_ROOT}.'db/tpl/tapa.htm')||print $!."- tapa.pl
\n";
while ($linea = ){
$html .= $linea;
}
close ARCHI;
$html =Generales::sacaLineas($html);
my $html2;
$html=~ s/()(.*)()/$1$2$3/i;
my $destacado=$2;
my $html2;
my $contador=0;
my $letras="a b c d e f g h i j k l m n o p q r s t u v w x y z";
my @Letras=split(" ",$letras);
foreach my $Letra (@Letras) {
my @Row=$oArtista->lista("tartista.cApellido, tartista.cNombre",'','',"tartista.bActivo=1 AND tartista.cApellido like '$Letra%'", "tartista.idArtista, tartista.cApellido, tartista.cNombre");
my @lista;
if (($#Row+1)>0) {
$html2.=$destacado;
foreach my $Puntero (@Row) {
my $nombre;
if ($$Puntero[2]) {
$nombre="$$Puntero[1], $$Puntero[2]";
}else{
$nombre="$$Puntero[1]";
}
push @lista, qq~$nombre
~;
}
my @columnas;
my $mitad=int($#lista/2);
my $cont=0;
foreach my $fila (@lista) {
if ($cont<=$mitad) {
$columnas[0].=$fila;
}else{
$columnas[1].=$fila;
}
$cont++;
}
$html2=~s//\U$Letra/gi;
$html2=~s//$columnas[0]/gi;
$html2=~s//$columnas[1]/gi;
}
}
$html=~ s/()(.*)()/$html2/i;
############################################################################################################
$html =Generales::procesarDinamico($html);
$html =Generales::poneLineas($html);
Generales::imprimir($html);
############################################################################################################