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%2Fquery_commod;h=c9b17ae6700b72a0e5ba135a14d95ff381ae3a98;hp=4869e5c50fad00d6222fa0a1ce8e2df110f488a9;hb=00ba9271fd8409f29fcae6ee2af15824810bc939;hpb=890faab73220a817300d53a362464d6a7fc06788 diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod index 4869e5c..c9b17ae 100644 --- a/yarrg/web/query_commod +++ b/yarrg/web/query_commod @@ -52,6 +52,7 @@ my $qa= \%ARGS;

Commodity enquiry

% $prselector->('BuySell'); +% $prselector->('ShowBlank'); %#---------- textbox, user enters route as string ---------- % if (!$qa->{Dropdowns}) { @@ -94,11 +95,12 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { my ($ascdesc) = ($bs eq 'buy') ? ('DESC') : ('ASC'); -#INNER JOIN + my $joinkind= $ARGS{ShowBlank} eq 'show' + ? 'LEFT OUTER JOIN' : 'INNER JOIN'; my $islands= $dbh->prepare( "SELECT islands.islandid AS islandid, archipelago, islandname, sum(qty) as tqty - FROM islands LEFT OUTER JOIN $bs offers + FROM islands $joinkind $bs offers ON islands.islandid == offers.islandid AND commodid == ? GROUP BY islands.islandid, ORDER BY archipelago, islandname"