<?php include(__DIR__."/../layout/top.php"); ?>
    <div class="row">
        <div class="col-md-12">
            <h3>Users</h3>
           <table class="table">
               <tr>
                   <th>#</th>
                   <th>Username</th>
                   <th>Status</th>
                   <th>Primary Mail</th>
                   <th>Flags</th>
                   <th>Actions</th>
               </tr>
               <?php
               foreach($users as $user) {
                   ?>
                   <tr>
                       <td><?php echo $user->id; ?></td>
                       <td><?php echo $user->username; ?></td>
                       <td><?php echo $user->status; ?></td>
                       <td><?php echo $user->getMail(); ?></td>
                       <td>
                           <?php
                           if($user->developer) {
                               echo '<i class="fas fa-laptop-code"></i>';
                           }

                           if($user->admin) {
                               echo '<i class="fas fa-user-shield"></i>';
                           }


                           ?>

                       </td>
                       <td><a href="/gui/admin/users/<?php echo $user->id; ?>" class="btn btn-warning btn-sm">Edit</a> </td>
                   </tr>
                   <?php
               }
               ?>
           </table>

            <br>
            Flags:<br>
            <i class="fas fa-user-shield"></i> = Admin<br>
            <i class="fas fa-laptop-code"></i> = Developer
        </div>
    </div>
<?php include(__DIR__."/../layout/bottom.php"); ?>