From 54af9f44ad761f5aa0b5cb4ab1eebda663d67aeb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 26 Aug 2009 03:09:26 +0100 Subject: [PATCH] Better output when no offers for a commodity --- yarrg/web/query_commod | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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> } -- 2.30.2