Propagate summary to headline
[infodrom.org/service.infodrom.org] / class / spritlog.class.php
index 275a427..65df3fd 100644 (file)
@@ -48,12 +48,16 @@ class SpritLog extends DatabaseTable {
        '</tr></tfoot>' .
        '</table>';
     }
-    return $out;
+    return array($out, $total_liter, $total_price, $total_km);
   }
 
   public function ajaxList(Array $data)
   {
-    return array('html' => array('list_'.$data['year'] => $this->formatYear($data['year'])));
+    list($table, $liter, $price, $km) = $this->formatYear($data['year']);
+
+    return array('html' => array('list_'.$data['year'] => $table,
+                                'sum_'.$data['year'] => sprintf('&euro; %.2f&nbsp;&nbsp;%d km', $price, $km),
+                                ));
   }
 
   public function ajaxAdd(Array $data)