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