From 5fd9fa480f302902328b81f912dd67ce378284f8 Mon Sep 17 00:00:00 2001 From: citizenz7 Date: Thu, 20 Apr 2017 18:50:55 +0200 Subject: V.1.4.6 --- Html/admin/users.php | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 Html/admin/users.php (limited to 'Html/admin/users.php') diff --git a/Html/admin/users.php b/Html/admin/users.php new file mode 100644 index 0000000..9e12cd9 --- /dev/null +++ b/Html/admin/users.php @@ -0,0 +1,170 @@ + 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(); + } + ?> +
IDPseudoPIDEmailInscriptionValidéAction
'.html($row['memberID']).''.html($row['username']).''.html($row['pid']).''.html($row['email']).''.$jour.'-'.$mois.'-'.$annee.' + + + + | + + +
+ +
+ + page_links(); + ?> + +

+ +

+
+ + + +
+
+
+ + + + + -- cgit v1.2.1