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.
37 righe
1.2 KiB
37 righe
1.2 KiB
<?php |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
|
|
include_once($configPath); |
|
if (!isset($_GET["versione"])) { |
|
$path = $root."/norme-tecniche/latest-{$_SESSION["language"]}.pdf"; |
|
} else { |
|
$dir = $root."/norme-tecniche/storico/"; |
|
if (file_exists($dir) && $handle = opendir($dir)) { |
|
while (false !== ($file = readdir($handle))) { |
|
if (is_file($dir.$file)) |
|
{ |
|
$file = explode("-",$file); |
|
if (isset($file[0]) && $file[0] == $_GET["versione"]) { |
|
$path = "{$dir}{$file[0]}-{$_SESSION["language"]}.pdf"; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (!file_exists($path)) { |
|
$path = str_replace("-{$_SESSION["language"]}.pdf","-IT.pdf",$path); |
|
} |
|
if (file_exists($path)) { |
|
header('Content-Description: File Transfer'); |
|
header('Content-Disposition: inline; filename=' . __("Norme Tecniche") . ".pdf"); |
|
header('Content-Type: application/pdf'); |
|
header('Content-Transfer-Encoding: binary'); |
|
header('Connection: Keep-Alive'); |
|
header('Expires: 0'); |
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
header('Pragma: public'); |
|
header('Content-Length: ' . filesize($path)); |
|
readfile($path); |
|
} |
|
?>
|
|
|