nouvelle page pour la partie publique des adherents. ces pages ne fonctionnent pas encore (le commit me sert juste a recuperer ces pages chez moi :-)

This commit is contained in:
jlb 2003-01-31 17:59:16 +00:00
parent 328275c973
commit 520c5704dd
3 changed files with 403 additions and 0 deletions

View File

@ -0,0 +1,88 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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$
*
*/
require("./pre.inc.php");
llxHeader();
$db = new Db();
print_titre("Gestion des adherents");
print '<p><TABLE border="0" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
print "<td>Type</td>";
print "<td>Nb</td>";
print "</TR>\n";
$var=True;
$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 AND d.statut = 1 GROUP BY t.libelle";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$i = 0;
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print '<TD><a href="liste.php">'.$objp->libelle.'</a></TD>';
print '<TD align="right">'.$objp->somme.'</TD>';
print "</tr>";
$i++;
}
$db->free();
}
print "</table>";
print '<form action="liste.php" method="post" name="action" value="search">';
print '<p><TABLE border="0" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
print "<td>Rechercher un adhérent</td>";
print "</TR>\n";
print "<TR $bc[$var]>";
print '<td>';
print 'Nom/Prénom <input type="text" name="search" class="flat" size="20">';
print '&nbsp; <input class="flat" type="submit" value="Chercher">';
print '</td></tr>';
print "</table></form>";
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -0,0 +1,185 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Jean-Louis Bergamo <jlb@j1b.org>
* 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$
*
*/
require("./pre.inc.php");
require("../../adherent.class.php");
require("../../adherent_type.class.php");
$db = new Db();
/*
* Enregistrer les modifs
*/
if ($action == 'update')
{
if ($HTTP_POST_VARS["bouton"] == "Enregistrer")
{
$adh = new Adherent($db);
$adh->id = $HTTP_POST_VARS["rowid"];
$adh->prenom = $prenom;
$adh->nom = $nom;
$adh->societe = $societe;
$adh->adresse = $adresse;
$adh->amount = $amount;
$adh->cp = $cp;
$adh->ville = $HTTP_POST_VARS["ville"];
$adh->email = $HTTP_POST_VARS["email"];
$adh->login = $HTTP_POST_VARS["login"];
$adh->pass = $HTTP_POST_VARS["pass"];
$adh->naiss = $HTTP_POST_VARS["naiss"];
$adh->photo = $HTTP_POST_VARS["photo"];
$adh->date = mktime(12, 0 , 0, $remonth, $reday, $reyear);
$adh->note = $HTTP_POST_VARS["note"];
$adh->pays = $HTTP_POST_VARS["pays"];
$adh->typeid = $HTTP_POST_VARS["type"];
$adh->commentaire = $HTTP_POST_VARS["comment"];
$adh->morphy = $HTTP_POST_VARS["morphy"];
// recuperation du statut et public
$adh->statut = $HTTP_POST_VARS["statut"];
$adh->public = $HTTP_POST_VARS["public"];
if ($adh->update($user->id) )
{
Header("Location: fiche.php?rowid=$adh->id&action=edit");
}
}
else
{
Header("Location: fiche.php?rowid=$rowid&action=edit");
}
}
llxHeader();
if ($rowid)
{
$adh = new Adherent($db);
$adh->id = $rowid;
$adh->fetch($rowid);
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
$sql .= " AND f.rowid = $facid";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
if ($num) {
$obj = $db->fetch_object( 0);
$total = $obj->total;
}
}
$adht = new AdherentType($db);
print_titre("Edition de la fiche adhérent");
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
print "<tr><td>Type</td><td class=\"valeur\">$adh->type</td>";
print '<td valign="top" width="50%">Commentaires</td></tr>';
print '<tr><td>Personne</td><td class="valeur">'.$adh->morphy.'&nbsp;</td>';
print '<td rowspan="15" valign="top" width="50%">';
print nl2br($adh->commentaire).'&nbsp;</td></tr>';
print '<tr><td width="15%">Prénom</td><td class="valeur" width="35%">'.$adh->prenom.'&nbsp;</td></tr>';
print '<tr><td>Nom</td><td class="valeur">'.$adh->nom.'&nbsp;</td></tr>';
print '<tr><td>Société</td><td class="valeur">'.$adh->societe.'&nbsp;</td></tr>';
print '<tr><td>Adresse</td><td class="valeur">'.nl2br($adh->adresse).'&nbsp;</td></tr>';
print '<tr><td>CP Ville</td><td class="valeur">'.$adh->cp.' '.$adh->ville.'&nbsp;</td></tr>';
print '<tr><td>Pays</td><td class="valeur">'.$adh->pays.'&nbsp;</td></tr>';
print '<tr><td>Email</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>';
print '<tr><td>Login</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
print '<tr><td>Password</td><td class="valeur">'.$adh->pass.'&nbsp;</td></tr>';
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>';
print '<tr><td>URL Photo</td><td class="valeur">'.$adh->photo.'&nbsp;</td></tr>';
print "</table>\n";
print "<hr>";
print "<form action=\"$PHP_SELF\" method=\"post\">";
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<input type=\"hidden\" name=\"rowid\" value=\"$rowid\">";
print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">";
print "<input type=\"hidden\" name=\"public\" value=\"".$adh->public."\">";
$htmls = new Form($db);
print "<tr><td>Type</td><td>";
$htmls->select_array("type", $adht->liste_array(), $adh->typeid);
print "</td>";
print '<td valign="top" width="50%">Commentaires</td></tr>';
$morphys["phy"] = "Physique";
$morphys["mor"] = "Morale";
print "<tr><td>Personne</td><td>";
$htmls->select_array("morphy", $morphys, $adh->morphy);
print "</td>";
print '<td rowspan="15" valign="top">';
print '<textarea name="comment" wrap="soft" cols="40" rows="15">'.$adh->commentaire.'</textarea></td></tr>';
print '<tr><td width="15%">Prénom</td><td width="35%"><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td></tr>';
print '<tr><td>Nom</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td></tr>';
print '<tr><td>Societe</td><td><input type="text" name="societe" size="40" value="'.$adh->societe.'"></td></tr>';
print '<tr><td>Adresse</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$adh->adresse.'</textarea></td></tr>';
print '<tr><td>CP Ville</td><td><input type="text" name="cp" size="6" value="'.$adh->cp.'"> <input type="text" name="ville" size="20" value="'.$adh->ville.'"></td></tr>';
print '<tr><td>Pays</td><td><input type="text" name="pays" size="40" value="'.$adh->pays.'"></td></tr>';
print '<tr><td>Email</td><td><input type="text" name="email" size="40" value="'.$adh->email.'"></td></tr>';
print '<tr><td>Login</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>';
print '<tr><td>Password</td><td><input type="text" name="pass" size="40" value="'.$adh->pass.'"></td></tr>';
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="40" value="'.$adh->naiss.'"></td></tr>';
print '<tr><td>URL photo</td><td><input type="text" name="photo" size="40" value="'.$adh->photo.'"></td></tr>';
print '<tr><td colspan="2" align="center">';
print '<input type="submit" name="bouton" value="Enregistrer">&nbsp;';
print '<input type="submit" value="Annuler">';
print '</td></tr>';
print '</form>';
print '</table>';
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -0,0 +1,130 @@
<?PHP
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
*
* 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$
*
*/
require("./pre.inc.php");
llxHeader();
$db = new Db();
if ($sortorder == "") { $sortorder="DESC"; }
if ($sortfield == "") { $sortfield="d.nom"; }
if ($page == -1) { $page = 0 ; }
$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! isset($statut))
{
$statut = 1 ;
}
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin";
$sql .= " , d.email, t.libelle as type, d.morphy, d.statut, t.cotisation";
$sql .= " FROM llx_adherent as d, llx_adherent_type as t";
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$result = $db->query($sql);
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\">";
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_liste_field_titre("Date cotisation",$PHP_SELF,"t.cotisation","&page=$page&statut=$statut");
print "</td>\n";
print "<td>";
print_liste_field_titre("Email",$PHP_SELF,"d.email","&page=$page&statut=$statut");
print "</td>\n";
print "<td>";
print_liste_field_titre("Type",$PHP_SELF,"t.libelle","&page=$page&statut=$statut");
print "</td>\n";
print "<td><a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.morphy\">Personne</a></td>\n";
print "<td><a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.statut\">Statut</a></td>\n";
print "<td>Action</td>\n";
print "</TR>\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe)."</a></TD>\n";
print "<TD>";
if ($objp->cotisation == 'yes')
{
if ($objp->datefin < time())
{
print "<b><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)."</a> - Cotisation non recue</b></td>\n";
}
else
{
print "<a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)."</a></td>\n";
}
}
else
{
print "&nbsp;</td>";
}
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>';
}
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 "</tr>";
$i++;
}
print "</table>";
}
else
{
print $sql;
print $db->error();
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>