Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/dodeleteday.php b/src/dodeleteday.php
new file mode 100644
index 0000000..4328a42
--- /dev/null
+++ b/src/dodeleteday.php
@@ -0,0 +1,23 @@
+<?php
+require_once("core.php");
+security::checkType(security::ADMIN);
+
+if (!security::checkParams("POST", [
+ ["id", security::PARAM_NEMPTY]
+])) {
+ security::go("users.php?msg=unexpected");
+}
+
+$id = (int)$_POST["id"];
+
+$day = schedules::getDay($id);
+
+if ($day === false) {
+ security::go("users.php?msg=unexpected");
+}
+
+if (schedules::removeDay($id)) {
+ security::go("schedule.php?id=".(int)$day["schedule"]."&msg=deleted");
+} else {
+ security::go("schedule.php?id=".(int)$day["schedule"]."&msg=unexpected");
+}