blob: 358a8d77ceafef9b94167709767371736b620582 [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$s = schedules::get($id);
14
15if ($s === false) {
16 security::go("users.php?msg=unexpected");
17}
18
19$w = workers::get($s["worker"]);
20
21if ($w === false) {
22 security::go("users.php?msg=unexpected");
23}
24
25if (schedules::remove($id)) {
26 security::go("userschedule.php?id=".(int)$w["person"]."&msg=deleted");
27} else {
28 security::go("userschedule.php?id=".(int)$w["person"]."&msg=unexpected");
29}