-
-
-<%perl>
-#========== result computations ==========
-my $results_head;
-$results_head= sub {
- print "
Results
\n";
- $results_head= sub { };
-};
+#---------- initial checks, startup, main entry form ----------
-#---------- 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];
- }
- }
- }
+die if $styles{Query} =~ m/[^a-z]/;
-} else { #---------- results - dropdowns ----------
+my $mydbh;
+my $dbh= ($mydbh= dbw_connect($styles{Ocean}));
-my $argorundef= sub {
- my ($dd,$base) = @_;
- my $thing= $ARGS{"${base}${dd}"};
- $thing= undef if defined $thing and $thing eq 'none';
- return $thing;
+my $results_head_done=0;
+my $someresults= sub {
+ return if $results_head_done;
+ $results_head_done=1;
+ my ($h)= @_;
+ $h= 'Results' if !$h;
+ print "\n
$h
\n";
};
-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>
+<%args>
+$debug => 0
+%args>
-% if (@islandids) {
-% $results_head->();
-
-<& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &>
-
+% if (!printable($m)) {
+