From acfb20cadbd2c41326cb4871d6f8a5b73a5b72a5 Mon Sep 17 00:00:00 2001 From: jlb Date: Fri, 28 Feb 2003 17:18:04 +0000 Subject: [PATCH] rajout du total des cotisations et du total par annee --- htdocs/adherents/cotisations.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 271bc9abb4e..dbbb444a1f7 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -58,6 +58,9 @@ $pagenext = $page + 1; $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh"; $sql .= " FROM llx_adherent as d, llx_cotisation as c"; $sql .= " WHERE d.rowid = c.fk_adherent"; +if(isset($date_select) && $date_select != ''){ + $sql .= " AND dateadh LIKE '$date_select%'"; +} $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $result = $db->query($sql); @@ -76,6 +79,7 @@ if ($result) print "\n"; $var=True; + $total=0; while ($i < $num) { $objp = $db->fetch_object( $i); @@ -83,10 +87,31 @@ if ($result) print ""; print "rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."\n"; print ''.price($objp->cotisation).''; + $Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation); + $total+=price($objp->cotisation); print "rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."\n"; print ""; $i++; } + $var=!$var; + print ""; + print "Total\n"; + print "".price($total)."\n"; + print " \n"; + print "\n"; + print ""; + print "
\n"; + + print "\n"; + print ''; + print ""; + print ""; + // print ""; + print "\n"; + foreach ($Total as $key=>$value){ + $var=!$var; + print "\n"; + } print "
AnneeMontantPrenom Nom / Société
$key".price($value)."
"; } else