* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2005 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 * 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$ * */ /** \file htdocs/adherents/type.php \ingroup adherent \brief Page de configuration des types d'adhérents \version $Revision$ */ require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); $langs->load("members"); if ($_POST["action"] == 'add' && $user->admin) { if ($_POST["button"] != $langs->trans("Cancel")) { $adht = new AdherentType($db); $adht->libelle = $_POST["libelle"]; $adht->cotisation = $yesno[$_POST["cotisation"]]; $adht->commentaire = $_POST["comment"]; $adht->mail_valid = $_POST["mail_valid"]; $adht->vote = $yesno[$_POST["vote"]]; if ($_POST["libelle"]) { $adht->create($user->id); } } Header("Location: type.php"); } if ($_POST["action"] == 'update' && $user->admin) { if ($_POST["button"] != $langs->trans("Cancel")) { $adht = new AdherentType($db); $adht->id = $_POST["rowid"];; $adht->libelle = $_POST["libelle"]; $adht->cotisation = $yesno[$_POST["cotisation"]]; $adht->commentaire = $_POST["comment"]; $adht->mail_valid = $_POST["mail_valid"]; $adht->vote = $yesno[$_POST["vote"]]; $adht->update($user->id); } Header("Location: type.php"); } if ($_GET["action"] == 'delete') { $adh = new Adherent($db); $adh->delete($rowid); Header("Location: liste.php"); } if ($_GET["action"] == 'commentaire') { $don = new Don($db); $don->set_commentaire($rowid,$_POST["commentaire"]); $action = "edit"; } llxHeader(); print_titre($langs->trans("MembersTypeSetup")); print '
'; /* ************************************************************************** */ /* */ /* */ /* */ /* ************************************************************************** */ $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($result); $var=!$var; print ""; print "\n"; print ''; print ''; print ''; print ''; print ""; $i++; } print "
Id'.$langs->trans("Label").'Cotisation ?Vote ? 
".$objp->rowid."'.$objp->libelle.''.$langs->trans($objp->cotisation).''.$langs->trans($objp->vote).''.img_edit().'
"; } else { dolibarr_print_error($db); } /* * Barre d'actions * */ print '
'; print "".$langs->trans("NewType").""; print "
"; /* ************************************************************************** */ /* */ /* Création d'une fiche don */ /* */ /* ************************************************************************** */ if ($_GET["action"] == 'create') { $htmls = new Form($db); print_titre("Nouveau type"); print '
'; print "
"; print ''; print ''; print ''; print ''; print ''; print '"; print '"; print ''; print "\n"; print "
'.$langs->trans("Label").'
Soumis à cotisation'; $htmls->selectyesno("cotisation",""); print '
Droit de vote'; $htmls->selectyesno("vote",""); print '
'.$langs->trans("Comments").' :'; print "
Mail d\'accueil :'; print "
 '; print '
\n"; } /* ************************************************************************** */ /* */ /* Edition de la fiche */ /* */ /* ************************************************************************** */ if ($_GET["rowid"] > 0 && $_GET["action"] == 'edit') { $htmls = new Form($db); $adht = new AdherentType($db); $adht->id = $_GET["rowid"]; $adht->fetch($_GET["rowid"]); print_titre("Edition de la fiche"); print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print '"; print '"; print ''; print '
'.$langs->trans("Label").'
Soumis à cotisation'; $htmls->selectyesno("cotisation",$adht->cotisation); print '
Droit de vote'; $htmls->selectyesno("vote",$adht->vote); print '
'.$langs->trans("Comments").' :'; print "
Mail d\'accueil :'; print "
 '; print '
'; print "
"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>