Subversion Repositories Sites.gentiana.org

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or                                        |
// | modify it under the terms of the GNU Lesser General Public                                           |
// | License as published by the Free Software Foundation; either                                         |
// | version 2.1 of the License, or (at your option) any later version.                                   |
// |                                                                                                      |
// | This library 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                                    |
// | Lesser General Public License for more details.                                                      |
// |                                                                                                      |
// | You should have received a copy of the GNU Lesser General Public                                     |
// | License along with this library; if not, write to the Free Software                                  |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: annuaire_moteur.php,v 1.2 2005/03/24 08:24:39 alex Exp $
/**
* programme principal du module annuaire_moteur
*
* programme principal du module annuaire_moteur
*
*@package annuaire
//Auteur original :
*@author        Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author        Aucun
*@copyright     Tela-Botanica 2000-2004
*@version       $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+

include_once 'client/annuaire/configuration/ann_config.inc.php' ;

include_once (ANN_CHEMIN_APPLI."annuaire_moteur_fonction.php");
include_once (ANN_CHEMIN_LIBRAIRIE."annuaire.fonct.php") ;

if (isset($lang)) {
    include_once ANN_CHEMIN_APPLI."/langues/ann_langue_$lang.inc.php" ;
} else {
    include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
}

define ("ANN_MAIL_TOUS", 1) ;
define ("ANN_MAIL_TOUS_ENVOIE", 2) ;
define ('ANN_ACTION_VOIR_ADHERENT', 'voir_adherent');
define ('ANN_ACTION_VOIR_COTISATION', 'voir_cotisation');
define ('ANN_VARIABLE_ACTION', 'action');
define ('ANN_ACTION_MAIL_TOUS', 'mail_tous');
define ('ANN_ACTION_SUPPRIMER_ADHERENT', 'suppr_adh');

// Action pour les cotisations
define ('ANN_ACTION_SAISIR_COTISATION', 'sc');
define ('ANN_ACTION_VALIDER_COTISATION', 'cu');
define ('ANN_ACTION_MODIFIER_COTISATION', 'mu');
define ('ANN_ACTION_SUPPRIMER_COTISATION', 'rm');
define ('ANN_ACTION_ENVOYER_RECU', 'er');


function afficherContenuNavigation () {
    $res .= '<ul class="onglets">';
    $GLOBALS['ann_url']->addQueryString(ANN_VARIABLE_ACTION, ANN_ACTION_VOIR_ADHERENT);
    $res .= '<li class="'.cma(ANN_ACTION_VOIR_ADHERENT).'"><a href="'.$GLOBALS['ann_url']->getURL().'">Adh&eacute;rents</a></li>';
    $GLOBALS['ann_url']->addQueryString(ANN_VARIABLE_ACTION, ANN_ACTION_VOIR_COTISATION);
    $res .= '<li class="'.cma(ANN_ACTION_VOIR_COTISATION).'"><a href="'.$GLOBALS['ann_url']->getURL().'">Cotisations</a></li>';
    $res .= '</ul>';
    $GLOBALS['ann_url']->removeQueryString (ANN_VARIABLE_ACTION) ;
    return $res ;
}

function afficherContenuCorps () {
    global $statut ;
        if (!isset($_REQUEST[ANN_VARIABLE_ACTION])) $_REQUEST[ANN_VARIABLE_ACTION] = ANN_ACTION_VOIR_ADHERENT;
    if (!$GLOBALS['AUTH']->getAuth())  {
        $res = AUTH_formulaire_login() ;
    } else {
        switch ($_REQUEST[ANN_VARIABLE_ACTION]) {
                case ANN_ACTION_SAISIR_COTISATION:
                case ANN_ACTION_MODIFIER_COTISATION:
                case ANN_ACTION_SUPPRIMER_COTISATION:
                case ANN_ACTION_VALIDER_COTISATION:
                case ANN_ACTION_ENVOYER_RECU:
                        if (isset($_GET['u_id'])) {
                        include_once (ANN_CHEMIN_APPLI.'admin_annu.php');
                    $GLOBALS['ann_url']->addQueryString ('u_id', $_GET['u_id']) ;
                    return putFrame() ;
                        }
                case ANN_ACTION_VOIR_COTISATION:
                        $res .= '<div>'.resume_cotisation().'</div>'."\n";
                break;
                case ANN_ACTION_MAIL_TOUS:
                case ANN_MAIL_TOUS_ENVOIE:
                        include_once (ANN_CHEMIN_APPLI.'mail_tous.php') ;
                        return putFrame() ;
                default:
                        if (isset ($_GET['u_id'])) {
                                include_once (ANN_CHEMIN_APPLI.'admin_annu.php');
                        $GLOBALS['ann_url']->addQueryString ('u_id', $_GET['u_id']) ;
                        return putFrame() ;
                        }
                        return mkengine().mkresu();
        }
    }
    return $res ;
}

function cma ($var) {
    $class = $_REQUEST[ANN_VARIABLE_ACTION] == $var ?  'menu_actif' :  'menu_inactif' ;
    return $class ;
}
?>