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.
 
 
 
 
 

27 righe
1.1 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 100) {
if (isset($_GET["query"])) {
$text = $_GET["query"];
$bind = [":codice_fiscale"=>$_GET["query"]."%"];
$strsql = "SELECT * FROM b_incaricati WHERE codice_fiscale LIKE :codice_fiscale ORDER BY codice DESC ";
$risultato = $pdo->go($strsql,$bind);
$rec = array();
$found = [];
if ($risultato->rowCount()>0) {
while ($record = $risultato->fetch(PDO::FETCH_ASSOC)) {
if (in_array($record["codice_fiscale"],$found) === false) {
$extraInfo = json_decode(simple_decrypt($record["extraInfo"],"incaricatiAAAAAA"),true);
unset($record["extraInfo"]);
$record = $record + $extraInfo;
$label = array("value"=>$record["codice_fiscale"],"label"=>$record["codice_fiscale"] . " - " . $record["cognome"] . " " . $record["nome"]);
$rec[] = $record + $label;
$found[] = $record["codice_fiscale"];
}
}
}
echo json_encode($rec);
}
}
?>