X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Flookup;h=751a99aa1a6916382c3843c610eda6691a02868b;hb=013f7a0ab3bf8d2b1100022e8fc868407c751720;hp=931594a2b71ce718d615bbfecf46e09c00c9d5d2;hpb=efc8497c2414dfded724d7181e11df53b947e387;p=ypp-sc-tools.main.git
diff --git a/yarrg/web/lookup b/yarrg/web/lookup
index 931594a..751a99a 100755
--- a/yarrg/web/lookup
+++ b/yarrg/web/lookup
@@ -39,11 +39,6 @@ my %a;
my %ahtml;
my @vars;
-# for output:
-my @archipelagoes;
-my @islandids;
-my %islandid2;
-
#---------- "mode" argument parsing and mode menu at top of page ----------
# for debugging, invoke as
@@ -146,249 +141,20 @@ foreach my $var (@vars) {
#---------- initial checks, startup, main entry form ----------
+die if $a{Query} =~ m/[^a-z]/;
+
dbw_connect($a{Ocean});
%perl>
<%args>
$debug => 0
-$routestring => ''
%args>
-%########### query `route' ##########
-% if ($a{Query} eq 'route') {
-
-Specify route
-
-
-<%perl>
-#========== result computations ==========
-
-my $results_head;
-$results_head= sub {
- print "Results
\n";
- $results_head= sub { };
-};
-
-#---------- result computation - textstring ----------
-if (!$a{Dropdowns}) {
- if (length $routestring) {
- $results_head->();
- my $rsr= $m->comp('routetextstring',
- ocean => $a{Ocean},
- string => $routestring,
- format => 'return'
- );
- if (length $rsr->{Error}) {
- print encode_entities($rsr->{Error});
- } else {
- foreach my $entry (@{ $rsr->{Results} }) {
- push @archipelagoes,
- defined $entry->[1] ? undef : $entry->[0];
- push @islandids, $entry->[1];
- }
- }
- }
-
-} else { #---------- results - dropdowns ----------
-
-my $argorundef= sub {
- my ($dd,$base) = @_;
- my $thing= $ARGS{"${base}${dd}"};
- $thing= undef if defined $thing and $thing eq 'none';
- return $thing;
-};
-
-for my $dd (0..$a{Dropdowns}-1) {
- my $arch= $argorundef->($dd,'archipelago');
- my $island= $argorundef->($dd,'islandid');
- next unless defined $arch or defined $island;
- if (defined $island and defined $arch) {
- my $ii= $islandid2{$island};
- my $iarch= $ii->{Arch};
- if ($iarch ne $arch) {
- $results_head->();
-%perl>
- Specified archipelago <% $arch %> but
- island <% $ii->{Name} %>
- which is in <% $iarch %>; using the island.
-<%perl>
- }
- $arch= undef;
- }
- push @archipelagoes, $arch;
- push @islandids, $island;
-}
-
-}#---------- result processing, common stuff
-%perl>
-
-% if (@islandids) {
-% $results_head->();
-
-<& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &>
-
-% }
-
-% } elsif ($a{Query} eq 'age') {
-% ########### query `age' ##########
-
-Market data age
-<& dataage, %baseqf, %queryqf &>
-
-% } ########## end of `age' query ##########
+
%#---------- debugging and epilogue ----------