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 | ["name", security::PARAM_NEMPTY], | ||||
7 | ["cif", security::PARAM_ISSET] | ||||
8 | ])) { | ||||
9 | security::go("companies.php?msg=empty"); | ||||
10 | } | ||||
11 | |||||
12 | $name = $_POST["name"]; | ||||
13 | $cif = $_POST["cif"]; | ||||
14 | |||||
15 | if (companies::add($name, $cif)) { | ||||
16 | security::go("companies.php?msg=added"); | ||||
17 | } else { | ||||
18 | security::go("companies.php?msg=unexpected"); | ||||
19 | } |