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.
35 righe
1.2 KiB
35 righe
1.2 KiB
<? |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && !empty($_GET["tokenEsportazione"])) { |
|
session_write_close(); |
|
if (!empty($_SESSION["exportoperatori"][$_GET["tokenEsportazione"]])) { |
|
$alloperatori = array_column($_SESSION["exportoperatori"][$_GET["tokenEsportazione"]], "codice"); |
|
} else if ($_SESSION["exportoperatoriRelazioni"][$_GET["tokenEsportazione"]]) { |
|
$alloperatori = array_column(json_decode(gzuncompress($_SESSION["exportoperatoriRelazioni"][$_GET["tokenEsportazione"]]),true),"codice_operatore"); |
|
} |
|
if (!empty($alloperatori)) { |
|
if (count($alloperatori) > 10000) { |
|
ini_set("max_execution_time", "600"); |
|
} |
|
$data = oeManager::exportCSV($alloperatori, !empty($_GET["extended"])); |
|
|
|
if (!empty($data)) { |
|
$error = false; |
|
|
|
header("Content-type: text/csv"); |
|
header("Content-Disposition: attachment; filename=export.csv"); |
|
header("Pragma: no-cache"); |
|
header("Expires: 0"); |
|
foreach ($data as $fornitore) { |
|
echo "\"" . implode("\";\"", $fornitore) . "\"" . PHP_EOL; |
|
} |
|
} |
|
} |
|
} |
|
|
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
}
|
|
|