From: Ian Jackson Date: Sun, 23 Aug 2009 10:47:04 +0000 (+0100) Subject: Dump optimisation results too X-Git-Tag: 3.4~140 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=b54e4d479114f7641bddf8a47d075639323620d2 Dump optimisation results too --- diff --git a/yarrg/web/dumptable b/yarrg/web/dumptable index 20dc25f..e60415c 100644 --- a/yarrg/web/dumptable +++ b/yarrg/web/dumptable @@ -96,6 +96,19 @@ $qa => undef % } +<%method literal> +<%args> +$cols +$rows +$qa => undef + +<& SELF:start, cols => $cols &> +% foreach my $row (@$rows) { +<& SELF:row, cols => $cols, row => $row &> +% } +<& SELF:end &> + + <& SELF:start, sth => $sth &> % my $row; % while ($row= $sth->fetchrow_hashref) { diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index fa29e6a..9c2a5a4 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -255,7 +255,8 @@ print join ' ', map { $_->{Optimal} } @flows; push @columns, qw(Opt_qty Opt_profit); -<% join ' ', @columns %> + +<& dumptable:literal, cols => \@columns, rows => \@flows &> % } # ========== OPTIMISATION ==========