Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::ADMIN); |
| 4 | |
| 5 | if (!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 | |
| 15 | if ($day === false) { |
| 16 | security::go("users.php?msg=unexpected"); |
| 17 | } |
| 18 | |
| 19 | if (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 | } |