Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doaddcompany.php b/src/doaddcompany.php
new file mode 100644
index 0000000..9765898
--- /dev/null
+++ b/src/doaddcompany.php
@@ -0,0 +1,19 @@
+<?php
+require_once("core.php");
+security::checkType(security::ADMIN);
+
+if (!security::checkParams("POST", [
+ ["name", security::PARAM_NEMPTY],
+ ["cif", security::PARAM_ISSET]
+])) {
+ security::go("companies.php?msg=empty");
+}
+
+$name = $_POST["name"];
+$cif = $_POST["cif"];
+
+if (companies::add($name, $cif)) {
+ security::go("companies.php?msg=added");
+} else {
+ security::go("companies.php?msg=unexpected");
+}