This commit refines the cookie consent management system by introducing a new function for handling cookie preferences and updating the UI elements in `inc_footer.php` and `inc_header.php`. It ensures that analytics and marketing scripts are executed based on user consent, improving compliance with privacy regulations. Additionally, it enhances the cookie consent interface, providing users with clearer options for managing their cookie preferences, and updates related functions for better maintainability.
168 lines
6.5 KiB
PHP
168 lines
6.5 KiB
PHP
<?php
|
|
require_once('php/inc_start_time.php');
|
|
require_once('php/inc_fonctions.php');
|
|
require_once('php/inc_fx_messages.php');
|
|
ini_set('display_errors', 1);
|
|
ini_set('display_startup_errors', 1);
|
|
error_reporting(E_ALL);
|
|
global $vPage, $vDomaine;
|
|
$strLangue = 'fr';
|
|
$strCode = "accueil";
|
|
|
|
if (!empty($_GET['lang'])) {
|
|
$strLangue = $_GET['lang'];
|
|
}
|
|
|
|
if (!empty($_GET['code'])) {
|
|
$strCode = $_GET['code'];
|
|
}
|
|
|
|
$vtexte_page = obtenirTextepage($vPage, $strLangue, 2);
|
|
|
|
$strPage = "index.php";
|
|
$strLienFr = "/page/" . $strCode . "/fr";
|
|
$strLienEn = "/page/" . $strCode . "/en";
|
|
|
|
if (isset($_POST['btn_send']))
|
|
fxSendMessage($_POST, $strLangue);
|
|
|
|
$recPage = fxGetPage($strCode); // récupérer les d?tails de la page
|
|
|
|
if (count($recPage) < 1) {
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
|
|
$strMetaTitle = fxRemoveHtml(fxUnescape($recPage['pag_titre_' . $strLangue]));
|
|
$strMetaDescription = fxRemoveHtml(fxUnescape($recPage['pag_description_' . $strLangue]));
|
|
$strMetaKeywords = fxRemoveHtml(fxUnescape($recPage['pag_keywords_' . $strLangue]));
|
|
|
|
require_once("inc_header.php");
|
|
?>
|
|
<div id="page">
|
|
<div id="main">
|
|
<div class="container bg-white p-3 p-xl-5">
|
|
<?php
|
|
if (isset($_SESSION['msg']) && $_SESSION['msg'] != '') {
|
|
echo fxMessage($_SESSION['msg']);
|
|
}
|
|
|
|
if ($strCode == 'accueil') {
|
|
$strListeEvenements = '';
|
|
$arrEvenements = fxGetEvenements('', $strLangue);
|
|
|
|
foreach ($arrEvenements as $array) {
|
|
|
|
if (count($array) > 0) {
|
|
$strListeEvenements .= fxShowListeEvenements($array, $strLangue);
|
|
}
|
|
}
|
|
|
|
echo str_replace('%liste_evenements%', $strListeEvenements, fxUnescape($recPage['pag_texte_' . $strLangue], 1));
|
|
} else {
|
|
?>
|
|
<h1><?php echo fxUnescape($recPage['pag_titre_' . $strLangue], 1); ?></h1>
|
|
<?php
|
|
switch ($strCode) {
|
|
case 'cookie':
|
|
$strCookieContent = trim((string) $recPage['pag_texte_' . $strLangue]);
|
|
echo $strCookieContent !== '' ? fxUnescape($recPage['pag_texte_' . $strLangue], 1) : fxCookiePolicyPageContent($strLangue);
|
|
break;
|
|
|
|
case 'confidentialite':
|
|
$strPrivacyContent = trim((string) $recPage['pag_texte_' . $strLangue]);
|
|
echo $strPrivacyContent !== '' ? fxUnescape($recPage['pag_texte_' . $strLangue], 1) : fxPrivacyPolicyPageContent($strLangue);
|
|
break;
|
|
|
|
case 'evenements':
|
|
$strListeEvenements = '';
|
|
$arrEvenements = fxGetEvenements('', $strLangue);
|
|
|
|
foreach ($arrEvenements as $array) {
|
|
|
|
if (count($array) > 0) {
|
|
$strListeEvenements .= fxShowListeEvenements($array, $strLangue);
|
|
}
|
|
}
|
|
|
|
echo str_replace('%liste_evenements%', $strListeEvenements, fxUnescape($recPage['pag_texte_' . $strLangue], 1));
|
|
break;
|
|
case 'contact_send':
|
|
print_r($_POST);
|
|
exit;
|
|
break;
|
|
case 'contact':
|
|
$arrEvenements = fxGetEvenements('', $strLangue, 1, true);
|
|
$strText = fxUnescape($recPage['pag_texte_' . $strLangue], 1);
|
|
$contact_promoteurs = fxShowListeEvenementsContact($arrEvenements, $strLangue);
|
|
//$strText = str_replace('%evenements%', $strListeEvenements, $strText);
|
|
|
|
?>
|
|
<ul class="nav flex-column ms1-menu-compte">
|
|
|
|
|
|
<li class="nav-item">
|
|
<?php echo afficheTexte('questions_evenement', 0, 1, 1); ?>
|
|
<a data-toggle="collapse" href="#collapsePromoteur" class="nav-list"><i
|
|
class="fa fa-question-circle" aria-hidden="true"></i><?php echo afficheTexte('btn_promoteur', 0, 1, 1); ?></a>
|
|
|
|
</li>
|
|
|
|
<div class="animate__animated animate__fadeIn collapse" id="collapsePromoteur">
|
|
|
|
<li class="nav-item">
|
|
<?php echo $contact_promoteurs; ?>
|
|
</li>
|
|
|
|
|
|
</div>
|
|
<br><br><br>
|
|
<li class="nav-item">
|
|
<?php echo afficheTexte('questions_ms1', 0, 1, 1); ?>
|
|
<a data-toggle="collapse" href="#collapseMs1" class="nav-list"><i
|
|
class="fa fa-question-circle" aria-hidden="true"></i><?php echo afficheTexte('btn_ms1', 0, 1, 1); ?></a>
|
|
|
|
</li>
|
|
<div class="animate__animated animate__fadeIn collapse" id="collapseMs1">
|
|
|
|
<li class="nav-item">
|
|
<?php fxShowFormcontactjira($strLangue); ?>
|
|
</li>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</ul>
|
|
|
|
<script>document.querySelectorAll('.nav-list').forEach(item => {
|
|
item.addEventListener('click', function (e) {
|
|
// Ferme toutes les sections ouvertes
|
|
document.querySelectorAll('.collapse').forEach(collapse => {
|
|
if (collapse !== document.querySelector(this.getAttribute('href'))) {
|
|
collapse.classList.remove('show');
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
|
|
|
|
break;
|
|
case 'contactsend':
|
|
$arrEvenements = fxGetEvenements('', $strLangue, 1, true);
|
|
$strText = fxUnescape($recPage['pag_texte_' . $strLangue], 1);
|
|
$strListeEvenements = fxShowListeEvenementsContact($arrEvenements, $strLangue);
|
|
$strText = str_replace('%evenements%', $strListeEvenements, $strText);
|
|
echo $strText;
|
|
|
|
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
require_once("inc_footer.php"); ?>
|