gestione gare pubbliche
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

36 righe
952 B

<?
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php";
include_once($configPath);
$codice = $_GET["codice"] ?? null;
$cf = $_GET["cf"] ?? null;
if($cf == null || strlen($cf) < 11 || strlen($cf) > 16 ) {
die(json_encode(["results" => []]));
}
$npa = NuovaPiattaformaAppalti::initStatic();
if (!empty($npa)) {
if ($_SESSION["utente"]->permission("npa")) {
$centriCosto = $npa->getCodiciCentriDiCosto($cf);
$ret = [];
foreach($centriCosto as $id => $centro) {
$centro = ["id" =>$id, "text" => $centro];
$ret[] = $centro;
}
die(json_encode(["results" => $ret]));
}
} else if (!empty($_SESSION["utente"]) && !empty($codice) && !empty($cf)) {
$centriCosto = NuovaPiattaformaAppalti::getCodiciCentriDiCostoFromDB($cf);
$ret = [];
foreach($centriCosto as $id => $centro) {
$centro = ["id" =>$id, "text" => $centro];
$ret[] = $centro;
}
die(json_encode(["results" => $ret]));
}
HTTPStatus(500);