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.
 
 
 
 
 

33 righe
1.2 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (isset($_SESSION["utente"]) && isset($_GET["modulo"]) && isset($_GET["codice_elemento"]) && $_SESSION["utente"]->permission($_GET["modulo"],$_GET["codice_elemento"])) {
$manager = new registriManager($_GET["modulo"],$_GET["codice_elemento"]);
$risultati = $manager->getLog();
if (!empty($risultati)) {
$error = false;
$data = [["operazione","descrizione","utente","data e ora"]];
foreach($risultati AS $record) {
$utente = Utente::getInfoFromID($record["utente_modifica"]);
$row = array();
$row[] = strtoupper($record["operazione"]);
$row[] = strip_tags($record["oggetto"]);
$row[] = $utente["cognome"] . " " . $utente["nome"];
$row[] = $record["timestamp"];
$data[] = $row;
}
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=export.csv");
header("Pragma: no-cache");
header("Expires: 0");
foreach($data AS $log) {
echo "\"" . implode("\";\"",$log) . "\"".PHP_EOL;
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>