From e16c26c8760fe0c8c0a7250cc547dafb994f301c Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 16 Nov 2015 20:47:46 +0300 Subject: [PATCH] align right columns with counted total --- functions/functions.xhtml.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/functions/functions.xhtml.php b/functions/functions.xhtml.php index 09cfd404..ac0a5f9a 100644 --- a/functions/functions.xhtml.php +++ b/functions/functions.xhtml.php @@ -135,14 +135,15 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight foreach ($fields as $e) { print ""; - if (isset($row[$e])) print $row[$e]; - print ""; - if ($total && in_array($e,$total)) - { - if (!isset($tot[$e])) - $tot[$e] = 0; - $tot[$e] += $row[$e]; + if (isset($row[$e])) { + if ($total && in_array($e,$total)) { + if (!isset($tot[$e])) $tot[$e] = 0; + $tot[$e] += $row[$e]; + print "" . $row[$e] . ""; + } + else print $row[$e]; } + print ""; } print ""; } @@ -151,7 +152,7 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight print ""; foreach ($fields as $e) { - print ""; + print ""; if (in_array($e,$total)) print $tot[$e]; print "";