Files
ms1inscription-v5/inc_footer.php
stephan 19679875df Implement cookie consent management across various scripts
This commit introduces a comprehensive cookie consent management system by integrating the `fxCookiesAllowMarketing()` function across multiple files. It ensures that marketing-related scripts, such as Facebook Pixel and Google Analytics, are only executed if the user has consented to cookies. Additionally, it enhances the cookie consent UI in `inc_footer.php` and `inc_header.php`, improving user experience and compliance with privacy regulations. The changes also include refactoring of cookie handling functions for better maintainability.
2026-06-27 14:44:44 -04:00

298 lines
12 KiB
PHP

<?php
global $strLangue, $strCode, $vDomaine, $vClient, $strTermesModal, $strTeamBibModal, $strHintModal;
if (!isset($strTeamBibModal)) {
$strTeamBibModal = '';
}
if (!isset($strHintModal)) {
$strHintModal = '';
}
// MSIN-1083
$blnCacherLogo = true;
if (isset($_SERVER['SCRIPT_URL'])) {
if ($strLangue == 'en')
if(stripos($_SERVER['SCRIPT_URL'], '/fees') == false) { // patch MSIN-1018
$blnCacherLogo = false;
}
if($strLangue == 'fr')
if(stripos($_SERVER['SCRIPT_URL'], '/frais') == false) { // patch MSIN-1018
$blnCacherLogo = false;
}
}
// MSIN-1083
if (isset($tabEvenement) && $tabEvenement['general']['eve_commanditaires'] == "1") {
if ($blnCacherLogo == false) { // MSIN-1083
?>
<div id="sponsors">
<div class="box_top"><span></span></div>
<div class="box_repeat">
<?php
// récupérer les images des commanditaires
$tabSponsors = fxGetSponsors($strLangue,$tabEvenement['general']['eve_id']);
if (count((array)$tabSponsors) > 0) {
?>
<ul>
<?php
for ($intCtr = 1; $intCtr <= count($tabSponsors); $intCtr++) {
?>
<li><a href="<?php echo $tabSponsors[$intCtr]['com_url_' . $strLangue]; ?>" <?php echo tcheckevents($tabSponsors[$intCtr]['com_stat_category'],$tabSponsors[$intCtr]['com_stat_action'],$tabSponsors[$intCtr]['com_stat_label']);?> <?php if ($tabSponsors[$intCtr]['com_target'] == 1) { ?>target="_blank"<?php } ?> title="<?php echo $tabSponsors[$intCtr]['com_titre_' . $strLangue]; ?>"><img src="<?php echo $vDomaine; ?>/images/commanditaires/<?php echo $tabSponsors[$intCtr]['com_image_' . $strLangue]; ?>" alt="<?php echo $tabSponsors[$intCtr]['com_titre_' . $strLangue]; ?>"></a></li>
<?php
}
?>
</ul>
<?php
} else {
?>
<br>
<?php
}
?>
<div class="clearer"><span></span></div>
</div>
<div class="box_bottom"><span></span></div>
</div>
<?php
}
}
?>
<footer<?php echo (defined('MS1_INSCR_GESTION_ENTRY') && MS1_INSCR_GESTION_ENTRY) ? ' class="inscr-gestion-entry-footer"' : ''; ?>>
<?php if (!(defined('MS1_INSCR_GESTION_ENTRY') && MS1_INSCR_GESTION_ENTRY)) { ?>
<div class="ms1-footer-top">
<div class="container">
<div class="row py-4">
<div class="col-lg-6 text-center text-lg-left">
<div class="ms1-contact-client text-break">
<?php
if (isset($tabEvenement['general']['eve_contact_footer_' . $strLangue])) {
if (isset($_GET['step']))
$strStep = $_GET['step'];
else
$strStep = '';
if ($strStep != 'resultat') {
if (trim($tabEvenement['general']['eve_contact_footer_' . $strLangue]) != "") {
echo($tabEvenement['general']['eve_contact_footer_' . $strLangue]);
} else {
echo('<br> <br> <br> <br>');
}
} else {
echo('<br> <br> <br> <br>');
}
} else {
echo('<br> <br> <br> <br>');
}
?>
</div>
</div>
<div class="col-lg-6 text-center text-lg-right">
<ul class="list-inline mb-0 text-uppercase">
<?php
$recMenus = fxGetMenus($strLangue);
if (count($recMenus) > 0) {
for ($intCtr = 1; $intCtr <= count($recMenus); $intCtr++) {
if ($intCtr != 1) {
?>
<li class="list-inline-item"><span>|</span></li>
<?php
}
?>
<li class="list-inline-item">
<a<?php if ($strCode == $recMenus[$intCtr]['pag_code']) { ?> class="active"<?php } ?> href="<?php echo $vDomaine; ?>/page/<?php echo $recMenus[$intCtr]['pag_code'] . '/' . $strLangue; ?>">
<?php echo $recMenus[$intCtr]['pag_label_' . $strLangue]; ?>
</a>
</li>
<?php
}
}
?>
</ul>
<div class="social">
<a href="http://www.facebook.com/pages/Ms1timing/387594717971765" target="_blank"><i class="fa fa-facebook-square"></i></a>
<a href="https://twitter.com/ms1timing" target="_blank"><i class="fa fa-twitter-square"></i></a>
<a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?><?php echo (strpos($_SERVER['REQUEST_URI'], '?') === false) ? '?' : '&'; ?>cookies=1" title="<?php echo ($strLangue === 'fr') ? 'Gérer les témoins' : 'Manage cookies'; ?>"><img style="border: none;" width="30" src="<?php echo $vDomaine; ?>/images/cookie.svg" alt="cookies" /></a>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="ms1-footer-bottom">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-4 text-center text-lg-left order-lg-first order-last py-2">
<div>
Copyright &copy; <?php echo $vClient; ?> 2013-<?php echo date('Y'); ?><br>
<?php if ($strLangue == 'fr') {
?>Réalisation<?php
} else {
?>Conception<?php
} ?>:
<a href="http://www.progiweb.ca/" target="_blank">progiweb</a><br>
bdd (v<?php echo fxGetVariable('version') . '.' . fxGetVariable('update'); ?>) - code (v<?php echo _VERSION_CODE. ' ' .PAYPAL_ENV_FOOTER ;?>)
<div class="sr-only">Programmeur Jean-Sébastien Proulx & Stephan Leitn</div>
</div>
</div>
<div class="col-lg-4 text-center py-2">
<div>
<img src="/images/canqueb.png" alt="Logo" style="max-height: 50px;">
</div>
</div>
<div class="col-lg-4 text-center text-lg-right py-2">
<div>
<?php
if ($strLangue == 'fr') {
?>Tous les prix affichés sur ce site sont en dollars canadiens.<?php
} else {
?>All prices on this website are in Canadian dollars.<?php
} ?>
</div>
</div>
</div>
</div>
</div>
</footer>
</div>
</div>
<?php echo $strTermesModal . $strTeamBibModal . $strHintModal; ?>
<div class="scroll-top-wrapper border">
<span class="scroll-top-inner">
<i class="fa fa-chevron-up"></i>
</span>
</div>
<!-- /MSIN-3860 -->
<style>
/* /MSIN-3860 */
.cookie-consent {
display: none; /* Initially hidden */
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #f1f1f1;
padding: 20px;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.cookie-consent-container {
max-width: 1000px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}
.cookie-consent-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
}
.cookie-consent-links {
margin-top: 10px;
text-align: center;
}
#acceptCookies, #rejectCookies {
background: #9dca3a; border-radius: 5px;
color: white;
border: none;
padding: 10px 20px;
cursor: pointer;
font-size: 12px;
}
#rejectCookies {
background: #ed1c24; border-radius: 5px;
}
#acceptCookies:hover {
background-color: #45a049;
}
#rejectCookies:hover {
background-color: #e53935;
}
</style>
<!-- MSIN-3860 -->
<div id="cookieConsent" class="cookie-consent">
<div class="cookie-consent-container">
<p class="mb-2 mb-md-0"><?php echo fxCookieConsentText('experience_cookies', $strLangue); ?></p>
<div class="cookie-consent-actions">
<button type="button" id="acceptCookies"><?php echo fxCookieConsentText('bouton_acceper_cookies', $strLangue); ?></button>
<button type="button" id="rejectCookies"><?php echo fxCookieConsentText('bouton_refuser_cookies', $strLangue); ?></button>
</div>
</div>
<div class="cookie-consent-links">
<a href="<?php echo $vDomaine; ?>/page/cookie/<?php echo $strLangue; ?>"><?php echo fxCookieConsentText('politique_cookie', $strLangue); ?></a>
</div>
</div>
<?php require_once 'inc_footer_scripts.php'; ?>
<script>
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
document.cookie = cname + "=" + cvalue + ";expires=" + d.toUTCString() + ";path=/;SameSite=Lax";
}
function deleteCookie(cname) {
document.cookie = cname + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;SameSite=Lax";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
$(function () {
if (!getCookie('cookiesAccepted') && !getCookie('cookiesRejected')) {
$('#cookieConsent').fadeIn();
}
$('#acceptCookies').on('click', function () {
deleteCookie('cookiesRejected');
setCookie('cookiesAccepted', 'true', 365);
window.location.reload();
});
$('#rejectCookies').on('click', function () {
deleteCookie('cookiesAccepted');
setCookie('cookiesRejected', 'true', 365);
$('#cookieConsent').fadeOut();
});
});
</script>
</body>
</html>