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 | ["day", security::PARAM_ISSET], |
| 8 | ["status", security::PARAM_ISSET] |
| 9 | ])) { |
| 10 | security::go("workers.php?msg=empty"); |
| 11 | } |
| 12 | |
| 13 | $id = $_POST["id"]; |
| 14 | $date = new DateTime($_POST["day"]); |
| 15 | $day = $date->getTimestamp(); |
| 16 | $status = $_POST["status"]; |
| 17 | |
| 18 | if (workers::addWorkHistoryItem($id, $day, $status)) security::go("workers.php?openWorkerHistory=".(int)$id); |
| 19 | else security::go("workers.php?msg=unexpected"); |