From 56a5e903df5f6b64118eeb1afa4ae046cd7c9d8b Mon Sep 17 00:00:00 2001 From: o-psi Date: Sat, 14 Oct 2023 23:33:49 -0500 Subject: [PATCH] added unarchiving to account types post --- post/account_type.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/post/account_type.php b/post/account_type.php index 42a02106..7c3fb256 100644 --- a/post/account_type.php +++ b/post/account_type.php @@ -86,3 +86,17 @@ if (isset($_GET['archive_account_type'])) { header("Location: " . $_SERVER["HTTP_REFERER"]); } + +if (isset($_GET['unarchive_account_type'])) { + $account_type_id = intval($_GET['unarchive_account_type']); + + mysqli_query($mysqli,"UPDATE account_types SET account_type_archived_at = NULL WHERE account_type_id = $account_type_id"); + + //logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Account Type', log_action = 'Unarchive', log_description = '$account_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent'"); + + $_SESSION['alert_message'] = "Account Unarchived"; + + header("Location: " . $_SERVER["HTTP_REFERER"]); + +} \ No newline at end of file