blob: 976589815cc9ab891c376540d6eb74a949aee613 [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 ["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
15if (companies::add($name, $cif)) {
16 security::go("companies.php?msg=added");
17} else {
18 security::go("companies.php?msg=unexpected");
19}