diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index 15880e5e8eb..932be65f4a5 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -27,16 +27,17 @@ $db = new Db();
print_titre("Gestion des adherents");
-print '
';
+print '';
print '';
-print "| | ";
-print "Somme | ";
+print "Type | ";
+print "Nb | ";
print "
\n";
$var=True;
-$sql = "SELECT sum(d.amount) as somme , d.fk_statut FROM llx_don as d GROUP BY d.fk_statut";
+$sql = "SELECT count(*) as somme , t.libelle FROM llx_adherent as d, llx_adherent_type as t";
+$sql .= " WHERE d.fk_adherent_type = t.rowid GROUP BY t.libelle";
$result = $db->query($sql);
@@ -48,23 +49,19 @@ if ($result)
{
$objp = $db->fetch_object( $i);
- $somme[$objp->fk_statut] = $objp->somme;
+ $var=!$var;
+ print "";
+ print '| '.$objp->libelle.' | ';
+ print ''.$objp->somme.' | ';
+
+ print "
";
+
$i++;
}
$db->free();
+
}
-
-for ($i = 0 ; $i < 4 ; $i++)
-{
- $var=!$var;
- print "";
- print '| '.$libelle[$i].' | ';
- print ''.price($somme[$i]).' | ';
- $total += $somme[$i];
- print "
";
-}
-print '| Total | '.price($total).' |
';
print "
";