retour sur la page login if(!$user->is_logged_in()) { header('Location: login.php'); } if(isset($_SESSION['userid'])) { if($_SESSION['userid'] != 1) { header('Location: '.SITEURL); } } //show message from add / edit page if(isset($_GET['deluser'])){ //if user id is 1 ignore if($_GET['deluser'] !='1'){ // On supprime l'avatar du membre $stmt = $db->prepare('SELECT avatar FROM blog_members WHERE memberID = :memberID'); $stmt->execute(array(':memberID' => (int) $_GET['deluser'])); $sup = $stmt->fetch(); $file = $REP_IMAGES_AVATARS.$sup['avatar']; if (!empty($sup['avatar'])) { unlink($file); } // on supprime le membre $stmt = $db->prepare('DELETE FROM blog_members WHERE memberID = :memberID') ; $stmt->execute(array(':memberID' => (int) $_GET['deluser'])); // on supprime les données torrent du membre $stmt1 = $db->prepare('DELETE FROM xbt_users WHERE uid = :uid') ; $stmt1->execute(array(':uid' => (int) $_GET['deluser'])); // on supprime les commentaires du membre //$delname = html($_GET['delname']); //$stmt2 = $db->prepare('DELETE FROM blog_posts_comments WHERE cuser = :cuser') ; //$stmt2->execute(array(':cuser' => $delname)); header('Location: users.php?action=supprime'); exit; } } // titre de la page $pagetitle= 'Admin : gestion des membres'; include_once '../includes/header.php'; ?>
Le membre a été supprimé avec succès.'; } if(isset($_GET['action']) && $_GET['action'] == 'ajoute'){ echo '

Le membre a été ajouté avec succès.

'; } ?> query('SELECT memberID FROM blog_members'); //pass number of records to $pages->set_total($stmt->rowCount()); $stmt = $db->query('SELECT memberID,username,pid,email,memberDate,active FROM blog_members ORDER BY memberID DESC '.$pages->get_limit()); while($row = $stmt->fetch()){ echo ''; echo ''; echo ''; echo ''; echo ''; sscanf($row['memberDate'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde); echo ''; ?> '; if($row['active'] == 'yes') { echo 'oui'; } elseif($row['active'] != 'yes' || $row['active'] == 'no') { echo 'non'; } echo ''; ?> '; } } catch(PDOException $e) { echo $e->getMessage(); } ?>
ID Pseudo PID Email Inscription Validé Action
'.html($row['memberID']).''.html($row['username']).''.html($row['pid']).''.html($row['email']).''.$jour.'-'.$mois.'-'.$annee.' |

page_links(); ?>