LBCAlerte_ynh/sources/app/mail/scripts/toggle_status.php
Jimmy Monin 58ffd500e6 Upgrade LBCAlerte to version 3.3
Add upgrade script
2016-11-26 19:25:53 +01:00

26 lines
623 B
PHP

<?php
if (isset($_GET["id"]) && $alert = $storage->fetchById($_GET["id"])) {
$status = isset($_GET["s"]) ? $_GET["s"] : "";
$update = false;
if ($status == "suspend") {
$alert->$status = !$alert->$status;
$update = true;
} else {
foreach ($data_notifications AS $name => $notification) {
if ($status == $notification["form_name"]) {
$alert->$status = !$alert->$status;
$update = true;
break;
}
}
}
if ($update) {
$storage->save($alert);
}
}
header("LOCATION: ./?mod=mail");
exit;