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.
39 righe
1.4 KiB
39 righe
1.4 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission("albo.consip") && (!empty($_GET["cpv"]))) { |
|
|
|
$ch = curl_init(); |
|
$query = http_build_query([ |
|
'resource_id' => $_GET["idSorgente"], |
|
'q' => json_encode(array('Codice_CPV' => $_GET["cpv"])), |
|
'limit' => 999999999 |
|
]); |
|
|
|
$url = "https://dati.consip.it/api/action/datastore_search?" . $query; |
|
|
|
curl_setopt($ch, CURLOPT_URL, $url); |
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
curl_setopt($ch, CURLOPT_HEADER, 0); |
|
$result = curl_exec($ch); |
|
if(!curl_errno($ch)) { |
|
$result = json_decode($result,true); |
|
if (!empty($result["result"]["records"])) { |
|
?> |
|
<table class="table table-striped table-hover"> |
|
<? foreach($result["result"]["records"] AS $fornitore) { ?> |
|
<tr> |
|
<td><a href='#' onClick='showModalWithURL("/backend/albo/consip/fornitore.php?partita_iva=<?= $fornitore["Partita_IVA"] ?>")'><?= str_pad($fornitore["Partita_IVA"],11,"0",STR_PAD_LEFT) ?></a></td> |
|
<td><?= $fornitore["Denominazione_Fornitore"]; ?></td> |
|
<td><?= $fornitore["Prodotto"]; ?></td> |
|
</tr> |
|
<? } ?> |
|
</table> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
} |
|
curl_close($ch); |
|
} |
|
?>
|
|
|