Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html>
- <head>
- <?php include('includes/head.php') ?>
- <title>1334 NEWS</title>
- </head>
- <body>
- <div id="container">
- <?php
- include 'core/init.php';
- protect_page();
- include('includes/links.php');
- include 'includes/aside.php';
- include 'core/database/connect.php';
- ?>
- <div id="content_L">
- <!--ARTICLE 1-->
- <div class="box">
- <div class="title">
- <?php
- if (has_access($session_user_id, 1) === true) {
- echo 'Administration Center';
- } else {
- echo 'Website Members';
- }
- ?>
- </div><hr>
- <?php
- if (has_access($session_user_id, 1) === true) {
- include('menu.php');
- }
- include_once ('includes/function.php');
- $page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
- $limit = 3;
- $startpoint = ($page * $limit) - $limit;
- ?>
- <table id="admin">
- <tr>
- <th>Username</th>
- <th>Name</th>
- <th>Email</th>
- <?php
- if (has_access($session_user_id, 1) === true) {
- echo '<th>Action</th>';
- }
- ?>
- </tr>
- <?php
- //to make pagination
- $statement = "`users` where `active` = 1";
- //show users
- $query = mysql_query("SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}");
- while ($row = mysql_fetch_assoc($query)) {
- echo "
- <tr>
- <td width='200'>{$row['username']}</td>
- <td width='200'>{$row['first_name']} {$row['last_name']}</td>";
- if (has_access($session_user_id, 1) === true) {
- echo "<td width='210'>{$row['email']}</td>";
- echo "<td><a href='members.php?id={$row['user_id']}'>Delete</a></td>";
- } else {
- echo "<td>{$row['email']}</td>";
- }
- echo '</tr>';
- }
- ?></table>
- <?php
- if($_GET['id'] != ""){
- if (has_access($session_user_id, 1) === false) {
- header('Location: index.php');
- exit();
- }
- $userID = $_GET['id'];
- $sql = "DELETE FROM users WHERE user_id='".$userID."'";
- $query = mysql_query($sql);
- }
- ?>
- <hr><div class="desc">
- <?php
- echo '<div class="underside">';
- include 'includes/widgets/user_count.php';
- echo'</div>';
- echo pagination($statement,$limit,$page);
- ?>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement