blob: 91296588aca9f2f667008a7e57a2ea835bec8ec0 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::ADMIN);
4
5if (!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
17if (companies::edit($id, $name, $cif)) {
18 security::go("companies.php?msg=modified");
19} else {
20 security::go("companies.php?msg=unexpected");
21}