X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Flookup;h=35b6ce7039c2fb6eea242d4560f77668e72bb26c;hb=742ec1631db983f22545c9c7d6d573865bdc85fa;hp=1b85ecc8b9d06b9dc5ba96b14b63e4cac99501c0;hpb=72587d0d7358ca77ecd0ede859abba7f89b1d9d2;p=ypp-sc-tools.db-test.git diff --git a/yarrg/web/lookup b/yarrg/web/lookup index 1b85ecc..35b6ce7 100755 --- a/yarrg/web/lookup +++ b/yarrg/web/lookup @@ -58,6 +58,26 @@ my %styles; Values => [ [ 'route', 'Trades for route' ], [ 'commod', 'Prices for commodity' ], [ 'age', 'Data age' ] ] + }, { Name => 'BuySell', + Before => '', + Values => [ [ 'buy_sell', 'Buy and sell' ], + [ 'sell_buy', 'Sell and buy' ], + [ 'buy', 'Buy offers only' ], + [ 'sell', 'Sell offers only' ], + ], + QuerySpecific => 1, + }, { Name => 'ShowBlank', + Before => '', + Values => [ [ 0, 'Omit islands with no offers' ], + [ 'show', 'Show all islands' ], + ], + QuerySpecific => 1, + }, { Name => 'ShowStalls', + Before => '', + Values => [ [ 0, 'Show total quantity at each price' ], + [ 1, 'Show individual stalls' ], + ], + QuerySpecific => 1, }); foreach my $var (@vars) { @@ -98,7 +118,25 @@ $ours % } %method> -
\n\n"; +}; + +my $prselector= sub { + my ($name)= @_; + foreach my $var (@vars) { + if ($var->{Name} eq $name) { + $prselector_core->($var); + return; + } + } + die $name; +}; + +foreach my $var (@vars) { + next if $var->{QuerySpecific}; + $prselector_core->($var); } #---------- initial checks, startup, main entry form ---------- die if $styles{Query} =~ m/[^a-z]/; -dbw_connect($styles{Ocean}); +my $mydbh; +my $dbh= ($mydbh= dbw_connect($styles{Ocean})); my $results_head_done=0; my $someresults= sub { return if $results_head_done; $results_head_done=1; - print "\n