From faef74265d8b0cc954a2fcec94d15440b1198a38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Jul 2004 19:46:34 +0000 Subject: [PATCH] =?UTF-8?q?Am=E9liorations=20diverses=20sur=20la=20gestion?= =?UTF-8?q?=20des=20adh=E9rents=20(corrections=20bug,=20mise=20aux=20norme?= =?UTF-8?q?s=20du=20look,=20ajout=20d'infos=20sur=20=E9cran)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/index.php | 77 +++++++++++++++++++++++------------- htdocs/adherents/liste.php | 68 +++++++++++++++++-------------- htdocs/adherents/pre.inc.php | 5 ++- 3 files changed, 90 insertions(+), 60 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index f25e774ad8d..c2466fa606a 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2003 Jean-Louis Bergamo + * 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 @@ -24,26 +25,32 @@ require("./pre.inc.php"); llxHeader(); -//$db = new Db(); -print_titre("Gestion des adherents"); +print_titre("Gestion des adhérents"); +print '
'; -print '

'; -print ''; +print '
'; +print ''; print ""; -print ""; -print ""; -print "\n"; +print ""; +print ""; +print ""; +print ""; +print "\n"; $var=True; -$sql = "SELECT count(*) as somme , t.libelle FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; -$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 GROUP BY t.libelle"; - +$AdherentsAll=array(); $Adherents=array(); +$AdherentsAValider=array(); +$AdherentsResilies=array(); $Cotisants=array(); +# Liste les adherents +$sql = "SELECT count(*) as somme , t.libelle, d.statut FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; +$sql .= " WHERE d.fk_adherent_type = t.rowid GROUP BY t.libelle, d.statut"; + $result = $db->query($sql); if ($result) @@ -53,13 +60,17 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object( $i); - $Adherents[$objp->libelle]=$objp->somme; + $AdherentsAll[$objp->libelle]+=$objp->somme; + if ($objp->statut == -1) { $AdherentsAValider[$objp->libelle]=$objp->somme; } + if ($objp->statut == 1) { $Adherents[$objp->libelle]=$objp->somme; } + if ($objp->statut == 0) { $AdherentsResilies[$objp->libelle]=$objp->somme; } $i++; } $db->free(); } +# Liste les cotisants a jour $sql = "SELECT count(*) as somme , t.libelle FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND d.datefin >= now() GROUP BY t.libelle"; @@ -79,35 +90,45 @@ if ($result) } $SommeA=0; +$SommeB=0; $SommeC=0; +$SommeD=0; -foreach ($Adherents as $key=>$value){ +foreach ($AdherentsAll as $key=>$value){ $var=!$var; - print ""; - print ''; - print ''; - print ''; - print "\n"; - $SommeA+=$value; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $SommeA+=$AdherentsAValider[$key]; + $SommeB+=$Adherents[$key]; $SommeC+=$Cotisants[$key]; + $SommeD+=$AdherentsResilies[$key]; } $var=!$var; -print ""; -print ''; -print ''; -print ''; -print "\n"; +print ""; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; print "
TypeNbCotisant
A validerValidesCotisants à jourRésiliés
'.$key.''.$value.''.$Cotisants[$key].'
'.$key.''.$AdherentsAValider[$key].''.$Adherents[$key].''.$Cotisants[$key].''.$AdherentsResilies[$key].'
Total '.$SommeA.''.$SommeC.'
Total '.$SommeA.''.$SommeB.''.$SommeC.''.$SommeD.'
"; +print '
'; + print '

'; print ''; -print '

'; -print ''; +print '
'; +print ''; print ""; -print "\n"; +print "\n"; -print ""; +print ""; print ''; + print "
Rechercher un adhérent
'; print 'Nom/Prénom '; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index b71491c9fa4..3458ec875ba 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -1,6 +1,7 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * 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 @@ -22,29 +23,24 @@ */ require("./pre.inc.php"); + llxHeader(); -//$db = new Db(); +$sortorder=$_GET["sortorder"]; +$sortfield=$_GET["sortfield"]; +$page=$_GET["page"]; if ($sortorder == "") { $sortorder="ASC"; } if ($sortfield == "") { $sortfield="d.nom"; } if ($page == -1) { $page = 0 ; } -/* - * SIZE_LISTE_LIMIT : constante de taille maximale des listes - */ -if (defined("SIZE_LISTE_LIMIT")) -{ - $conf->liste_limit=SIZE_LISTE_LIMIT; -} - $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -if (! isset($statut)) +if (! isset($_GET["statut"])) { $statut = 1 ; } @@ -67,18 +63,20 @@ if ($result) $num = $db->num_rows(); $i = 0; - print_barre_liste("Liste des adhérents", $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); - print ""; + $titre="Liste des adhérents"; + if (isset($_GET["statut"]) && $_GET["statut"] == -1) { $titre="Liste des adhérents à valider"; } + if (isset($_GET["statut"]) && $_GET["statut"] == 1) { $titre="Liste des adhérents valides"; } + if (isset($_GET["statut"]) && $_GET["statut"] == 0) { $titre="Liste des adhérents résiliés"; } - print ''; + print_barre_liste($titre, $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); + print "
"; + print ''; - // print "\n"; - print '\n"; + print_liste_field_titre("Prenom Nom / Société",$PHP_SELF,"d.nom","&page=$page&statut=$statut"); + print "\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; $var=True; while ($i < $num) @@ -131,27 +129,37 @@ if ($result) print " "; } - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print ""; - print "\n"; + print "\n"; print ""; $i++; } - print "
Prenom Nom / Société'; + print ''; // print_liste_field_titre("Prenom",$PHP_SELF,"d.prenom","&page=$page&statut=$statut"); - print_liste_field_titre("Prenom Nom",$PHP_SELF,"d.nom","&page=$page&statut=$statut"); - print " / Société"; - print ""; print_liste_field_titre("Date cotisation",$PHP_SELF,"t.cotisation","&page=$page&statut=$statut"); @@ -101,7 +99,7 @@ if ($result) print "Action
$objp->email$objp->type$objp->morphy$objp->email$objp->type$objp->morphy"; + if ($objp->statut == -1) { print 'A valider'; } + if ($objp->statut == 0) + { + print 'Résilié'; + } + if ($objp->statut == 1) + { + print 'Validé'; + } + print "rowid\">Editer
rowid&action=resign\">Resilier
rowid&action=delete\">Supprimer
rowid\">".img_edit()."   rowid&action=resign\">Resilier   rowid&action=delete\">".img_delete()."

\n"; - print ""; + print "

\n"; + print ""; - print ''; - print ''; + print ''; - print "
'; + print '
'; print_fleche_navigation($page,$PHP_SELF,"&statut=$statut&sortorder=$sortorder&sortfield=$sortfield",1); - print '

\n"; + print '

\n"; } else diff --git a/htdocs/adherents/pre.inc.php b/htdocs/adherents/pre.inc.php index 6dd263d37a1..2deb7e81df0 100644 --- a/htdocs/adherents/pre.inc.php +++ b/htdocs/adherents/pre.inc.php @@ -1,5 +1,6 @@ + * 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 @@ -34,10 +35,10 @@ function llxHeader($head = "") { $menu = new Menu(); $menu->add("index.php","Adherents"); - $menu->add_submenu("liste.php?statut=1","Adhérents à ce jour"); $menu->add_submenu("liste.php?statut=-1","Adhésions à valider"); - + $menu->add_submenu("liste.php?statut=1","Adhérents à ce jour"); $menu->add_submenu("liste.php?statut=0","Adhésions résiliées"); + if ($user->admin) { $menu->add("fiche.php?action=create","Nouvel adhérent");