Amliorations diverses sur la gestion des adhrents (corrections bug, mise aux normes du look, ajout d'infos sur cran)
This commit is contained in:
parent
6ca843dacb
commit
faef74265d
@ -1,6 +1,7 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 '<br>';
|
||||
|
||||
print '<p><TABLE border="0" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print '<table class="noborder" cellspacing="0" cellpadding="3">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>Type</td>";
|
||||
print "<td>Nb</td>";
|
||||
print "<td>Cotisant</td>";
|
||||
print "</TR>\n";
|
||||
print "<td align=right width=\"80\">A valider</td>";
|
||||
print "<td align=right width=\"80\">Valides</td>";
|
||||
print "<td align=right width=\"80\">Cotisants à jour</td>";
|
||||
print "<td align=right width=\"80\">Résiliés</td>";
|
||||
print "</tr>\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 "<TR $bc[$var]>";
|
||||
print '<TD><a href="liste.php">'.$key.'</a></TD>';
|
||||
print '<TD align="right">'.$value.'</TD>';
|
||||
print '<TD align="right">'.$Cotisants[$key].'</TD>';
|
||||
print "</TR>\n";
|
||||
$SommeA+=$value;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="liste.php">'.$key.'</a></TD>';
|
||||
print '<td align="right">'.$AdherentsAValider[$key].'</TD>';
|
||||
print '<td align="right">'.$Adherents[$key].'</TD>';
|
||||
print '<td align="right">'.$Cotisants[$key].'</TD>';
|
||||
print '<td align="right">'.$AdherentsResilies[$key].'</TD>';
|
||||
print "</tr>\n";
|
||||
$SommeA+=$AdherentsAValider[$key];
|
||||
$SommeB+=$Adherents[$key];
|
||||
$SommeC+=$Cotisants[$key];
|
||||
$SommeD+=$AdherentsResilies[$key];
|
||||
}
|
||||
$var=!$var;
|
||||
print "<TR $bc[$var]>";
|
||||
print '<TD> <B>Total</B> </TD>';
|
||||
print '<TD align="right"><B>'.$SommeA.'</B></TD>';
|
||||
print '<TD align="right"><B>'.$SommeC.'</B></TD>';
|
||||
print "<TR>\n";
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td> <b>Total</b> </td>';
|
||||
print '<td align="right"><b>'.$SommeA.'</b></td>';
|
||||
print '<td align="right"><b>'.$SommeB.'</b></td>';
|
||||
print '<td align="right"><b>'.$SommeC.'</b></td>';
|
||||
print '<td align="right"><b>'.$SommeD.'</b></td>';
|
||||
print "<tr>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<form action="liste.php" method="post" name="action" value="search">';
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
print '<p><TABLE border="0" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print '<table class="noborder" cellspacing="0" cellpadding="3">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>Rechercher un adhérent</td>";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
|
||||
print 'Nom/Prénom <input type="text" name="search" class="flat" size="20">';
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
$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 '<TR class="liste_titre">';
|
||||
print_barre_liste($titre, $page, $PHP_SELF, "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
// print "<td><a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.prenom\">Prenom</a> <a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.nom\">Nom</a> / <a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.societe\">Société</a></td>\n";
|
||||
print '<TD>';
|
||||
print '<td>';
|
||||
// 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 "</TD>\n";
|
||||
print_liste_field_titre("Prenom Nom / Société",$PHP_SELF,"d.nom","&page=$page&statut=$statut");
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>";
|
||||
print_liste_field_titre("Date cotisation",$PHP_SELF,"t.cotisation","&page=$page&statut=$statut");
|
||||
@ -101,7 +99,7 @@ if ($result)
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>Action</td>\n";
|
||||
print "</TR>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@ -131,27 +129,37 @@ if ($result)
|
||||
print " </td>";
|
||||
}
|
||||
|
||||
print "<TD>$objp->email</TD>\n";
|
||||
print "<TD>$objp->type</TD>\n";
|
||||
print "<TD>$objp->morphy</TD>\n";
|
||||
print "<td>$objp->email</td>\n";
|
||||
print "<td>$objp->type</td>\n";
|
||||
print "<td>$objp->morphy</td>\n";
|
||||
print "<td>";
|
||||
|
||||
if ($objp->statut == -1)
|
||||
{
|
||||
print '<a href="fiche.php?rowid='.$objp->rowid.'">A valider</a>';
|
||||
}
|
||||
if ($objp->statut == 0)
|
||||
{
|
||||
print 'Résilié';
|
||||
}
|
||||
if ($objp->statut == 1)
|
||||
{
|
||||
print 'Validé';
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
print "<TD><a href=\"edit.php?rowid=$objp->rowid\">Editer</a><br><a href=\"fiche.php?rowid=$objp->rowid&action=resign\">Resilier</a><br><a href=\"fiche.php?rowid=$objp->rowid&action=delete\">Supprimer</a></TD>\n";
|
||||
print "<td><a href=\"edit.php?rowid=$objp->rowid\">".img_edit()."</a> <a href=\"fiche.php?rowid=$objp->rowid&action=resign\">Resilier</a> <a href=\"fiche.php?rowid=$objp->rowid&action=delete\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
print "</table><BR>\n";
|
||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print "</table><br>\n";
|
||||
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
|
||||
print '<TR>';
|
||||
print '<TD align="right">';
|
||||
print '<tr>';
|
||||
print '<td align="right">';
|
||||
print_fleche_navigation($page,$PHP_SELF,"&statut=$statut&sortorder=$sortorder&sortfield=$sortfield",1);
|
||||
print '</TD>';
|
||||
print "</table><BR>\n";
|
||||
print '</td>';
|
||||
print "</table><br>\n";
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user