* Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ /*! \file htdocs/compta/dons/index.php \ingroup don \brief Page accueil espace don \version $Revision$ */ require("./pre.inc.php"); $langs->load("donations"); llxHeader(); $sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut FROM ".MAIN_DB_PREFIX."don as d GROUP BY d.fk_statut order by d.fk_statut"; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); $somme[$objp->fk_statut] = $objp->somme; $nb[$objp->fk_statut] = $objp->nb; $i++; } $db->free(); } else { dolibarr_print_error($db); } print_titre($langs->trans("Donations")); print ''; print ''; print ''; print ''; print ''; print "\n"; $var=True; for ($i = 0 ; $i < 3 ; $i++) { $var=!$var; print ""; print ''; print ''; print ''; $totalnb += $nb[$i]; $total += $somme[$i]; print ""; } $var=!$var; print ""; print ''; print ''; print ''; print ''; print "
'.$langs->trans("Status").''.$langs->trans("Number").''.$langs->trans("Amount").'
'.$libelle[$i].''.$nb[$i].''.price($somme[$i]).'
'.$langs->trans("Total").''.$totalnb.''.price($total).'
"; $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>