chiark / gitweb /
Printable plan: Put generation date near the top with the input questions
[ypp-sc-tools.db-live.git] / yarrg / web / query_commod
index 81e8208d1b34abd3fda1bb38e0181eb29949762c..3b2bf3554533f40a334d63690dac86f023b16764 100644 (file)
@@ -57,34 +57,10 @@ my $qa= \%ARGS;
 
 <form action="<% $quri->() |h %>" method="get">
 
-%#---------- textbox, user enters route as string ----------
-% if (!$qa->{Dropdowns}) {
-
-Enter commodity (abbreviations are OK):<br>
-
-<&| qtextstring, qa => $qa, dbh => $dbh,
-    thingstring => 'commodstring', emsgstore => \$emsg,
-    onresults => sub { ($commodname,$cmid)= @{ $_[0] }; }
+<& 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;
-<select name="commodid">
-<option value="">Select commodity...</option>
-%      while ($row= $sth->fetchrow_arrayref) {
-%              my $selected= $commodid eq $row->[1] ? 'selected' : '';
-<option value="<% $row->[1] %>" <% $selected %>><% $row->[0] |h %></option>
-%              ($commodname,$cmid) = @$row if $selected;
-%      }
-</select>
-
-% } #---------- end of dropdowns, now common middle of page code ----------
 
 <input type=submit name=submit value="Go">
 % my $ours= sub { $_[0] =~ m/^commodstring|^commodid/; };
@@ -133,9 +109,14 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
 %      my $rowix= 0;
 %      while ($island= $islands->fetchrow_hashref) {
 %              if (!$rowix) {
-<table id="<% $bs %>_table">
+<table id="<% $bs %>_table" rules=groups>
+<colgroup span=2>
+<colgroup span=1>
+<colgroup span=2>
+<colgroup span=3>
 <tr>
-<th colspan=3>
+<th colspan=2>
+<th colspan=1>
 <th colspan=2>Prices
 <th colspan=3>Quantity at price
 <tr id="<% $bs %>_table_thr">
@@ -194,11 +175,11 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
      <td><% $s->[0]= $island->{'archipelago'} |h %>
      <td><% $s->[1]= $island->{'islandname'} |h %>
      <td><%          $stallname |h %>
-     <td><% $s->[3]= (length $bestqty ? $bestprice : '-') %>
-     <td><% $s->[4]= $median %>
-     <td><% $s->[5]= $bestqty %>
-     <td><% $s->[6]= $approxqty %>
-     <td><% $s->[7]= $cqty %>
+     <td align=right><% $s->[3]= (length $bestqty ? $bestprice : '-') %>
+     <td align=right><% $s->[4]= $median %>
+     <td align=right><% $s->[5]= $bestqty %>
+     <td align=right><% $s->[6]= $approxqty %>
+     <td align=right><% $s->[7]= $cqty %>
 </tr>
 %              for my $cix (0..$#$s) {
 %                      $ts_sortkeys{$cix}{$rowid}= $s->[$cix];