#!/usr/bin/perl # # $path=$ENV{'DOCUMENT_ROOT'}."/cgi-bin/"; $thisurl="http://www.arta-web.com/cgi-bin/batlesa.cgi"; @cat=("Biblioteca Municipal","Fons documental Miquel Barceló","Serveis Llingüístics","Serveis Socials","Serveis Educatius","Escola d'Adults"); require "/home/arta/data/cfg.arta"; ######################################### # Agafa el Input if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; if ($allow_html != 1) { $value =~ s/<([^>]|\n)*>//g; } if ($name eq "key") { push (@checks,$value); } $form{$name} = $value; } $start=$form{'start'}; $end=$form{'end'}; if ($start eq "") { $start=0; } $end=$start+$increment; if ($buffer =~ /admin/) { $form{'action'}="admin"; } $form{'terms'}=~s/\n//g; $name=""; ################################## # Mostra la capçalera HTML $display.="Noticies: \n"; open(ESTIL,"/home/arta/data/style.arta"); while ($line = ) { $display.=$line; } close ESTIL; $display.=""; open(CAPCELERA,"/home/arta/data/capcelera.arta"); while ($line = ) { $display.=$line; } close CAPCELERA; ################################## if ($form{'action'} eq "") { $display.="
"; } elsif ($cat eq "Fons documental Miquel Barceló") { $ciclisme.=""; } elsif ($cat eq "Serveis Llingüístics") { $futbol.=""; } elsif ($cat eq "Serveis Socials") { $hipica.=""; } if ($cat eq "Serveis Educatius") { $natacio.=""; } if ($cat eq "Escola d'Adults") { $volei.=""; } } $display.="
"; &menu_izquierda; # &separador; &visita_virtual; # &separador; &serveis_ajuntament; $display.=""; $display.="
"; open(ESPORTS,"/home/arta/data/batlesa.arta"); while (@esports = ) { @noticies_esports=@esports; } close(ESPORTS); foreach $line(@noticies_esports) { ($id, $titol, $posicio, $data, $texte, $cat) = split(/\|/, $line); if ($cat eq "Biblioteca Municipal") { $basquet.="
 $titol
 $titol
 $titol
 $titol
 $titol
 $titol
$basquet

"; $display.=" $ciclisme

"; $display.=" $futbol

"; $display.=" $hipica

"; $display.=" $natacio

"; $display.=" $volei

"; $display.=""; $display.="
"; $display.="
Llocs d'interés:
"; open(VISITAS,"/home/arta/data/llocs.txt"); while (@llocs = ) { foreach $llocs(@llocs) { $display.="\n\n"; $llocs=~s/\n//g; $llocs=~s/\|\*\|/\/g; $llocs=~s/\|\*\*\|//g; ($id,$nom,$descripcio,$imatges,$subtitol)=split(/\|/,$llocs); $display.="• $nom
"; } } close (VISITAS); $display.="
"; $display.="
Rutes interesants:
"; open(VISITAS,"/home/arta/data/rutes.txt"); while (@llocs = ) { foreach $llocs(@llocs) { $display.="\n\n"; $llocs=~s/\n//g; $llocs=~s/\|\*\|/\/g; $llocs=~s/\|\*\*\|//g; ($id,$nom,$descripcio,$imatges,$subtitol)=split(/\|/,$llocs); $display.="• $nom
"; } } close (VISITAS); $display.="
"; $display.="
"; } if ($form{'action'} eq "ver") { $display.="
"; } elsif ($cat eq "Fons documental Miquel Barceló") { $ciclisme.=""; } elsif ($cat eq "Serveis Lligüístics") { $futbol.=""; } elsif ($cat eq "Serveis Socials") { $hipica.=""; } if ($cat eq "Serveis Educatius") { $natacio.=""; } if ($cat eq "Escola d'Adults") { $volei.=""; } } $display.="
"; &menu_izquierda; # &separador; &visita_virtual; # &separador; &serveis_ajuntament; $display.=""; $display.="
"; open(ESPORTS,"/home/arta/data/batlesa.arta"); while (@esports = ) { @noticies_esports=@esports; } close(ESPORTS); foreach $line(@noticies_esports) { ($id, $titol, $posicio, $data, $texte) = split(/\|/, $line); if ($id eq $form{'id'}) { $display.="
$titol


