X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_commod;h=8d55f2686130568ba92d2c578dd787d2362e368e;hp=c87b4400fdf9c8b690a274f9f5ce3242e53f9c32;hb=e3df395a160426e3a6ec1505e949263acef07ceb;hpb=017f4432a9bb472f61ab94c10b775e64d86ca391
diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod
index c87b440..8d55f26 100644
--- a/yarrg/web/query_commod
+++ b/yarrg/web/query_commod
@@ -50,6 +50,7 @@ my ($commodname,$cmid);
my $qa= \%ARGS;
%perl>
+
Commodity enquiry
% $prselector->('BuySell');
@@ -57,34 +58,10 @@ my $qa= \%ARGS;
%#========== results ==========
+
+
<%perl>
$emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid;
+print("
"), return
+ unless defined $cmid;
$someresults->();
#---------- actually compute the results and print them ----------
@@ -127,10 +107,20 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
%perl>
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) {
+
+
+
+
+
-
+ |
+ |
| Prices
| Quantity at price
|
@@ -143,11 +133,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
+/-10%
| Any
|
-% $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);
@@ -193,17 +179,18 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
<% $s->[0]= $island->{'archipelago'} |h %>
| <% $s->[1]= $island->{'islandname'} |h %>
| <% $stallname |h %>
- | <% $s->[3]= (length $bestqty ? $bestprice : '-') %>
- | <% $s->[4]= $median %>
- | <% $s->[5]= $bestqty %>
- | <% $s->[6]= $approxqty %>
- | <% $s->[7]= $cqty %>
+ | <% $s->[3]= (length $bestqty ? $bestprice : '-') %>
+ | <% $s->[4]= $median %>
+ | <% $s->[5]= $bestqty %>
+ | <% $s->[6]= $approxqty %>
+ | <% $s->[7]= $cqty %>
% for my $cix (0..$#$s) {
% $ts_sortkeys{$cix}{$rowid}= $s->[$cix];
% }
% $rowix++;
% }
+% if ($rowix) {
|
<&| tabsort, table => "${bs}_table", sortkeys => "${bs}_sortkeys",
@@ -222,7 +209,11 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
return price;
}
&tabsort>
+% } else {
+No offers.
+% }
<%perl>
}
%perl>
+