From fa564098d4393a905d3b48c3dfdb1f7232ddff02 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 13 May 2003 12:23:15 +0000 Subject: [PATCH] Nettoyage de code --- htdocs/compta/ca.php3 | 53 ++----------------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/htdocs/compta/ca.php3 b/htdocs/compta/ca.php3 index 358b1bff9db..64d137cf1f8 100644 --- a/htdocs/compta/ca.php3 +++ b/htdocs/compta/ca.php3 @@ -39,7 +39,6 @@ if ($user->societe_id > 0) print_titre("Chiffres d'affaires en euros HT"); - $sql = "SELECT sum(f.amount) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM llx_facture as f WHERE f.paye = 1"; @@ -50,10 +49,10 @@ if ($socidp) $sql .= " GROUP BY dm DESC"; $result = $db->query($sql); -if ($result) { +if ($result) +{ $num = $db->num_rows(); $i = 0; - $var=True; while ($i < $num) { $row = $db->fetch_row($i); @@ -62,8 +61,6 @@ if ($result) { } } - - print ''; print ''; @@ -74,7 +71,6 @@ for ($annee = 2001 ; $annee < 2006 ; $annee++) print ''; for ($mois = 1 ; $mois < 13 ; $mois++) { - print ''; print ""; for ($annee = 2001 ; $annee < 2006 ; $annee++) @@ -91,55 +87,10 @@ for ($mois = 1 ; $mois < 13 ; $mois++) print ''; } - - //pt($db, $sql,"Par mois"); - - - print "
".strftime("%B",mktime(1,1,1,$mois,1,2000))."
"; $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); -/* - * Fonctions - * - */ - -function pt ($db, $sql, $date) -{ - global $bc; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - $i = 0; $total = 0 ; - print "

"; - print ""; - print ""; - print ""; - print "\n"; - print "\n"; - $var=True; - while ($i < $num) { - $obj = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - - $total = $total + $obj->amount; - - $i++; - } - print ''; - - print "
$dateMontant 
$obj->dm".price($obj->amount)." 
Total :'.price($total).'euros HT
"; - $db->free(); - } -} - - ?>