Project import generated by Copybara.

GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doactiveschedule.php b/src/doactiveschedule.php
new file mode 100644
index 0000000..326dff8
--- /dev/null
+++ b/src/doactiveschedule.php
@@ -0,0 +1,19 @@
+<?php
+require_once("core.php");
+security::checkType(security::ADMIN);
+
+if (!security::checkParams("POST", [
+  ["id", security::PARAM_NEMPTY],
+  ["value", security::PARAM_ISINT]
+])) {
+  security::go("users.php?msg=unexpected");
+}
+
+$id = (int)$_POST["id"];
+$value = (int)$_POST["value"];
+
+if (schedules::switchActive($id, $value)) {
+  security::go("schedule.php?id=".(int)$id."&msg=activeswitched".$value);
+} else {
+  security::go("schedule.php?id=".(int)$id."&msg=unexpected");
+}