$data
$autor
$texte
"; } } $display.="
"; $display.="
"; open(ESPORTS,"/home/arta/data/batlesa.arta"); while (@esports = ) { @noticies_esports=@esports; } close(ESPORTS); foreach $line(@noticies_esports) { ($id, $titol, $posicio, $data, $texte, $cat) = split(/\|/, $line); if ($cat eq "Biblioteca Municipal") { $basquet.="
 $titol
 $titol
 $titol
 $titol
 $titol
 $titol
$basquet

"; $display.=" $ciclisme

"; $display.=" $futbol

"; $display.=" $hipica

"; $display.=" $natacio

"; $display.=" $volei

"; $display.="
"; } if ($form{'action'} eq "ver_cat") { $display.="
"; } } $display.="
"; &menu_izquierda; # &separador; &visita_virtual; # &separador; &serveis_ajuntament; $display.=""; $display.="
"; open(ESPORTS,"/home/arta/data/batlesa.arta"); while (@esports = ) { @noticies_esports=@esports; } close(ESPORTS); foreach $line(@noticies_esports) { ($id, $titol, $posicio, $data, $texte, $cat) = split(/\|/, $line); if ($cat eq $form{'cat'}) { $resultados.="
 $titol
$resultados

"; $display.=""; $display.="
"; $display.="
Llocs d'interés:
"; open(VISITAS,"/home/arta/data/llocs.txt"); while (@llocs = ) { foreach $llocs(@llocs) { $display.="\n\n"; $llocs=~s/\n//g; $llocs=~s/\|\*\|/\/g; $llocs=~s/\|\*\*\|//g; ($id,$nom,$descripcio,$imatges,$subtitol)=split(/\|/,$llocs); $display.="• $nom
"; } } close (VISITAS); $display.="
"; $display.="
Rutes interesants:
"; open(VISITAS,"/home/arta/data/rutes.txt"); while (@llocs = ) { foreach $llocs(@llocs) { $display.="\n\n"; $llocs=~s/\n//g; $llocs=~s/\|\*\|/\/g; $llocs=~s/\|\*\*\|//g; ($id,$nom,$descripcio,$imatges,$subtitol)=split(/\|/,$llocs); $display.="• $nom
"; } } close (VISITAS); $display.="
"; $display.="
"; } ################################# # PRINT THE DISPLAY $display.="\n"; print "Content-type: text/html\n\n"; if ($header ne "") { open (file,$header); @head=; close (file); foreach $line(@head){ $top.=$line; } } if ($footer ne "") { open (file,$footer); @foot=; close (file); foreach $line(@foot){ $bottom.=$line; } } if ($error ne "") { $display=$error; } print $top.$display.$bottom; #################################################################### ################################# # MENU NAVEGACIO sub menu_izquierda { $display.="
"; open(MENUS,"/home/arta/data/menu.arta"); while (@menu = ) { foreach $menu(@menu) { $display.="\n\n"; $menu=~s/\n//g; $menu=~s/\|\*\|/\/g; $menu=~s/\|\*\*\|//g; ($seccion,$enlace,$section)=split(/\|/,$menu); $display.=" "; } } close(MENUS); $display.="
 $seccion
"; } ################################# # SERVEIS AJUNTAMENT sub serveis_ajuntament { $display.="
"; open(SERVEIS,"/home/arta/data/serveis.arta"); while (@menu = ) { foreach $menu(@menu) { $display.="\n\n"; $menu=~s/\n//g; $menu=~s/\|\*\|/\/g; $menu=~s/\|\*\*\|//g; ($seccion,$enlace,$section)=split(/\|/,$menu); $display.=""; } } close(SERVEIS); $display.="
 $seccion
"; } ################################# # VISITA VIRTUAL sub visita_virtual { $display.="
"; $display.=""; open(VISITAV,"/home/arta/data/visitav.arta"); while (@menu = ) { foreach $menu(@menu) { $display.="\n\n"; $menu=~s/\n//g; $menu=~s/\|\*\|/\/g; $menu=~s/\|\*\*\|//g; ($seccion,$enlace,$section)=split(/\|/,$menu); $display.=" "; } } close(VISITAV); $display.="
 $seccion
"; }