<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>
<?php
if($_SESSION["type"] != 1){
	echo "No permission to access"; die();
	}

 ?>
<?php

		$user_id=$_GET['user_id'];
			
	if (isset($_POST['btupdate'])) {
		$password  = md5($_POST['password']);
		
		mysqli_query($conn,"SET NAMES utf8");
		mysqli_query($conn,"update tbl_user set password='$password' where user_id=$user_id") or die(mysql_error());
		
		//header('location:?page=user');
		?>
		<script type="text/javascript">
            window.location.href="?page=normaluser";
        </script>
        <?php	
	}
?> 

<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default" style="width:100%;">
            <div class="panel-body">
                <div class="row">
                    
                    	<?php
							$sql="select * from tbl_user where user_id=$user_id";
							mysqli_query($conn,'SET NAMES utf8');
							$query=mysqli_query($conn,$sql);
							while($row=mysqli_fetch_array($query)){
						  ?>
                    <form method="post" enctype="multipart/form-data">
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label style="color:#3a3a3a;">Full Name</label>
                                <input class="form-control" placeholder="Full Name" name="fullname" value="<?php echo $row['full_name'];?>" required readonly />
                            </div>
                            <div class="form-group">
                                <label style="color:#3a3a3a;">User Name</label>
                                <input class="form-control" placeholder="User Name" name="username" value="<?php echo $row['username'];?>" required readonly/>
                            </div>
                            <div class="form-group">
                                <label style="color:#3a3a3a;"v>Email</label>
                                <input type="email" class="form-control" placeholder="Email" name="email" value="<?php echo $row['email'];?>" readonly/>
                            </div>
                            <div class="form-group">
                                <label style="color:#3a3a3a;">Password</label>
                                <input  type="password" class="form-control" placeholder="Password" name="password" required/>
                            </div>
                            <div class="form-group" style="margin-top:20px;">
                                <label></label>
                                <input type="submit" name="btupdate" class="btn btn-success" value="&nbsp;Update&nbsp;" title="Update" style="margin-bottom:20px; margin-left:0px; width:100px;"/>
                                &nbsp;
                                <a href="?page=normaluser">
                                <input type="button" name="btsave" class="btn btn-primary" value="&nbsp;Back&nbsp;" title="Back" style="margin-bottom:20px; margin-left:0px; width:100px;"/>
                                </a>
                            </div>
                        </div>
                    </form>                        
                         <?php } ?>
                </div>
            </div>
       </div>
   	</div>
</div>

