Rev 5 | Rev 9 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php// +------------------------------------------------------------------------------------------------------+// | 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 |// +------------------------------------------------------------------------------------------------------+// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |// |@version 3 |// +------------------------------------------------------------------------------------------------------+/**fichier contenant le menu principal de l'application de gestion du temps de travail*@package gtt_general//Auteur original :*@author Dorian Bannier <dbannier@aol.com>//Autres auteurs :*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>*@copyright Copyright (C) 2003 Tela-Botanica*/// +------------------------------------------------------------------------------------------------------+// | INCLUSION DE FICHIERS |// +------------------------------------------------------------------------------------------------------+// Fichiers de la bibliotheque PEARinclude_once 'Auth/Auth.php';include_once 'DB.php';include_once 'HTML/QuickForm.php';include_once 'gtt_config.inc.php';include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';include_once CHEMIN_CLASSES.'gtt_authentification.php';include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;// Création du dsn// Connexion a la base de donnees$GLOBALS['db'] = DB::connect($GLOBALS['dsn']);if (DB::isError($GLOBALS['db'])) {$GLOBALS['db']->getMessage();echo "echec connexion a la base de donnees";}$params = array("dsn"=>$GLOBALS['dsn'],"table"=>GEST_UTILISATEUR,"usernamecol"=>GEST_CHAMPS_EMAIL,"passwordcol"=>GEST_CHAMPS_PASSWORD,"cryptype"=>"md5","db_fields"=>"*");// Création de l'objet auth$a = new Auth('DB', $params, 'afficherMenuConnexion', true);$a->setSessionname('temps_travail');$a->setExpire(3600*24*30);$a->start();echo $a->getStatus();if ($a->getAuth()) {$mail = $a->getUserName();$utilisateur = Utilisateur::recupIDUtilisateurMail($mail);$GLOBALS['idCurrentUser'] = $utilisateur;// Récuperation de l'identifiant de la personne// Test des choix de menu a afficherif (empty($action)) {$action = 1 ;}switch ($action) {// Cas affichage menu travail 1case GESTION_TRAVAIL :include_once CHEMIN_MENU.'gtt_menu_travail.php';include_once CHEMIN_CONTROLEUR.'gtt_controleur_travail.php';if (!isset($semaine)) {$semaine = date('W',mktime(0, 0, 0, date('m'), date('d') ,date('Y')));}if (!isset($annee)) {$annee = date('Y');}$text = traiterAdminTravail($_SERVER['PHP_SELF'], $semaine, $annee, $utilisateur);break;// Cas affichage du menu ajout autilisateurss 13case GESTION_ADMIN_UTILISATEUR :include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';$text = traiterAdminUtilisateur('',0);break;// Cas editer des utilisateurs 14case GESTION_EDITER_UTILISATEUR :include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';$text = traiterAdminUtilisateur(renvoyerDonneesUser(),1);break;// Cas afficher menu administration projet 15case GESTION_ADMIN_PROJET :include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_projet.php';$text = traiterAdminProjet();break;// Cas afficher menu administration categorie 16case GESTION_ADMIN_CATEGORIE :include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_categorie.php';$text = traiterAdminCategorie();break;// Cas afficher menu admin motif absence 17case GESTION_ADMIN_MOTIF_ABSENCE :include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_motif_absence.php';$text = traiterAdminMotif();break;// Cas afficher menu admin statut 18case GESTION_ADMIN_STATUT :include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_statut.php';$text = traiterAdminStatut();break;// Cas afficher admin editer frais 19case GESTION_ADMIN_FRAIS :$text = '';break;// Cas afficher admin editer taches 20case GESTION_ADMIN_TACHE :$text = '';break;// Cas editer preferences d'un utilisateur 21case GESTION_EDITER_PREFERENCES :include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';include_once CHEMIN_CONTROLEUR.'gtt_controleur_editer_preferences.php';$text = traiterEditerPreferences($GLOBALS['idCurrentUser']);break;// Cas deconnexion 22case GESTION_DECONNEXION :$a->logout();$text = afficherMenuConnexion();//$GLOBALS['db']->disconnect();break;}$text .= fermerBalisesFin();echo $text;} else {echo afficherMenuConnexion();}//tester le choix de l'utilisateur?>