diff --git a/edit_account_modal.php b/edit_account_modal.php new file mode 100644 index 00000000..5201ec34 --- /dev/null +++ b/edit_account_modal.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/post.php b/post.php index b7cc4a0a..697fcdee 100644 --- a/post.php +++ b/post.php @@ -134,6 +134,19 @@ if(isset($_POST['add_account'])){ } +if(isset($_POST['edit_account'])){ + + $account_id = intval($_POST['account_id']); + $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); + + mysqli_query($mysqli,"UPDATE accounts SET account_name = '$name' WHERE account_id = $account_id"); + + $_SESSION['alert_message'] = "Account modified"; + + header("Location: accounts.php"); + +} + if(isset($_POST['add_category'])){ $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));