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