<section class="w3l-courses cart-page py-2">
    <div class="blog pb-5" id="courses">
        <div class="container py-lg-5 py-md-4">
            <div class='row mb-2'>
                <div class="col-md-6">
                    <div class="card" style="border: 2px solid #E25A00;">
                        <div class="card-body">
                            <h3 class="text-center" style='color: #E25A00;'>Update Profile</h3>
<?php 
	if(isset($_POST["btn_update"])){
        $user_password = md5($_POST["user_password"]);
        mysqli_query($conn, "UPDATE aalierp_user SET user_name='".$_POST["user_name"]."', user_mobile='".$_POST["user_mobile"]."', user_password='".$user_password."', user_passcode='".$_POST["user_password"]."' WHERE user_id='".$_POST["user_id"]."'"); 
		echo "<script>window.location.href = '../';</script>";
    }
?>
                            <form method="POST">
                              <input type="hidden" name="user_id" value="<?php echo $_SESSION["user_id"]; ?>" />
                              <div class="twice">
                                <input type="text" class="form-control" name="user_name" value="<?php echo $_SESSION["user_name"]; ?>" required="">
                              </div>
                              <div class="twice">
                                <input type="text" class="form-control" name="user_mobile" value="<?php echo $_SESSION["user_mobile"]; ?>" required="">
                              </div>
                              <div class="twice">
                                <input type="text" class="form-control" name="user_password" placeholder="New Password" required="">
                              </div>
                              <div class="text-right">
                                <button type="submit" name="btn_update" class="btn btn-primary btn-style mt-4">Update Profile</button>
                              </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="card" style="border: 2px solid #E25A00;">
                        <div class="card-body">
                            <h5 class="text-center" style='color: #E25A00;'>
                                <?php echo "<b>".$_SESSION["user_name"]."</b>"; ?> (<?php echo $_SESSION["user_type"]; ?>)
                            </h5>
                            <h6 class="text-center"><?php echo $_SESSION["user_mobile"]; ?></h6>
                            <h6 class="text-center "><?php echo $_SESSION["user_email"]; ?></h6>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</section>