From: Ian Jackson Date: Wed, 26 Aug 2009 02:09:26 +0000 (+0100) Subject: Better output when no offers for a commodity X-Git-Tag: 3.4~88 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=54af9f44ad761f5aa0b5cb4ab1eebda663d67aeb Better output when no offers for a commodity --- diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod index c87b440..b37fa39 100644 --- a/yarrg/web/query_commod +++ b/yarrg/web/query_commod @@ -127,7 +127,12 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {

Offers to <% uc $bs |h %> <% $commodname |h %>

- +% $islands->execute($cmid); +% my $island; +% my %ts_sortkeys; +% my $rowix= 0; +% while ($island= $islands->fetchrow_hashref) { +% if (!$rowix) { -% $islands->execute($cmid); -% my $island; -% my %ts_sortkeys; -% my $rowix= 0; -% while ($island= $islands->fetchrow_hashref) { +% } % my $islandid= $island->{'islandid'}; % $offers->execute($cmid, $islandid); % my ($offer, $bestprice, $marginal, @beststalls); @@ -204,6 +205,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { % } % $rowix++; % } +% if ($rowix) {
@@ -143,11 +148,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { +/-10% Any
<&| tabsort, table => "${bs}_table", sortkeys => "${bs}_sortkeys", @@ -222,6 +224,9 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { return price; } +% } else { +No offers. +% } <%perl> }