Project import generated by Copybara.

GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doaddworkhistoryitem.php b/src/doaddworkhistoryitem.php
new file mode 100644
index 0000000..64df048
--- /dev/null
+++ b/src/doaddworkhistoryitem.php
@@ -0,0 +1,19 @@
+<?php
+require_once("core.php");
+security::checkType(security::ADMIN);
+
+if (!security::checkParams("POST", [
+  ["id", security::PARAM_NEMPTY],
+  ["day", security::PARAM_ISSET],
+  ["status", security::PARAM_ISSET]
+])) {
+  security::go("workers.php?msg=empty");
+}
+
+$id = $_POST["id"];
+$date = new DateTime($_POST["day"]);
+$day = $date->getTimestamp();
+$status = $_POST["status"];
+
+if (workers::addWorkHistoryItem($id, $day, $status)) security::go("workers.php?openWorkerHistory=".(int)$id);
+else security::go("workers.php?msg=unexpected");