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=153ea792c92e7f9abcc9eac7472d37c72bdb7fca;hp=b37fa39001e25ec966f234e4ff84735c340c18b7;hb=29010a75143814a91b4f5200454bea879280e7c1;hpb=59bee7afb77216585b904bd20f17e71005e9778c diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod index b37fa39..153ea79 100644 --- a/yarrg/web/query_commod +++ b/yarrg/web/query_commod @@ -50,6 +50,7 @@ my ($commodname,$cmid); my $qa= \%ARGS; +

Commodity enquiry

% $prselector->('BuySell'); @@ -57,34 +58,10 @@ my $qa= \%ARGS;
-%#---------- textbox, user enters route as string ---------- -% if (!$qa->{Dropdowns}) { - -Enter commodity (abbreviations are OK):
- -<&| qtextstring, qa => $qa, dbh => $dbh, - thingstring => 'commodstring', emsgstore => \$emsg, - perresult => sub { ($commodname,$cmid)= @_; } +<& enter_commod, qa => $qa, dbh => $dbh, emsg_r => \$emsg, + commodname_r => \$commodname, + cmid_r => \$cmid &> - size=80 - - -% } else { #---------- dropdowns, user selects from menus ---------- - -% my $sth= $dbh->prepare("SELECT commodname,commodid FROM commods -% ORDER BY commodname"); -% $sth->execute(); -% my $row; - - -% } #---------- end of dropdowns, now common middle of page code ---------- % my $ours= sub { $_[0] =~ m/^commodstring|^commodid/; }; @@ -93,6 +70,8 @@ Enter commodity (abbreviations are OK):
%#========== results ========== +
+
<%perl> $emsgokorprint->($emsg) or $cmid=undef; @@ -133,9 +112,14 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { % my $rowix= 0; % while ($island= $islands->fetchrow_hashref) { % if (!$rowix) { - +
++++ - @@ -194,11 +178,11 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { % for my $cix (0..$#$s) { % $ts_sortkeys{$cix}{$rowid}= $s->[$cix];
+ + Prices Quantity at price
<% $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 %>