chiark / gitweb /
Tickbox for each line
[ypp-sc-tools.web-live.git] / yarrg / web / routetrade
index 597f9eea3f7fc937a921e6056348064e1a041d66..dcf3671620f32b8680c7375b6d714e911442ed0d 100644 (file)
@@ -191,6 +191,11 @@ push @columns,                  qw(commodname
        }
        $f->{Uid}= join '_', @uid;
 
        }
        $f->{Uid}= join '_', @uid;
 
+       if ($qa->{"rtsela_$f->{Uid}"} &&
+           !$qa->{"rtselg_$f->{Uid}"}) {
+               $f->{Suppress}= 1;
+       }
+
        push @flows, $f;
 
 </%perl>
        push @flows, $f;
 
 </%perl>
@@ -230,6 +235,12 @@ Subject To
 
 my %avail_csts;
 foreach my $flow (@flows) {
 
 my %avail_csts;
 foreach my $flow (@flows) {
+       if ($flow->{Suppress}) {
+               $cplex .= "
+   $flow->{Var} = 0
+";
+               next;
+       }
        foreach my $od (qw(org dst)) {
                my $cstname= join '_', (
                        'avail',
        foreach my $od (qw(org dst)) {
                my $cstname= join '_', (
                        'avail',
@@ -313,6 +324,7 @@ push @columns, qw(OptQty OptCapital OptProfit);
 %      my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
 <table>
 <tr>
 %      my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
 <table>
 <tr>
+<th>
 <th<% $cdspan %>>Collect
 <th<% $cdspan %>>Deliver
 <th>
 <th<% $cdspan %>>Collect
 <th<% $cdspan %>>Deliver
 <th>
@@ -325,6 +337,7 @@ push @columns, qw(OptQty OptCapital OptProfit);
 %      }
 
 <tr>
 %      }
 
 <tr>
+<th>
 <th>Island <% $cdstall %>
 <th>Island <% $cdstall %>
 <th>Commodity
 <th>Island <% $cdstall %>
 <th>Island <% $cdstall %>
 <th>Commodity
@@ -346,12 +359,17 @@ push @columns, qw(OptQty OptCapital OptProfit);
 
 % foreach my $flow (@flows) {
 <tr>
 
 % foreach my $flow (@flows) {
 <tr>
+<td><input type=hidden   name=rtsela_<% $flow->{Uid} %> value=1>
+    <input type=checkbox name=rtselg_<% $flow->{Uid} %> value=1
+       <% $flow->{Suppress} ? '' : 'checked' %> >
 %      foreach my $col (@columns) {
 <td><% $flow->{$col} |h %>
 %      }
 % }
 </table>
 
 %      foreach my $col (@columns) {
 <td><% $flow->{$col} |h %>
 %      }
 % }
 </table>
 
+<input type=submit name=update value="Update">
+
 <%init>
 use CommodsWeb;
 use Commods;
 <%init>
 use CommodsWeb;
 use Commods;