* * 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"); require("../cotisation.class.php"); require("../paiement.class.php"); $db = new Db(); 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"]; 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"]; 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"; $sql .= " FROM llx_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 ""; $i++; } print "
IdLibelléSoumis à cotisation 
".$objp->rowid."'.$objp->libelle.''.$objp->cotisation.'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, 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; } } print_titre("Nouveau type"); print "

"; print ''; print ''; print ''; print '"; print ''; print "\n"; print "
Libellé
Soumis à cotisation'; print ''; print '
Commentaires :'; 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 "
Libellé'.$adht->libelle.' 
Soumis à cotisation'.$adht->cotisation.' 
Commentaires'; print nl2br($adht->commentaire).' 
\n"; /* * * * */ print ''; print ''; print ''; print ''; print ''; print '"; print ''; print '
Libellé
Soumis à cotisation'; $htmls = new Form($db); $htmls->selectyesno("cotisation",$adht->cotisation); print '
Commentaires :'; print "
'; print "
"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>