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%2Flookup;h=365ed58129407277626411e60f96b8bc8fe2ba1e;hp=64860fd5f9db94e83105e83b50ad43e433b286db;hb=3dbb2f33eae3a509123ffc99e48e35f858a8292a;hpb=9d01242d0991d15f7ea84454264c868e1c4ed8ad diff --git a/yarrg/web/lookup b/yarrg/web/lookup index 64860fd..365ed58 100755 --- a/yarrg/web/lookup +++ b/yarrg/web/lookup @@ -57,7 +57,35 @@ my %styles; Before => 'Query: ', Values => [ [ 'route', 'Trades for route' ], [ 'commod', 'Prices for commodity' ], + [ 'offers', 'Offers at location' ], + [ 'routesearch', 'Find profitable route' ], [ '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, + }, { Name => 'RouteSearchType', + Before => 'Type of routes to search for: ', + Values => [ [ 0, 'Open-ended' ], + [ 1, 'Circular' ], + ], + QuerySpecific => 1, }); foreach my $var (@vars) { @@ -98,13 +126,39 @@ $ours % } -<% ucfirst $ahtml{Query} %> - YARRG +<% ucfirst $ahtml{Query} %> - YARRG + +<&| script &> + function register_onload(f) { + var previous_onload= window.onload; + window.onload= function() { + if (previous_onload) previous_onload(); + f(); + }; + } + + +% if (!printable($m)) { +
+% } -<& "query_$styles{Query}", %baseqf, %queryqf, %styles, quri => $quri &> - -

+<& "query_$styles{Query}", %baseqf, %queryqf, %styles, + quri => $quri, dbh => $dbh, + baseqf => \%baseqf, queryqf => \%queryqf, allargs => \%ARGS, + prselector => $prselector, + someresults => $someresults, + emsgokorprint => sub { + my ($emsg) = @_; + return 1 unless defined $emsg and length $emsg; + $someresults->(); + print $emsg; + return 0; + } + &> %#---------- debugging and epilogue ---------- % if ($debug) { -

+

 Debug log:
 
+
% } <&| script &> @@ -199,3 +302,8 @@ use HTML::Entities; use URI::Escape; +<%cleanup> + +$mydbh->rollback() if $mydbh; + +