Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //We are asking the database for a list of all the users and give ALL the results
- $users = $db->query("SELECT * FROM users")->results();
- ?>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Username</th><th>Joined On</th><th>Group(s)</th>
- </tr>
- </thead>
- <tbody>
- <?php
- //loop through all the users and make one row for each user
- foreach($users as $u){ ?>
- <tr>
- <td><?=$u->username;?></td>
- <td><?=$u->join_date?></td>
- <td>
- <?php
- //Look through the permissions for this user
- $perms = $db->query("SELECT * FROM user_permission_matches WHERE user_id = ? ",array($u->id))->results();
- foreach($perms as $p){
- $permission = $db->query("SELECT name from permissions WHERE id = ?",array($p->permission_id))->first();
- echo $permission->name .",";
- }
- ?>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement