Subversion Repositories Applications.gtt

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/presentation/gtt_fonctions_generique_affichage.php
New file
0,0 → 1,255
<?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 |
/*@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
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
//include_once 'gtt_config.inc.php';
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/**
*permet d'afficher une page
*/
function afficherPage($page)
{
print($page);
}
 
 
/**
*permet l'affichage du titre
*/
 
function creerZoneTitre($nom)
{
$titreHTML.=' <!--Titre-->'."\n";
$titreHTML.=' <div class="zone titre">'."\n";
$titreHTML.=' '.$nom."\n";
$titreHTML.=' </div'."\n";
$titreHTML.=' <!-- Fin titre -->'."\n\n";
return $titreHTML;
}
/*
*fonction creant l'entete de tout page web
*/
function creerEntetePage($nom)
{
$entete ='<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";
$entete .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />'."\n";
$entete .='<html xmlns="http://www.w3.org/1999/xhtml/" >'."\n";
$entete .=' <head>'."\n";
$entete .=' <meta http-equiv="Content-Style-Type" content="text/css" />'."\n";
$entete .=' <link rel="stylesheet" type="text/css" href="'.CHEMIN_CSS.'gtt_vert.css" media="screen" title="Vert" />'."\n";
$entete .=' <title>'.$nom.'</title>'."\n";
$entete .=' </head>'."\n";
$entete .=' <body>'."\n\n";
return $entete;
}
 
/**
*fonction creant la partie au pied de la page
*/
function creerZonePiedPage()
{
$piedPage.=' <!--Debut pied de page -->'."\n";
$piedPage.=' <div class="zone_pieds_page">'." \n";
$piedPage.= ' Copyright Tela Botanica 2004 - <a href="mailto:accueil@tela-botanica.org" > Webmaster </a> '."\n";
$piedPage.= ' </div>'."\n";
$piedPage.= ' <!-- Fin pied de page -->'."\n\n";
return $piedPage;
}
/**
*fonction permettant de fermer les balises html
*/
function fermerBalisesFin()
{
$ret =' </body>'."\n";
$ret.='</html>'."\n";
return $ret;
}
 
/**
*fonction permettant d'afficher la zone de menu de gauche
*fournit un lien vers le menu a afficher selon le choix de l'utilisateur
*/
 
