blob: b4a19e46b9559402359c8ce180d660ffa647d624 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::ADMIN);
4
5if (!security::checkParams("POST", [
6 ["id", security::PARAM_NEMPTY]
7])) {
8 security::go("scheduletemplates.php?msg=unexpected");
9}
10
11$id = (int)$_POST["id"];
12
13$day = schedules::getTemplateDay($id);
14
15if ($day === false) {
16 security::go("scheduletemplates.php?msg=unexpected");
17}
18
19if (schedules::removeTemplateDay($id)) {
20 security::go("scheduletemplate.php?id=".(int)$day["template"]."&msg=deleted");
21} else {
22 security::go("scheduletemplate.php?id=".(int)$day["template"]."&msg=unexpected");
23}