Skip to content

Commit

Permalink
Näytetään kokonaiskesto taulukon lopussa
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommi Järvinen committed May 26, 2016
1 parent 2489e9a commit 863c41f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tuotannonsuunnittelu.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@
$valmistukset = Valmistus::all();

//Listataan parkissa olevat valmistukset
$kokonaiskesto = 0;
foreach ($valmistukset as $valmistus) {
$kesto = $valmistus->kesto() - $valmistus->kaytetty();
$kokonaiskesto += $kesto;

echo "<tr>";
echo "<td>" . $valmistus->tunnus() . "</td>";
Expand All @@ -407,7 +410,7 @@
echo "</td>";

echo "<td>{$kpl}</td>";
echo "<td>" . ($valmistus->kesto() - $valmistus->kaytetty()) . "</td>";
echo "<td>{$kesto}</td>";

echo "<td>";

Expand All @@ -434,6 +437,19 @@
echo "</tr>";
}

echo "<tfoot>";
echo "<tr>";
echo "<th colspan='7'>" . t('Yhteensä') . "</th>";
echo "</tr>";
echo "<tr>";
for ($i=0; $i < 5; $i++) {
echo "<td></td>";
}
echo "<td>{$kokonaiskesto}</td>";
echo "<td></td>";
echo "</tr>";
echo "</tfoot>";

echo "</table>";

/* Muut kalenterimerkinnät*/
Expand Down

0 comments on commit 863c41f

Please sign in to comment.