% } # ========== OPTIMISATION ==========
+% if (!printable($m)) {
<h2>Contents</h2>
<ul>
% if ($optimise) {
<li><a href="#plan">Voyage trading plan</a>
<ul>
<li><a href="#summary">Summary statistics</a>
+ <li>Printable:
+ <input type=submit name=printable_pdf value="PDF">
+ <input type=submit name=printable_html value="HTML">
+ <input type=submit name=printable_ps value="PostScript">
</ul>
% }
<li><a href="#dataage">Data age summary</a>
<li><a href="#trades">Relevant trades</a>
</ul>
+% }
% if ($optimise) { # ========== TRADING PLAN ==========
%
%
% } # ========== TRADING PLAN ==========
-% {
+% if (!printable($m)) {
<h2><a name="dataage">Data age summary</a></h2>
<%perl>
my $sth_i= $dbh->prepare(<<END);
<&| query_age:agestable, now => $now, fetchrow => $fetchrow &>
Islands shown in reverse order of visits.<br>
</&>
+% } else {
+% my @tl= gmtime $now or die $!;
+<p>
+Generated by YARRG at <strong><%
+ sprintf "%04d-%02d-%02d %02d:%02d:%02d UTC",
+ $tl[5]+1900, @tl[4,3,2,1,0]
+ |h %></strong>.
+%#
% }
-% my %ts_sortkeys;
-% {
+% if (!printable($m)) {
+% my %ts_sortkeys;
+% {
% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
% my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
<h2><a name="trades">Relevant trades</a></h2>
<th>Capital
<th>Profit
% }
-% }
+% }
<tr id="trades_sort">
-% foreach my $col (@cols) {
+% foreach my $col (@cols) {
<th>
-% }
+% }
-% foreach my $flowix (0..$#flows) {
+% foreach my $flowix (0..$#flows) {
% my $flow= $flows[$flowix];
% my $rowid= "id_row_$flow->{UidShort}";
<tr id="<% $rowid %>" class="datarow<% $flowix & 1 %>">
%>><% exists $spec->{String} ? $spec->{String} : $v |h %>
% $ci += $spec->{Span};
% }
-% }
+% }
<tr id="trades_total">
<th>
<th colspan=2>Total
-% foreach my $ci (3..$#cols) {
+% foreach my $ci (3..$#cols) {
% my $col= $cols[$ci];
<td align=right>
% if (defined $col->{Total}) {
<% $col->{Total} |h %>
% }
-% }
+% }
</table>
<&| tabsort, cols => \@cols, table => 'trades', rowclass => 'datarow',
<input type=submit name=update value="Update">
+% } # !printable
+
<%init>
use CommodsWeb;
use Commods;