<?php
//20.0.56.2 IHM/Champ/Calendrier/JourFerie.php GF 
//VersionVI: 30F200067s
//(c) 2005-2012 PC SOFT  - Release
 if (!defined('__INC__FMK/Wltype.php')) { define('__INC__FMK/Wltype.php',true); include_once(WB_INCLUDE_PATH.'WD6d79f243a7423e4bf72a9488d027d476.php'); } if (!defined('__INC__FMK/Date.php')) { define('__INC__FMK/Date.php',true); include_once(WB_INCLUDE_PATH.'WD97af71f4453b9d548e8ff90b4bbaba9f.php'); } function& Fc01a25d5() { global $clGetTableauJourFerie; if (!isset($clGetTableauJourFerie)){ $clGetTableauJourFerie = new CTableauJourFeries(); } return $clGetTableauJourFerie; } class CJourFerie { var $m_szJour; function CJourFerie ( $pszJourFerie=null) { $this->m_szJour = ''; if (isset($pszJourFerie)){ $this->m_szJour = utf8_substr($pszJourFerie,0, LONGUEUR_DATE); } } function F8b686221() { return $this->m_szJour; } function F3070d21d( $pszDate) { if (strcmp( $pszDate, $this->m_szJour ) == 0) return true; if (utf8_strlen( $this->m_szJour ) == 8) { return (strcmp( $pszDate, $this->m_szJour ) == 0); } $szAnnee = ''; $szAnnee = utf8_substr($pszDate,0,4); $nAnneeRech = intval( $szAnnee ); if ($nAnneeRech == 0) return false; if (strcmp($this->m_szJour, szJOURFERIE_PAQUES) == 0) { return $this->F9149df3f($pszDate, $nAnneeRech ); } if (strcmp($this->m_szJour, szJOURFERIE_ASCENSION) == 0) { return $this->F115a42df($pszDate, $nAnneeRech, 40-1 ); } if (strcmp($this->m_szJour, szJOURFERIE_PENTECOTE) == 0) { return $this->F115a42df($pszDate, $nAnneeRech, 50 ); } if (strcmp($this->m_szJour, szJOURFERIE_VENDREDISAINT) == 0) { return $this->F115a42df($pszDate, $nAnneeRech, -2 ); } if (strcmp($this->m_szJour, szJOURFERIE_LUNDIDEPAQUES) == 0) { return $this->F115a42df($pszDate, $nAnneeRech, 1); } if (utf8_strlen( $this->m_szJour ) == 4) { return (strcmp( utf8_substr($pszDate,4) , $this->m_szJour ) == 0); } if (utf8_strlen( $this->m_szJour ) == 6) { return $this->F7cd27c38( $pszDate, $nAnneeRech ); } return false; } function F9149df3f( $pszDate, $nAnnee) { $szPaques =''; F9d347f2a($nAnnee, $szPaques); return (strcmp($pszDate, $szPaques) == 0); } function F115a42df( $pszDate, $nAnnee , $nDeltaJour) { $clDate = new CDateCalendrier ( $pszDate ); $clDate->F820be7fb( -$nDeltaJour ); return $this->F9149df3f( $clDate->F09992612(), $nAnnee ); } function F7cd27c38( $pszDate, $nAnnee) { $nNumMoisOk = intval( $this->m_szJour ); $nNumSemaineOk = intval( utf8_substr($this->m_szJour , 3) ); $nNumJourDeLaSemaineOk = intval( utf8_substr($this->m_szJour , 5) ); $clDate = new CDateCalendrier( $pszDate ); if ($clDate->nGetMois() != $nNumMoisOk) return false; if ($clDate->F4c110548() != $nNumJourDeLaSemaineOk) return false; $nNumSemaine = 0; while ( $clDate->nGetMois() == $nNumMoisOk ) { ++$nNumSemaine; $clDate->F820be7fb(-7); } if ($nNumSemaine != $nNumSemaineOk) return false; return true; } } function F9d347f2a( $annee, &$pszDateSur8 ) { $pszDateSur8 = ''; $month = 0; $day = 0; Fc4670717($annee,$month,$day); $pszDateSur8 = utf8_sprintf("%04d%02d%02d",$annee, $month,$day); } class CTableauJourFeries { var $m_bInit; var $m_tabElements; function CTableauJourFeries() { $this->m_tabElements = array(); $this->m_bInit = false; } function F1e306ff3( $pszDate) { $clJoursFerie = new CJourFerie($pszDate); $nNbElements = count($this->m_tabElements,COUNT_NORMAL); for($i=0; $i<$nNbElements; $i++) { if ( nMatchJourFerie($clJoursFerie,$this->m_tabElements[$i]) == 0 ) { return true; } } return false; } function F97061f6a( $pszJourFerie) { $this->m_bInit = true; $clJoursFerie = new CJourFerie($pszJourFerie); $nNbElements = count($this->m_tabElements,COUNT_NORMAL); for($i=0; $i<$nNbElements; ++$i) { if ($this->m_tabElements[$i]->m_szJour === $clJoursFerie->m_szJour) { return; } } $this->m_tabElements[] =& $clJoursFerie; } function F2f1df2f6() { $this->m_bInit = true; $this->m_tabElements = array(); } function F6bc371a0() {return count($this->m_tabElements,COUNT_NORMAL);} function bInitFaite () { return $this->m_bInit; } function F6e417331( &$pclListeJourFerie) { $pclListeJourFerie = ''; $nMax = $this->F6bc371a0(); for ($i = 0; $i < $nMax; $i++) { if (!empty($pclListeJourFerie)) { $pclListeJourFerie.=RC; } $pclListeJourFerie .= $this->m_tabElements[$i]->F8b686221(); } } } function nMatchJourFerie ( $pclJourTeste, $pclJourFerie) { return $pclJourFerie->F3070d21d($pclJourTeste->F8b686221()) ? 0 : 1; } ?>