% WHERE islandid = ?');
% my %da_ages;
% my $total_total= 0;
+% my $total_dist= 0;
%
<h1>Voyage trading plan</h1>
<table rules=groups>
<tr><td colspan=3>
% $iquery->execute($islandids[$i]);
% my ($islandname) = $iquery->fetchrow_array();
+% my $this_dist= $distance->($islandids[$i-1],$islandids[$i]);
+% $total_dist += $this_dist;
% if (!$i) {
<strong>Start at <% $islandname |h %></strong>
% } else {
<strong>Sail to <% $islandname |h %></strong>
-- <% $distance->($islandids[$i-1],$islandids[$i]) |h %>leagues </td>
+- <% $this_dist |h %> leagues </td>
% }
<%perl>
my $age_reported= 0;
}
</%perl>
<tbody><tr>
-<td colspan=2>
+<td colspan=2>Total distance: <% $total_dist %> leagues.
<td colspan=3 align=right>Overall net cash flow
<td align=right><strong><%
$total_total < 0 ? -$total_total." loss" : $total_total." gain"