query($sql); } if(isset($_GET['loading'])) { //Inclusion du template include('inc/loading.html'); //Fermeture de la page exit(); } //On vérifie si l'utilisateur recherche uniquement les nouveautées if(isset($_GET['rapide'])) { //On recherche les notifications $sql = "SELECT * FROM `notification` WHERE `ID_personne` = ? AND `vu` = 0 ORDER BY `ID` LIMIT 1"; $requete = $bdd->prepare($sql); $requete->execute(array($_SESSION['ID'])); ob_start(); if($notification = $requete->fetch()) { //Arrêt de la sécurité des erreurs! ob_end_clean(); //On met la notification en vu $sql = "UPDATE notification SET vu = 1 WHERE ID = ".$notification['ID']; $update = $bdd->query($sql); //We search the informations about the personn $info = cherchenomprenom($notification['ID_createur'], $bdd); //We show the notification echo corrige_caracteres_speciaux($info['prenom']." ".$info['nom']." ".$notification['message'])."\n"; } else { ob_end_clean(); } //Fermeture du curseur $requete->closeCursor(); //On quitte le script courant exit(); } //Searching the last notifications $notifications = searchnotification($_SESSION['ID'], $bdd, 10, 0, '0'); if(count($notifications) == 0) { echo "