X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_route;h=ee457f57abd41502ad3d54f58385b16638e8ced5;hb=f3fdcfd6d9e7d88fbc97f9294c302c338d2500b5;hp=b2c52b158f3b7c6531b48fbf9b0b34677ed56df8;hpb=2007f48bd68be9218b8f41acd9ba32d378a1b22c;p=ypp-sc-tools.db-live.git diff --git a/yarrg/web/query_route b/yarrg/web/query_route index b2c52b1..ee457f5 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -49,6 +49,16 @@ my @islandids; my %islandid2; my $qa= \%ARGS; + +my $be_post; +my $startform= sub { + ($be_post)= @_; + +
+<%perl> +}; +my $goupdate= sub { $be_post ? 'Update' : 'Go' }; +

Specify route

@@ -61,7 +71,7 @@ my $qa= \%ARGS; Enter route (islands, or archipelagoes, separated by |s or commas; abbreviations are OK):
- +% $startform->($routestring =~ m/\S/); <&| qtextstring, qa => $qa, dbh => $dbh, thingstring => 'routestring', emsgstore => \$emsg, @@ -76,6 +86,11 @@ Enter route (islands, or archipelagoes, separated by |s or commas; % } else { #---------- dropdowns, user selects from menus ---------- +$startform->(grep { + defined %ARGS{"archipelago$dd"} || + defined %ARGS{"islandid$dd"} + } (0..$qa->{Dropdowns}-1)); + <%perl> my ($sth,$row); my @archlistdata; @@ -165,10 +180,9 @@ function ms_Setarch(dd) { % } #---------- end of dropdowns, now common middle of page code ---------- - -% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring/; }; + +% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring|^[RT]/; }; <& "lookup:formhidden", ours => $ours &> -
<%perl> #========== results ========== @@ -206,11 +220,12 @@ for my $dd (0..$qa->{Dropdowns}-1) { % if (@islandids) { -% $someresults->(); +% $someresults->('Relevant trades'); <& routetrade, dbh => $dbh, islandids => \@islandids, archipelagoes => \@archipelagoes, qa => $qa &> + % }