* Copyright (C) 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"); require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); if ($HTTP_POST_VARS["action"] == 'add' && $user->admin) { $adht = new AdherentType($db); $adht->libelle = $HTTP_POST_VARS["libelle"]; $adht->cotisation = $HTTP_POST_VARS["cotisation"]; $adht->commentaire = $HTTP_POST_VARS["comment"]; $adht->mail_valid = $HTTP_POST_VARS["mail_valid"]; $adht->vote = $HTTP_POST_VARS["vote"]; if ($adht->create($user->id) ) { Header("Location: type.php"); } } if ($HTTP_POST_VARS["action"] == 'update' && $user->admin) { $adht = new AdherentType($db); $adht->id = $rowid; $adht->libelle = $HTTP_POST_VARS["libelle"]; $adht->cotisation = $HTTP_POST_VARS["cotisation"]; $adht->commentaire = $HTTP_POST_VARS["comment"]; $adht->mail_valid = $HTTP_POST_VARS["mail_valid"]; $adht->vote = $HTTP_POST_VARS["vote"]; if ($adht->update($user->id) ) { Header("Location: type.php"); } } if ($action == 'delete') { $adh = new Adherent($db); $adh->delete($rowid); Header("Location: liste.php"); } if ($action == 'commentaire') { $don = new Don($db); $don->set_commentaire($rowid,$HTTP_POST_VARS["commentaire"]); $action = "edit"; } llxHeader(); print_titre("Configuration"); /* ************************************************************************** */ /* */ /* */ /* */ /* ************************************************************************** */ $sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); $i = 0; print ""; print ''; print ""; print ""; print "\n"; $var=True; while ($i < $num) { $objp = $db->fetch_object( $i); $var=!$var; print ""; print "\n"; print ''; print ''; print ''; print ''; print ""; $i++; } print "
IdLibelléCotisation ?Vote ? 
".$objp->rowid."'.$objp->libelle.''.$objp->cotisation.''.$objp->vote.'Editer
"; } else { print $sql; print $db->error(); } print "

"; /* * Case 1 */ print ''; /* * Case 2 */ print ""; /* * Case 3 */ print ""; /* * Case 4 */ print ""; print "
[Nouveau Type]---

"; /* ************************************************************************** */ /* */ /* Création d'une fiche don */ /* */ /* ************************************************************************** */ if ($action == 'create') { /* * $sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber"; * $sql .= " FROM societe as s, ".MAIN_DB_PREFIX."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; * } * } */ print_titre("Nouveau type"); print "

"; print ''; print ''; print ''; print '"; print '"; print ''; print "\n"; print "
Libellé
Soumis à cotisation'; print ''; print '
Droit de vote'; print ''; print '
Commentaires :'; print "
Mail d\'accueil :'; print "
\n"; } /* ************************************************************************** */ /* */ /* Edition de la fiche */ /* */ /* ************************************************************************** */ if ($rowid > 0 && $action == 'edit') { $adht = new AdherentType($db); $adht->id = $rowid; $adht->fetch($rowid); print_titre("Edition de la fiche"); print "
"; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print "
Libellé'.$adht->libelle.' 
Soumis à cotisation'.$adht->cotisation.' 
Droit de vote'.$adht->vote.' 
Commentaires'; print nl2br($adht->commentaire).' 
Mail d\'accueil'; print nl2br($adht->mail_valid).' 
\n"; /* * * * */ print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '"; print '"; print ''; print '
Libellé
Soumis à cotisation'; $htmls = new Form($db); $htmls->selectyesno("cotisation",$adht->cotisation); print '
Droit de vote'; $htmls->selectyesno("vote",$adht->vote); print '
Commentaires :'; print "
Mail d\'accueil :'; print "
'; print "
"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>