<?php

if($_SESSION["type"] != 1){
	echo "No permission to access"; die();
	}

?>
<div class="row">
    <div class="col-lg-12" style="margin-top:-41px;margin-bottom:-13px;">
        <h1 class="page-header" style="font-size:19px; color:#09F;"><i class="fa fa-user fa-fw"></i>&nbsp;Reset Password User</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>

<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default" style="width:100%;">
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                        <thead>
                            <tr>
                                <th style="text-align:center">No</th>
                                <th style="text-align:center">
                                    User Name
                                </th>
                                <th style="text-align:center">
                                    Full Name
                                </th>
                                <th style="text-align:center">
                                    Email
                                </th>
                                <th style="text-align:center">
                                    Register Date
                                </th>
                                <th style="text-align:center">
                                    User Description
                                </th>
                                <th style="text-align:center" width="75">
                                    User Type
                                </th>
                                <th style="text-align:center" width="30">Reset</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
								$user_id=$_SESSION["user_id"];
								mysqli_query($conn,'SET NAMES utf8');
								$sql="select * from tbl_user where user_id !=1 AND user_id = $user_id";
								$res=mysqli_query($conn,$sql);
								$i=0;
								while($row=mysqli_fetch_array($res)){
										
							?> 
                            <tr>
                                <td style="font-size:12px;" align="center"><?php echo $i+=1; ?></td>
                                <td style="font-size:12px;"><?php echo $row['username']; ?></td>
                                <td style="font-size:12px;"><?php echo $row['full_name'];?></td>
                                <td style="font-size:12px;"><?php echo $row['email'];?></td>
                                <td style="font-size:12px;"><?php echo $row['register_date']; ?></td>
                                <td style="font-size:12px;"><?php echo $row['user_description']; ?></td>
                                <td style="font-size:12px; width:100px"><?php if($row['user_type']==1){echo"Admin User";}else{echo"Normal User";}?></td>                             
                                <td align="center"><a href="?page=resetpassworduser&user_id=<?php echo $row['user_id'] ?>" title="Reset Password"><div class="fa fa-user-md fa-fw"></div></a></td>
                               
                            </tr>
                            <?php } ?>
                           
                        </tbody>
                    </table>
                </div>
                <!-- /.table-responsive -->
                
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- /.row -->