#!/usr/local/bin/perl require "cgi-lib.pl"; require "normaliza.pl"; &ReadParse(*form_data); $rua = uc &Normaliza($form_data{'rua'}); #$rua = $form_data{'rua'}; $fichero_grafico = ""; $select=""; if ($rua eq "") { # si no hay rua open(F,"calles/datos"); while () { chop; next if ($_ eq "" || $_ =~ "^#"); ($calle,$fichero)=split(/\|/); if ($anotada{$calle}!=1) { $anotada{$calle}=1; push(@todas,$calle); } } close(F); @todas = sort @todas; $select = "\n"; print "Content-type: text/html\n\n"; print "\n"; print < function MueveTexto() { valor=document.forms[0].rua_sel[document.forms[0].rua_sel.selectedIndex].value; document.forms[0].rua.value=valor; } FIN print "\n
"; print "
\n"; print "$select
Nome da rúa:
\n"; print "\n"; print "
\n"; print "\n"; exit; } # buscamos la calle open(F,"calles/datos"); while () { chop; next if ($_ eq "" || $_ =~ "^#"); ($calle,$fichero)=split(/\|/); $calle_previa=$calle; $calle=uc &Normaliza($calle); if ($calle =~ /\b$rua\b/ && ($calle ne "") && ($rua ne "")) { $fichero_grafico = $fichero; if ($nombre{$fichero} ne "") { # ya existe una calle ahi, solo cambia el nombre (CON/CONCEPCION) $nombre{$fichero} .= ", $calle_previa"; } else { push(@ficheros,$fichero); $nombre{$fichero}=$calle_previa; $num_ficheros++; } # last; } } close(F); $fichero = "/usr/home/moama/website/webdocs/fotos/plano/$fichero_grafico"; #$fichero = "/home/ccosta/pss/www/fotos/plano/$fichero_grafico"; if (!-f ($fichero)) { &Error("Non atopo esa rúa ($fichero) na nosa base de datos."); } if ($num_ficheros == 1) { open (F,"$fichero"); $gif = join("",); close F; print "Content-type: image/jpeg\n\n"; print $gif; exit; } else { print "Content-type: text/html\n\n"; foreach $f (@ficheros) { $seccion = $f; chop $seccion; chop $seccion; chop $seccion; chop $seccion; print "
  • $nombre{$f} (Sector $seccion)\n"; } } sub Error { local($texto)=@_; print "Content-type: text/html\n\n"; print "

    $texto

    \n"; print "http://moana.servidores.net\n"; exit; }