blob: 4328a424c18488e13a8aa9c6a2f24240297543d4 [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("users.php?msg=unexpected");
9}
10
11$id = (int)$_POST["id"];
12
13$day = schedules::getDay($id);
14
15if ($day === false) {
16 security::go("users.php?msg=unexpected");
17}
18
19if (schedules::removeDay($id)) {
20 security::go("schedule.php?id=".(int)$day["schedule"]."&msg=deleted");
21} else {
22 security::go("schedule.php?id=".(int)$day["schedule"]."&msg=unexpected");
23}