function creerZoneMenuOption($utilisateur)
{
$zoneOption.= '<!-- Début zone menu -->'."\n";
$zoneOption.=' <div class="zone_menu">'."\n";
$zoneOption .= ' <ul>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?action='.GESTION_TRAVAIL.'&semaine='.$semaine.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_TRAVAIL.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_ABSCENCES.'&action='.GTT_ACTION_NON_TRAVAIL.'&mois='.$mois.'&annee='.$annee.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_NON_TRAVAIL.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_GRAPHIQUES.'&action='.GTT_ACTION_GRAPHIQUE.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_GRAPH.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_ORGANISME.'&action='.GTT_ACTION_RECAPITULATIF_GENERAL.'&annee='.$annee.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_RECAPITULATIF_GENERAL.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_PERSO_PROJET.'&action='.GTT_ACTION_RECAPITULATIF.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_RECAPITULATIF_UTILISATEUR.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_INFO_PERSO_MENSUEL.'&action='.GTT_ACTION_FEUILLE_MOIS.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_FEUILLE_MOIS.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' <li>'."\n";
$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_UTILISATEURS.'&action='.GTT_ACTION_DONNEE_UTILISATEUR.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_UTILISATEURS.' </a>'."\n";
if ($utilisateur->isAdmin()==1)
{
$zoneOption .= ' <li>'."\n";
//$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_ADMINISTRATION.'&action='.GTT_ACTION_ADMIN_UTILISATEUR.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_ADMINISTRATION.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
 
}
$zoneOption .= ' <li>'."\n";
//$zoneOption .= ' <a href="index.php?menu='.GTT_MENU_DECONNECTION.'&date='.$date.'&user='.$utilisateur.'" >'."\n";
$zoneOption .= ' '.GTT_L_ME_DECONNECTION.' </a>'."\n";
$zoneOption .= ' </li>'."\n";
$zoneOption .= ' </ul>'."\n";
$zoneOption .= ' </div>'."\n";
$zoneOption .= ' <!-- Fin zone menu -->'."\n\n";
return $zoneOption;
}
/**
* fonction affichant les options
*@param identifiant d'un utilisateur
*renvoie un formulaire sous forme html
*/
function afficherOptionAplication($user)
{
$id="MENU_OPTION";
$size=15;
$assoc1=array('class'=>$id);
$form=new HTML_QuickForm('gestion_option', 'post','','', $assoc1);
//ajout d'element
//projets de l'utilisateur
$ligneEditerPref = &HTML_QuickForm::createElement('link', 'btn_editer_pref','',$GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES,GESTION_MES_PROJETS_L,$assoc1);
$form->addElement($ligneEditerPref);
//travail
$ligneTravail=&HTML_QuickForm::createElement('link', 'btn_editer_travail','',$GLOBALS['urlBase'].GESTION_TRAVAIL,GTT_L_ME_TRAVAIL,$assoc1);
$form->addElement($ligneTravail);
//administration
$user1=&Utilisateur::recupererUtilisateur($user);
if ($user1->isAdmin()==1)
{
$ligneAdmin=&HTML_QuickForm::createElement('link', 'btn_admin','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GTT_L_ME_ADMINISTRATION,$assoc1);
$form->addElement($ligneAdmin);
}
 
$ligneDeconnexion=&HTML_QuickForm::createElement('link', 'btn_deconnexion','',$GLOBALS['urlBase'].GESTION_DECONNEXION,GTT_L_ME_DECONNECTION,$assoc1);
$form->addElement($ligneDeconnexion);
 
return $form->toHtml();
}
/**
*fonctions creant la liste des options disponibles
*nouveau formulaire avec la liste des optiosn disponibles
*/
function creerFormulaireOptionAdmin()
{
$id="LISTE_OPTION_ADMIN";
$size=7;
$assoc =array ('class'=>$id, 'size'=>$size);
$form=new HTML_QuickForm('liste_options_admin', 'post','','',$assoc);
//liste des elements : categorie
$bouton=&HTML_QuickForm::createElement('link', 'champ_categorie','',$GLOBALS['urlBase'].GESTION_ADMIN_CATEGORIE,GESTION_CATEGORIE_L,$assoc);
$form->addElement($bouton);
 
 
//frais
$bouton1=&HTML_QuickForm::createElement('link', 'champ_frais','',$GLOBALS['urlBase'].GESTION_ADMIN_FRAIS,GESTION_FRAIS_L,$assoc);
$form->addElement($bouton1);
 
//motifs absence
$bouton2=&HTML_QuickForm::createElement('link', 'champ_motif_absence','',$GLOBALS['urlBase'].GESTION_ADMIN_MOTIF_ABSENCE,GESTION_MOTIF_L,$assoc);
$form->addElement($bouton2);
 
 
//projets
$bouton3=&HTML_QuickForm::createElement('link', 'champ_projet','',$GLOBALS['urlBase'].GESTION_ADMIN_PROJET,GESTION_PROJET_L,$assoc);
$form->addElement($bouton3);
 
//statut
$bouton4=&HTML_QuickForm::createElement('link', 'champ_statut','',$GLOBALS['urlBase'].GESTION_ADMIN_STATUT,GESTION_STATUT_L,$assoc);
$form->addElement($bouton4);
 
 
//taches
$bouton5=&HTML_QuickForm::createElement('link', 'champs_tache','',$GLOBALS['urlBase'].GESTION_ADMIN_TACHE,GESTION_TACHES_L,$assoc);
$form->addElement($bouton5);
 
 
//utilisateur
$bouton6=&HTML_QuickForm::createElement('link', 'champ_utilisateur','',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,GESTION_UTILISATEUR_L,$assoc);
$form->addElement($bouton6);
return $form;
}
 
?>
/trunk/presentation/CVS/Entries
New file
0,0 → 1,2
/gtt_calendrier.class.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_fonctions_generique_affichage.php/1.1/Tue Feb 22 12:07:13 2005//
/trunk/presentation/CVS/Repository
New file
0,0 → 1,0
gestion/version_3/presentation
/trunk/presentation/CVS/Root
New file
0,0 → 1,0
:extssh:jp_milcent@adullact.net:/cvsroot/eflore
/trunk/presentation/gtt_calendrier.class.php
New file
0,0 → 1,461
<?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 |
// +------------------------------------------------------------------------------------------------------+
// | Auteur : Dorian Bannier (dbannier@aol.com) |
 
// |@author ABDOOL RAHEEM shaheen <shaheenar50@hotmail.com> |
// |@version 3 |
 
include_once("HTML/Table.php");
include_once 'gtt_config.inc.php';
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
include_once "HTML/QuickForm.php";
 
/**
*classe calendrier pour gerer le calendrier pour un mois et une annee
*donne
*@param annee
*@param mois
*@param premier jour du mois
*@param semaine
*@param l'url du resultat affiche
*@param liste de noms des jours
*@param liste de noms des mois
*@param liste des jours feries du mois
*/
 
 
class Calendrier
{
 
var $annee=null;
var $mois=null;
var $jour=null;
var $semaine=null;
var $url =null;
var $nom_jours=array();
var $nom_mois=array();
var $liste_feries=array();
/** contient le nom des variables que recevra l'url spécifié
* @var string
*/
var $var_jour = "jour";
var $var_mois = "mois";
var $var_annee = "annee";
 
/**
*constructeur de la classe calendrier
*toutes les variables sont initialises avec les donnees
*de la date du jour si on ne passe aucune date en parametre
*sinon on initialise le calendrier avec
*@param semaine
*@param annee
*/
function Calendrier($url,$semaine,$annee)
{
$tableau=&Calendrier::LundiEtDimancheSemaine($semaine,$annee);
$this->semaine=$semaine;
$this->mois=date('n',mktime(0,0,0,1,$tableau[0],$annee));
$this->jour=date('d',mktime(0,0,0,1,$tableau[0],$annee));
$this->annee=date('Y',mktime(0,0,0,1,$tableau[0],$annee));
//$this->annee=$annee;
$this->url=$url;
$this->nom_jours=array (GESTION_LUN_L, GESTION_MAR_L, GESTION_MER_L, GESTION_JEU_L, GESTION_VEN_L, GESTION_SAM_L ,GESTION_DIM_L);
$this->nom_mois=array(1 => "Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet",
"Ao&ucirc;t","Septembre","Octobre","Novembre","D&eacute;cembre");
$this->liste_feries =&Calendrier::calculJoursFeries($this->annee);
//echo $this->nom_mois[$this->mois];//date('M',mktime(0,0,0,1,$tableau[0],$annee));
//echo " $this->annee";
}
 
/**
*fonction calculant les dates des jours feries en france
*renvoie un tableau contenant la liste de dates par mois
*les dates sont de la forme timestamp unix
*
*@param $annee
*@return tableaude dates
*/
 
function calculJoursFeries($annee)
{
$paques=&Calendrier::paques($annee);
$ascension=&Calendrier::ascension($annee);
$pentecote=&Calendrier::pentecote($annee);
$tab=array(mktime(0,0,0,1,1,$annee),
$paques,
mktime(0,0,0,5,1,$annee),
mktime(0,0,0,5,8,$annee),
$ascension,
$pentecote,
mktime(0,0,0,7,14,$annee),
mktime(0,0,0,8,15,$annee),
mktime(0,0,0,11,1,$annee),
mktime(0,0,0,11,11,$annee),
mktime(0,0,0,12,25,$annee));
return $tab;
 
}
 
/**
*fonction calculant le premier jour du mois
*@param: annee, mois
*/
 
function premierJourMois($argMois,$argAnnee)
{
$intPremierJour = date("w",mktime(0,0,0,$argMois,1,$argAnnee));
if($intPremierJour == 0) $intPremierJour = 7; // si c'est un dimanche
return $intPremierJour;
}
 
/**
*fonction calculat le dernier jour du mois
*@param : annee, mois
*renvoie un entier
*/
function dernierJourMois($argMois,$argAnnee)
{
$h=&Calendrier::nbJourMois($argMois,$argAnnee);
$intDernierJour=date("w",mktime(0,0,0,$argMois,$h,$argAnnee));
if($intDernierJour == 0) $intDernierJour = 7; // si c'est un dimanche
return $intDernierJour;
}
/**
*fonction calculant le nombre de jours dans un mois
*@param annee, mois
*/
function nbJourMois($argMois,$argAnnee)
{
return date("t", mktime(0,0,0,$argMois,1,$argAnnee));
}
 
 
/*
**fonction calculant la date du lundi de paques pour une annee
*renvoie un timestamp
*/
function paques($annee)
{
$date_paques=easter_date($annee);
$lundi_paques=mktime(date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 1,
date("Y", $date_paques)
);
return $lundi_paques;
}
/*
*fonction calculant la date du lundi de l'ascension
*renvoie un timestamp
*renvoie la date
*/
function ascension($annee)
{
$date_paques=easter_date($annee);
$date_ascension = mktime(date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 39,
date("Y", $date_paques)
);
return $date_ascension;
}
 
/*
*fonction calculant la date du lundi de la pentecote
*renvoie un timestamp
*renvoie cette derniere
*/
function pentecote($annee)
{
$date_paques=easter_date($annee);
$date_ascension=&Calendrier::ascension($annee);
$date_pentecote = mktime(date("H", $date_ascension),
date("i", $date_ascension),
date("s", $date_ascension),
date("m", $date_ascension),
date("d", $date_ascension) + 11,
date("Y", $date_ascension)
);
return $date_pentecote;
}
 
/**
*fonction affichant un calendrier naviguable par semaine
*option pour cliquer sur une semaine donnee
*utilisation de la bibliotheque HTML/TABLE de PEAR
*@param numero de semaine et annee
*/
 
function afficherCalendrier($annee)
{
$id="CALENDRIER";
$text=/*"</tr></td>".*/"<div id=\"calendrier\">";
//initialisation des donnees
$intPremierJour = &Calendrier::premierJourMois($this->mois,$this->annee);
$intNbJoursMois = &Calendrier::nbJourMois($this->mois,$this->annee);
$prevMonth=&Calendrier::prevMonth($this->mois,$this->annee);
$intNbJourPrec=&Calendrier::nbJourMois($prevMonth[0],$prevMonth[1]);
$intDernierJour=&Calendrier::dernierJourMois($this->mois,$this->annee);
//calcul du lundi et dimanche de la semaine courante
//calcul de l'annee
$tabLundiDimanche=&Calendrier::lundiEtDimancheSemaine($this->semaine,$annee);
 
//creation de la table HTML representant le calendrier
$tableAttrs = array("class" =>$id,"width" => "300");
//creation de la barre de navigation
//semaine precedente
$tabPrevWeek=&Calendrier::prevWeek();
$text.="<a href=".$GLOBALS['urlBase'].GESTION_TRAVAIL."&semaine=";
$text.=$tabPrevWeek[0]."&annee=".$tabPrevWeek[1].">";
$text.="<<"."</a>";
//semaine courante
$text.='<button>';
$text.=date('d/m/y',mktime(0,0,0,1,$tabLundiDimanche[0],$annee));
$text.=' -- ';
$text.=date('d/m/y',mktime(0,0,0,1,$tabLundiDimanche[1],$annee));
$text.='</button>';
//semaine suivante
$tabNextWeek= &Calendrier::nextWeek();
$text.="<a href=".$GLOBALS['urlBase'].GESTION_TRAVAIL."&semaine=";
$text.=$tabNextWeek[0]."&annee=".$tabNextWeek[1].">";
$text.=">>"."</a>";
 
$table = new HTML_Table($tableAttrs);
$table -> setAutoGrow(true);
 
$table->addRow($this->nom_jours);
 
//remplissage de la premiere ligne
//test si on est dans la semaine courante
//si dimanche egale a la fin de la semaine
$semCourante=(date('d',mktime(0,0,0,1,$tabLundiDimanche[1],$annee))==(7-$intPremierJour+1));
$p=1;
for($i=1; $i<=7;$i++)
{
if ($i<$intPremierJour and $semCourante)//mois prec et semaine courante
{
$elem[$i-1]="<div id=\"moisprecedent\">".($intNbJourPrec-$intPremierJour+$i+1);
}elseif ($i<$intPremierJour and !$semCourante)//mois prec et pas semaien courante
{
$semaineL=date('W',mktime(0,0,0,$prevMonth[0],($intNbJourPrec-$intPremierJour+$i+1),$prevMonth[1]));
$elem[$i-1]= "<a href=".$this->url."?action=".GESTION_TRAVAIL."&semaine=$semaineL"."&annee=$prevMonth[1]".">".($intNbJourPrec-$intPremierJour+$i+1)."</a>";
}elseif($i>=$intPremierJour and $semCourante)//mois courant et semaine courante
{
$elem[$i-1] = "<div id=\"jourcourant\">".$p."</div>";
$p++;
}else {//mois courant et pas semaine courante
$semaineL=date('W',mktime(0,0,0,$this->mois,$p,$this->annee));
$elem[$i-1] = "<a href=".$this->url."?action=".GESTION_TRAVAIL."&semaine=$semaineL";
$elem[$i-1] .="&annee=".$this->annee.">".$p."</a>";
$p++;
}
}
$table->addRow($elem);
//remplissage du reste des lignes
$i=0; //indice du tableau
//lundi de la semaien courante
// $t=&Calendrier::lundiEtDimancheSemaine($this->semaine,$this->annee);
$lundiCourant=date('d',mktime(0,0,0,1,$tabLundiDimanche[0],$annee));
$semCourante2=0;
for ($f=$p; $f<=$intNbJoursMois ; $f++)
{
if ($f==$lundiCourant and $i==0)
{
$semCourante2=1;//booleen
}
//calcul de la semaine courante
$semaineL2=date('W',mktime(0,0,0,$this->mois,$f,$this->annee));
if ($semCourante2==1)
{
$elem[$i]= "<div id=\"jourcourant\">".$f."</div>";
}else{
$elem[$i]="<a href=".$this->url."?action=".GESTION_TRAVAIL."&semaine=$semaineL2";
$elem[$i].="&annee=".$this->annee.">".$f."</a>";
}
if ($i==6)
{
$i=0;
if ($semCourante2==1)
{
$semCourante2=0;
}
$table->addRow($elem);
}else $i++;
}
//remplissage de la derniere ligne
$semaineL3=date('W',mktime(0,0,0,$this->mois,$intNbJoursMois,$this->annee));
if ($semCourante2==0)
{
for ($d=$i; $d<=6;$d++)
{
$s=$d-$i+1;
$elem[$d]="<a href=".$this->url."?action=".GESTION_TRAVAIL."&semaine=$semaineL2";
$elem[$d].="&annee=".$this->annee.">".$s."</a>";
}
}else {
for ($d=$i; $d<=6;$d++)
{
$elem[$d]= ($d-$i+1);
}
}
$table->addRow($elem);
$text.=$table->toHtml();
$text .= "</div>";
return $text;
}
 
/**
*fonction calculant la semaine suivante
*/
function nextWeek()
{
if ($this->semaine==date('W',mktime(0,0,0,12,31,$this->annee)))
{
$tab[0]=$nextWeek=1;
$tab[1]=$nextAnnee=$this->annee+1;
}else {
$tab[0]=$nextWeek=$this->semaine+1;
$tab[1]=$nextAnnee=$this->annee;
}
return $tab;
}
/**
*fonction calulant lasemaine precedeente
*/
function prevWeek()
{
if ($this->semaine==1)
{
$tab[0]=$prevWeek=date('W',mktime(0,0,0,12,31,($this->annee-1)));
$tab[1]=$prevAnnee=$this->annee-1;
} else{
$tab[0]=$prevWeek=$this->semaine -1 ;
$tab[1]=$prevAnnee=$this->annee;
}
return $tab;
}
/**
*fonction caluculant le mois suivant
*renvoie l'annee et le mois suivant sous forme de chiffre
*dans un tableau
*/
function nextMonth()
{
if ($this->mois==12)
{
$tab[0]=$nextMois=1;
$tab[1]=$nextAnnee=$this->annee+1;
}else
{
$tab[0]=$nextMois=$this->mois+1;
$tab[1]=$nextAnnee=$this->annee;
}
return $tab;
}
/**
*fonction calculant le mois precedent
*renvoie l'annee et le mois precedent sous forme de chiffre
*/
function prevMonth()
{
if ($this->mois==1)
{
$tab[0]=$prevMois=12;
$tab[1]=$prevAnnee=$this->annee-1;
}else
{
$tab[0]=$prevMois=$this->mois-1;
$tab[1]=$prevAnnee=$this->annee;
}
return $tab;
}
/**
*fonction renvoyant la date du lundi d'une semaine
*a partir du numero de semaine
*@param numero de semaine
*@praam annee
*@return un tableau contenat le timestamp unix de lenudi et dimanche
*de la semaine en question
*/
function lundiEtDimancheSemaine($semaine,$annee) {
 
if ((date("w", mktime(0,0,0,1,1,$annee)) <= 4) && (date("w", mktime(0,0,0,1,1,$annee)) != 0))
{
$nbre_jour = ($semaine-1)*7;
}else{
$nbre_jour = ($semaine)*7;
}
 
if (date("w", mktime(0,0,0,1,1,$annee)) == 0)
{
$nbre_jour +=7;
}else{
$nbre_jour +=7-((date("w", mktime(0,0,0,1,1,$annee))-1)%7);
}
 
$nbre_jour_7 = $nbre_jour-6;
 
//$lundi = date("d-m-Y", mktime(0,0,0,1,$nbre_jour_7,$annee) );
//$dimanche = date("d-m-Y", mktime(0,0,0,1,$nbre_jour,$annee));
 
return array($nbre_jour_7,$nbre_jour);
}
/**
*fonction indiquant si une date est feriee ou non
*renvoie 1 si ferie
*0 sinon
*/
function isFerie($date)
{
if (in_array($date,$this->liste_feries))
{
return 1;
}else return 0;
}
 
}
?>
Property changes:
Added: svn:executable