From: Joey Schulze Date: Sat, 9 Jun 2018 12:01:36 +0000 (+0200) Subject: Propagate summary to headline X-Git-Url: https://git.infodrom.org/?p=infodrom.org%2Fservice.infodrom.org;a=commitdiff_plain;h=9e47a5c3e0f1987d7143ff978c21db05c278c5cf Propagate summary to headline --- diff --git a/class/spritlog.class.php b/class/spritlog.class.php index 275a427..65df3fd 100644 --- a/class/spritlog.class.php +++ b/class/spritlog.class.php @@ -48,12 +48,16 @@ class SpritLog extends DatabaseTable { '' . ''; } - 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('€ %.2f  %d km', $price, $km), + )); } public function ajaxAdd(Array $data) diff --git a/src/InfoCon/sprit/list.wml b/src/InfoCon/sprit/list.wml index 6a4988c..dd03ff0 100644 --- a/src/InfoCon/sprit/list.wml +++ b/src/InfoCon/sprit/list.wml @@ -71,7 +71,7 @@ table.spritlog tbody tr:hover { foreach ($list as $row) { echo '
'; printf('
%d
', $row->year, $row->year); - printf('
€ %.2f  %d km
', $row->sum, $row->km); + printf('
€ %.2f  %d km
', $row->year, $row->sum, $row->km); echo '
'; printf('', $row->year); }