X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_route;h=18c3ecb1390af1f2d3a3fc4f2108d2a64f5c90ce;hp=66dee1dd08135de011871b15d71d963f7db235af;hb=4311ae355f0a94637c94d1d02a6edcbe65bebaa7;hpb=72587d0d7358ca77ecd0ede859abba7f89b1d9d2;ds=sidebyside diff --git a/yarrg/web/query_route b/yarrg/web/query_route index 66dee1d..18c3ecb 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -35,6 +35,8 @@ <%args> $quri +$dbh +$prselector $routestring => ''; $someresults $emsgokorprint @@ -49,17 +51,20 @@ my %islandid2; my $qa= \%ARGS; +

Specify route

+ +% $prselector->('ShowStalls'); + %#---------- textbox, user enters route as string ---------- % if (!$qa->{Dropdowns}) { -

Specify route

- Enter route (islands, or archipelagoes, separated by |s or commas; abbreviations are OK):
-<&| qtextstring, qa => $qa, thingstring => 'routestring', emsgstore => \$emsg, +<&| qtextstring, qa => $qa, dbh => $dbh, + thingstring => 'routestring', emsgstore => \$emsg, perresult => sub { my ($canonname, $island, $arch) = @_; push @islandids, $island; @@ -90,8 +95,6 @@ my $optionlistmap= sub { return $out; }; -my $dbh= dbw_connect($qa->{Ocean}); - $sth= $dbh->prepare("SELECT DISTINCT archipelago FROM islands ORDER BY archipelago;"); $sth->execute(); @@ -120,8 +123,6 @@ foreach my $arch (keys %islandlistdata) { $optionlistmap->($islandlistdata{$arch}, ''); } -$dbh->rollback(); - <&| script &> @@ -165,9 +166,8 @@ 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|^rtsel[ag]_/; }; <& "lookup:formhidden", ours => $ours &> -
<%perl> #========== results ========== @@ -206,5 +206,11 @@ for my $dd (0..$qa->{Dropdowns}-1) { % if (@islandids) { % $someresults->(); -<& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &> +<& routetrade, + dbh => $dbh, + islandids => \@islandids, + archipelagoes => \@archipelagoes, + qa => $qa + &> + % }