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