diff --git a/htdocs/telephonie/stats/factures/index.php b/htdocs/telephonie/stats/factures/index.php index 15a31c16a86..0d11d8c1538 100644 --- a/htdocs/telephonie/stats/factures/index.php +++ b/htdocs/telephonie/stats/factures/index.php @@ -63,7 +63,7 @@ print ''; print 'ca_mensuel'; print ''; -_legend($db, "factures.ca_mensuel"); +_legend($db, "factures.ca_mensuel", "%11.2f"); print ''; @@ -72,7 +72,7 @@ print ''; print 'facture_moyenne'; print ''; -_legend($db, "factures.facture_moyenne"); +_legend($db, "factures.facture_moyenne","%01.1f"); print ''; print ''; @@ -80,7 +80,7 @@ print ''; print 'nb_facture'; print ''; -_legend($db, "factures.nb_mensuel"); +_legend($db, "factures.nb_mensuel","%01.0f"); print ''; @@ -89,9 +89,8 @@ print ''; $db->close(); -function _legend($db, $graph) +function _legend($db, $graph, $format) { - print ''; print ''; print ''; @@ -104,26 +103,18 @@ function _legend($db, $graph) if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - - while ($i < $num) + while ($row = $db->fetch_row($resql)) { - $row = $db->fetch_row($resql); $var = !$var; print ""; - print ''; - - $i++; + print ''; } } print '
Légende
'.$row[0].''.ceil($row[1]).'
'.$row[0].''; + print sprintf($format ,$row[1]); + print '
'; } - - - - llxFooter("Dernière modification $Date$ révision $Revision$"); ?>