X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_route;h=296c0126f8989fb1a22c897605e197944a1771d0;hp=ee457f57abd41502ad3d54f58385b16638e8ced5;hb=742ec1631db983f22545c9c7d6d573865bdc85fa;hpb=f3fdcfd6d9e7d88fbc97f9294c302c338d2500b5 diff --git a/yarrg/web/query_route b/yarrg/web/query_route index ee457f5..296c012 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -38,6 +38,8 @@ $quri $dbh $prselector $routestring => ''; +$capacitystring => ''; +$lossperleague => ''; $someresults $emsgokorprint @@ -47,6 +49,8 @@ my $emsg; my @archipelagoes; my @islandids; my %islandid2; +my ($max_volume, $max_mass); +my $lossperleaguepct; my $qa= \%ARGS; @@ -84,12 +88,44 @@ Enter route (islands, or archipelagoes, separated by |s or commas; size=80 +Advanced options - you may leave these blank: +

+ + +
+ +Vessel capacity: +<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'cs', + thingstring => 'capacitystring', emsgstore => \$emsg, + perresult => sub { + ($max_volume,$max_mass) = @_; + } + &> + size=30 + + + +  +  + + +Estimated loss per league: + +<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'll', + thingstring => 'lossperleague', emsgstore => \$emsg, + perresult => sub { ($lossperleaguepct)= @_; } + &> + size=10 + + +
+ % } else { #---------- dropdowns, user selects from menus ---------- -$startform->(grep { - defined %ARGS{"archipelago$dd"} || - defined %ARGS{"islandid$dd"} - } (0..$qa->{Dropdowns}-1)); +% $startform->(grep { +% defined $ARGS{"archipelago$_"} || +% defined $ARGS{"islandid$_"} +% } (0..$qa->{Dropdowns}-1)); <%perl> my ($sth,$row); @@ -181,7 +217,9 @@ function ms_Setarch(dd) { % } #---------- end of dropdowns, now common middle of page code ---------- -% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring|^[RT]/; }; +% my $ours= sub { $_[0] =~ +% m/^island|^archipelago|^routestring|^capacitystring|^lossperleague|^[RT]/; +% }; <& "lookup:formhidden", ours => $ours &> <%perl> @@ -225,7 +263,10 @@ for my $dd (0..$qa->{Dropdowns}-1) { dbh => $dbh, islandids => \@islandids, archipelagoes => \@archipelagoes, - qa => $qa + qa => $qa, + max_mass => $max_mass, + max_volume => $max_volume, + lossperleaguepct => $lossperleaguepct &> % }