Execute("SELECT * FROM scm_langues WHERE NAPublic = 0 AND CodeLangue = '" . $strBufLng . "'"); if ($rsIfLangExist->EOF == true) $_SESSION['strLangue'] = CstrDefaultLanguage; else $_SESSION['strLangue'] = $strBufLng; } } $bPagePreviewBeforeSave = false; if (isset($_GET['bpagepreview'])) { if ($_GET['bpagepreview'] == '1') $bPagePreviewBeforeSave = true; } /********* Récupère les traductions de texte (contenu de page au format HTML, longs textes) *********/ function GetContent($strCodeText) { $strSQLContent = ''; $rsContent = ''; $strReturn = ''; $bNA = 0; global $objConnMySQLCA; global $bPagePreviewBeforeSave; if ($bPagePreviewBeforeSave == true) { if (isset($_POST['cbContentNA_' . $strCodeText . '_' . $_SESSION['strLangue']])) $bNA = 0; else $bNA = 1; if ($bNA == 0 && isset($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']])) $strReturn = stripslashes($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']]); else $strReturn = ''; } else { $strSQLContent = ''; $strSQLContent .= 'SELECT Content FROM scm_contenttexts t INNER JOIN scm_pages p '; $strSQLContent .= 'ON t.IDPage = p.IDPage '; $strSQLContent .= "WHERE NonActif = 0 AND UCASE(t.CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLContent .= "AND UCASE(p.PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "' "; $strSQLContent .= "AND t.CodeText = '" . fctSQLSlashes($strCodeText) . "' "; $rsContent = $objConnMySQLCA->Execute($strSQLContent); if ($rsContent != false) $strReturn = $rsContent->fields['Content']; else $strReturn = ''; } return $strReturn; } /********* Récupère les traductions de messages d'informations ou d'erreurs *********/ function GetMessage($strCodeMessage) { $strSQLMessage = ''; $rsMessage = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLMessage = ''; $strSQLMessage .= 'SELECT Message FROM scm_transmessages '; $strSQLMessage .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLMessage .= "AND CodeMessage = '" . fctSQLSlashes($strCodeMessage) . "' "; $rsMessage = $objConnMySQLCA->Execute($strSQLMessage); if ($rsMessage != false) $strReturn = $rsMessage->fields['Message']; else $strReturn = ''; return $strReturn; } /********* Récupère les traductions de libellé (textes succincts) *********/ function Label($strLabel) { $strSQLLabel = ''; $rsLabel = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLLabel = ''; $strSQLLabel .= 'SELECT Label FROM scm_translabels '; $strSQLLabel .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLLabel .= "AND CodeLabel = '" . fctSQLSlashes($strLabel) . "' "; $rsLabel = $objConnMySQLCA->Execute($strSQLLabel); if ($rsLabel != false) { if ($rsLabel->fields['Label'] != '') $strReturn = $rsLabel->fields['Label']; else $strReturn = $strLabel; } else $strReturn = $strLabel; return $strReturn; } /********* Récupère le texte de référencement de la page en cours et l'affiche dans le tag TITLE *********/ function GetTitle() { $strSQLTitle = ''; $rsTitle = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLTitle = ''; $strSQLTitle .= 'SELECT PageReference FROM scm_pages '; $strSQLTitle .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLTitle .= "AND UCASE(PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "'"; $rsTitle = $objConnMySQLCA->Execute($strSQLTitle); if ($rsTitle != false) $strReturn = $rsTitle->fields['PageReference']; else $strReturn = ''; return $strReturn; } /********* Récupère les images pour une page *********/ function GetImage($strCodeImage) { $strSQLImage = ''; $rsImage = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLImage = ''; $strSQLImage .= 'SELECT Image FROM scm_contentimages t INNER JOIN scm_pages p '; $strSQLImage .= 'ON t.IDPage = p.IDPage '; $strSQLImage .= "WHERE NonActif = 0 AND UCASE(t.CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLImage .= "AND UCASE(p.PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "' "; $strSQLImage .= "AND t.CodeImage = '" . fctSQLSlashes($strCodeImage) . "' "; $rsImage = $objConnMySQLCA->Execute($strSQLImage); if ($rsImage != false) $strReturn = $rsImage->fields['Image']; else $strReturn = ''; return $strReturn; } /********* Récupère les traductions de texte (contenu de page au format HTML, longs textes) *********/ function GetFooterText($strCodeText) { $strSQLContent = ''; $rsContent = ''; $strReturn = ''; global $objConnMySQLCA; global $bPagePreviewBeforeSave; if ($bPagePreviewBeforeSave == true) { if (isset($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']])) $strReturn = stripslashes($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']]); else $strReturn = ''; } else { $strSQLContent = ''; $strSQLContent .= 'SELECT Content FROM scm_footer_texts '; $strSQLContent .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLContent .= "AND CodeText = '" . fctSQLSlashes($strCodeText) . "' "; $rsContent = $objConnMySQLCA->Execute($strSQLContent); if ($rsContent != false) $strReturn = $rsContent->fields['Content']; else $strReturn = ''; } return $strReturn; } ?> 0 '; if($dSelectedMonth == 0 && $dSelectedYear == 0 && $bIsDate == 0) { // 1st visit on the page $bIsFirstVisit = 1; $strAgendaSelect = ''; $dSelectedMonth = intval(date('m')); $dSelectedYear = intval(date('Y')); $strSQLCondition .= 'AND (MONTH(dDateDebut) = ' . $dSelectedMonth . ' OR MONTH(dDate1) = ' . $dSelectedMonth . ' OR MONTH(dDateFin) = ' . $dSelectedMonth . ') '; $strSQLCondition .= 'AND (YEAR(dDateDebut) = ' . $dSelectedYear . ' OR YEAR(dDate1) = ' . $dSelectedYear . ' OR YEAR(dDateFin) = ' . $dSelectedYear . ') '; } else { if($bIsDate == 0) // Si on veut voir un mois ou une année en particulier { if($dSelectedMonth > 0) { $strSQLCondition .= 'AND (MONTH(dDateDebut) = ' . $dSelectedMonth . ' OR MONTH(dDate1) = ' . $dSelectedMonth . ' OR MONTH(dDateFin) = ' . $dSelectedMonth . ') '; $strAgendaSelect .= ' - ' . fctTranslateFullMonth($dSelectedMonth); if($dSelectedYear > 0) $strAgendaSelect .= ' ' . $dSelectedYear; } else if($dSelectedYear > 0) $strAgendaSelect .= ' - ' . $dSelectedYear; if($dSelectedYear > 0) $strSQLCondition .= 'AND (YEAR(dDateDebut) = ' . $dSelectedYear . ' OR YEAR(dDate1) = ' . $dSelectedYear . ' OR YEAR(dDateFin) = ' . $dSelectedYear . ') '; } } $strSQLCondition .= "AND ((dDateDebut IS NULL AND (dDate1 <> '0000-00-00' AND dDate1 >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) OR (dDate1 IS NULL AND (dDateDebut <> '0000-00-00' AND dDateDebut >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) OR (dDateFin <> '0000-00-00' AND dDateFin >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) "; $strSQLCondition .= 'AND act.NonActif = 0 AND cat.NonActif = 0 '; $strSQLCondition .= 'ORDER BY dDateDebut, rel.Ordre, Activite'; $rsAct = $objConnMySQLCA->Execute($strSQL . $strSQLCondition); if (is_object($rsAct)){ if($rsAct->EOF == true && $bIsFirstVisit == 1) $rsAct = fctGoToNextMonth($rsAct, 1); } /*******************************************************************************/ function fctGoToNextMonth($rsAct, $iNbBoucles) { $iNbBoucles ++; global $bIsFirstVisit; global $dSelectedMonth; global $dSelectedYear; global $objConnMySQLCA; global $strSQL; global $rsAct; if($rsAct->EOF == true && $bIsFirstVisit == 1) { if($dSelectedMonth < 12) $dSelectedMonth = $dSelectedMonth + 1; else { $dSelectedMonth = 1; $dSelectedYear = $dSelectedYear + 1; } $strSQLCondition = ''; $strSQLCondition .= 'AND MONTH(dDateDebut) = ' . $dSelectedMonth . ' '; $strSQLCondition .= 'AND YEAR(dDateDebut) = ' . $dSelectedYear . ' '; $strSQLCondition .= "AND ((dDateDebut <> '0000-00-00' && dDateDebut >= DATE_FORMAT(NOW(), '%Y/%m/%d')) OR (dDateFin <> '0000-00-00' && dDateFin >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) "; $strSQLCondition .= 'AND act.NonActif = 0 AND cat.NonActif = 0 '; $strSQLCondition .= 'ORDER BY dDateDebut ASC'; $rsAct = $objConnMySQLCA->Execute($strSQL . $strSQLCondition); if (is_object($rsAct)){ if($rsAct->EOF == true && $bIsFirstVisit == 1 && $iNbBoucles < 13) { fctGoToNextMonth($rsAct, $iNbBoucles); } elseif($dSelectedMonth < 2) $dSelectedYear --; // condition à mettre sinon bug en janvier et recul d'un an dans les filtres (17-01-19) } } return $rsAct; } ?> Execute($strSQLInfo); if ($rsTitlePage->EOF != true) { $strTitlePage = $rsTitlePage->fields['MetaTitle']; $strDescriptionPage = $rsTitlePage->fields['MetaDesc']; if($rsTitlePage->fields['Image'] != '' && CstrCurrentPageName != 'index.php') $strImageBackground = 'url(Images/Background/Pages/' . $rsTitlePage->fields['Image'] . ') no-repeat center fixed'; } else $strTitlePage = CstrTitlePage; ?> <?($strTitlePageComplement != '') ? print $strTitlePageComplement : print $strTitlePage;?>