From 520c5704dd5266bcfc709e5f934d438701b748ae Mon Sep 17 00:00:00 2001 From: jlb Date: Fri, 31 Jan 2003 17:59:16 +0000 Subject: [PATCH] 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 :-) --- htdocs/public/adherents/index.php | 88 ++++++++++++ htdocs/public/adherents/priv_edit.php | 185 +++++++++++++++++++++++++ htdocs/public/adherents/priv_liste.php | 130 +++++++++++++++++ 3 files changed, 403 insertions(+) create mode 100644 htdocs/public/adherents/index.php create mode 100644 htdocs/public/adherents/priv_edit.php create mode 100644 htdocs/public/adherents/priv_liste.php diff --git a/htdocs/public/adherents/index.php b/htdocs/public/adherents/index.php new file mode 100644 index 00000000000..728ba8d3c5b --- /dev/null +++ b/htdocs/public/adherents/index.php @@ -0,0 +1,88 @@ + + * + * 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 '

'; +print ''; +print ""; +print ""; +print "\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 ""; + print ''; + print ''; + + print ""; + + $i++; + } + $db->free(); + +} + +print "
TypeNb
'.$objp->libelle.''.$objp->somme.'
"; + +print '

'; +print '

'; +print ''; +print ""; +print "\n"; + +print ""; +print ''; +print "
Rechercher un adhérent
'; + +print 'Nom/Prénom '; + +print '  '; +print '

"; + + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/public/adherents/priv_edit.php b/htdocs/public/adherents/priv_edit.php new file mode 100644 index 00000000000..211e1230582 --- /dev/null +++ b/htdocs/public/adherents/priv_edit.php @@ -0,0 +1,185 @@ + + * Jean-Louis Bergamo + * 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 ''; + + print ""; + print ''; + + print ''; + print ''; + + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print "
Type$adh->typeCommentaires
Personne'.$adh->morphy.' '; + print nl2br($adh->commentaire).' 
Prénom'.$adh->prenom.' 
Nom'.$adh->nom.' 
Société'.$adh->societe.' 
Adresse'.nl2br($adh->adresse).' 
CP Ville'.$adh->cp.' '.$adh->ville.' 
Pays'.$adh->pays.' 
Email'.$adh->email.' 
Login'.$adh->login.' 
Password'.$adh->pass.' 
Date de naissance
Format AAAA-MM-JJ
'.$adh->naiss.' 
URL Photo'.$adh->photo.' 
\n"; + + print "
"; + + print "
"; + print ''; + + print ""; + print ""; + print "statut."\">"; + print "public."\">"; + + $htmls = new Form($db); + + + print ""; + + print ''; + + $morphys["phy"] = "Physique"; + $morphys["mor"] = "Morale"; + + print ""; + + print ''; + + print ''; + + print ''; + + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
Type"; + $htmls->select_array("type", $adht->liste_array(), $adh->typeid); + print "Commentaires
Personne"; + $htmls->select_array("morphy", $morphys, $adh->morphy); + print "'; + print '
Prénom
Nom
Societe
Adresse'; + print '
CP Ville
Pays
Email
Login
Password
Date de naissance
Format AAAA-MM-JJ
URL photo
'; + print ' '; + print ''; + print '
'; + +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/public/adherents/priv_liste.php b/htdocs/public/adherents/priv_liste.php new file mode 100644 index 00000000000..2ec429029f7 --- /dev/null +++ b/htdocs/public/adherents/priv_liste.php @@ -0,0 +1,130 @@ + + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * + * 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 ""; + + print ''; + + + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + + + print "\n"; + print "\n"; + print "\n"; + print "\n"; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + } + else + { + print "rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)."\n"; + } + } + else + { + print " "; + } + + print "\n"; + print "\n"; + print "\n"; + print ""; + print "\n"; + print ""; + $i++; + } + print "
Prenom Nom / Société"; + print_liste_field_titre("Date cotisation",$PHP_SELF,"t.cotisation","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Email",$PHP_SELF,"d.email","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Type",$PHP_SELF,"t.libelle","&page=$page&statut=$statut"); + print "PersonneStatutAction
rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." / ".stripslashes($objp->societe).""; + if ($objp->cotisation == 'yes') + { + if ($objp->datefin < time()) + { + print "rowid&action=edit\">".strftime("%d %B %Y",$objp->datefin)." - Cotisation non recue$objp->email$objp->type$objp->morphy"; + if ($objp->statut == -1) + { + print 'A valider'; + } + print "rowid\">Editer
rowid&action=resign\">Resilier
rowid&action=delete\">Supprimer
"; +} +else +{ + print $sql; + print $db->error(); +} + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>