added unarchiving to account types post

This commit is contained in:
o-psi 2023-10-14 23:33:49 -05:00
parent ee7d2e9dba
commit 56a5e903df
1 changed files with 14 additions and 0 deletions

View File

@ -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"]);
}