getClub(89); $megaManager = new MegaManager($bdd, $club); $aboManager = $megaManager->aboManager(); $userManager = $megaManager->userManager(); $reservationManager = $megaManager->reservationManager(); $eventManager = $megaManager->eventManager(); if(isset($_COOKIE["LIEU_CIUP"]) || isset($_GET['apiKey']) && $_GET['apiKey'] === '8e681cb9-e903-4c5d-9604-85131c82788a'){ //on doit avoir un sub ou un idUser sinon on redirige l utilisateur vers son origine if(isset($_GET["sub"])){ $sub = $_GET["sub"]; $membre = $userManager->readBySub($sub); //on charge toutes les infos*/ if(!is_null($membre)) $id_user = $membre->id(); }else if(isset($_GET["id_user"])){ $id_user = $_GET["id_user"]; $membre = $userManager->read($id_user); //on charge toutes les infos*/ }else{ header("Location: https://{$_SERVER['HTTP_HOST']}"); die; } if(!is_null($membre)) { $abosReturn = $aboManager->getAllAbonnement($forAdmin = true); //on charge toutes les infos*/ $allAbos = $abosReturn; $userEvents = $eventManager->getAllSessionByMemberId($id_user); $abosPlayer = $aboManager->getAbos($membre->id()); //on charge toutes les infos*/ $start = ""; $end = ""; $messageScan = ""; $allActif = false; $aboOffreSportive = array_filter($abosReturn, function($element) { return $element['OFFRE_SPORTIVE'] === 1; }); $aboCompatible = array_column($aboOffreSportive, 'ID');//liste des abos compatibles pour afficher l'abo actiSport Libre en vert ciup (si on a un abo max on rend vert l'abo mini) foreach($abosPlayer as $aboPlayer){ $listAbo[] = $aboPlayer['ID_ABO']; $infoAbo[$aboPlayer['ID_ABO']] = array( "DATE_FIN" => $aboPlayer['DATE_FIN'], "OPTIONS" => $aboPlayer['OPTIONS'], ); if(in_array($aboPlayer['ID_ABO'], $aboCompatible)){ $allActif = true; } } if(isset($_COOKIE["LIEU_CIUP"])) { $cookies = json_decode($_COOKIE["LIEU_CIUP"]); $installIds = explode("-",$cookies->idIn); foreach($installIds as $installId) { $allSessions[] = $eventManager->getNextSession20Minutes($installId); // pour chaque install on va regarder si il y a une session qui comprend cette install et qui commence dans les 20 minutes } $idSession = false; $scanInfos = array(); if(!empty($allSessions)) { foreach($allSessions as $session) { if(!empty($session)) { $participantsSession = $eventManager->getParticipants($session['id']); // on vérifie si il y a des participants $countParticipants = count($participantsSession); // on compte le nombre de participants $aboList = explode("|", $session['listAbo']); // on met la liste d'abos dans un tableau $hasAbo = ((!empty($aboList) && !empty($listAbo) && !empty(array_intersect($aboList,$listAbo))) || $allActif == true) ? true: false ; // si l'user a un des abo requis vrai sinon faux //check si inscrite session encadrée - partie suivante commentée sur demande de la ciup $sessionDetails = $eventManager->getSession($session['id']); /* $listIdParticipants = array_column($participantsSession, 'ID'); $inEncadree = in_array($id_user, $listIdParticipants); //si encadré on s'arrête là, on associe cette session à l'utilisateur if($inEncadree) { $idSession = $session['id']; $idSport = $sessionDetails['ID_SPORT']; break; }*/ /*if($session['inscriptionMax'] === 0 || is_null($session['inscriptionMax'])) {*/ if(is_null($sessionDetails['HIDE_PLANNING'])) { //si c'est un sport où on peut réserver, on va vérifier si le joueur n'a pas une résa $resa = $reservationManager->getAllFuturResas($id_user, false, 1); if(!empty($resa)) { $dateNow = new \DateTime(); $dateResa = new \DateTime($resa['creneauDebutSql']); if(($dateResa >= $dateNow && $dateResa <= $dateNow->add(new \DateInterval('PT20M'))) || ($dateNow >= $dateResa && $dateNow <= new \DateTime($resa['creneauFinSql']))) { $idSession = false; break; } } } $idSession = $session['id']; $idSport = $sessionDetails['ID_SPORT']; /* }*/ } } if($idSession) { //si on a une session à venir on ajoute le scan $scanInfos = array( // on met toutes les infos dans un tableau "idMembre" => $id_user, "idSession" => $idSession, "idSport" => $idSport, ); } if(!isset($_GET['apiKey']) && $hasAbo == true && !empty($scanInfos)) { // si l'user a le bon abo et qu'il y a des infos à envoyer, on enregistre le scan $messageScan = $userManager->addScan($scanInfos); $badge = $messageScan['status'] == 'ok' ? "badge badge-success" : "badge badge-warning"; } } ?> Profil
Profil
image

prenom(). ' ' . $membre->nom(); ?>

email(); ?>

tel1(); ?>

lieu; ?>

abonnement actif
"; $aboActif = true; } else { echo "
abonnement non-actif
"; } ?>

Expire le :

OPTION(S) SOUSCRITE(S) :"; }else{ $i = 1; } echo "- $opt
"; } } } ?>

Événements

-

de à

Profil
Accès QR Code
alt

Oups !

Merci de scanner le QR code de l'installation pour débloquer l'accés à ce QR Code.