<?php
if(isset($_POST['updatebtn']))
{
    $id = $_POST['id'];
    $account = $_POST['account'];
    $password = $_POST['new_password'];
    $email = $_POST['email'];

    require 'functions/connect.php';
    $query = "UPDATE customers SET Email='$email', AccFullname='$account', Password='$password' WHERE id='$id' ";
    $query_run = mysqli_query($con, $query);

    if($query_run)
    {
        $_SESSION['status'] = "Your Data is Updated";
        $_SESSION['status_code'] = "success";
        echo '<script>alert("Successfully, Changed!")</script>';
        echo "<script>window.location.replace('index.php');</script>";
    }
    else
    {
        $_SESSION['status'] = "Your Data is NOT Updated";
        $_SESSION['status_code'] = "error";
        echo '<script>alert("An error occurred!")</script>';
    }
}
    
    
?>
    