<html>  
<head lang="en">  
    <meta charset="">  
    <link type="text/css" rel="stylesheet" href="bootstrap-3.2.0-dist\css\bootstrap.css"> <!--css file link in bootstrap folder-->  
    <title>View Users</title>  
</head>  
<style>  
    .login-panel {  
        margin-top: 150px;  
    }  
    .table {  
        margin-top: 50px;  
     }  
</style>  
  
<body>  
  
<div class="table-scrol">  
    <h1 align="center">All the Users</h1>  
  
<div class="table-responsive"><!--this is used for responsive display in mobile and other devices-->  
    <table class="table table-bordered table-hover table-striped" style="table-layout: fixed">  
        <thead>  
  
        <tr>  
  
            <th>User Id</th>  
            <th>User Name</th>  
            <th>User pass</th>  
            <th>User E-mail</th>  
            <th>groub User</th>  
        </tr>  
        </thead>  

  
  
        <?php  
session_start();
  
if(!$_SESSION['email'])  
{  
  
    header("Location: login.php");
//redirect to the login page to secure the welcome page without login access.  
}  

        include("database/db_conection.php");  
        $view_users_query="select * from users where user_email='$_SESSION[email]' ";
//select query for viewing users.  
        $run=mysqli_query($dbcon,$view_users_query);
//here run the sql query.  
  
        while($row=mysqli_fetch_array($run))
//while look to fetch the result and store in a array $row.  
        {  
            $user_id=$row[0];  
            $user_name=$row[1];  
            $user_email=$row[2];  
            $user_pass=$row[3];
$groub_id=$row[4];
 $hash=$row[5];
 $hashh=$row[6];
        ?>  
  
        <tr>  
<!--here showing results in the table -->  
            <td><?php echo $user_id;  ?></td>  
            <td><?php echo $user_name;  ?></td>  
            <td><?php echo $user_email;  ?></td>  
            <td><?php echo $user_pass;  ?></td> 
 <td><?php echo $groub_id;  ?></td> 

 <td><?php echo $hashhh;  ?></td> 
            <td><a href="delete.php?del=<?php echo $user_id ?>"><button class="btn btn-danger">Delete</button></a></td> <!--btn btn-danger is a bootstrap button to show danger-->  
        </tr>  
  
        <?php } ?>  
  
    </table>  
        </div>  
</div>  
</body>  
  
</html>  
