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.
50 righe
2.6 KiB
50 righe
2.6 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "open"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && !empty($_GET["codice"])) { |
|
$response = $pdo->go("SELECT b_gare_round.codice_gara AS codice_gara, b_gare_round.codice AS codice_round, r_partecipanti_gare.codice AS codice_partecipante, b_gare_form_data.content |
|
FROM b_gare_form_data |
|
JOIN b_offerte_gare ON b_gare_form_data.codice_offerta = b_offerte_gare.codice |
|
JOIN r_partecipanti_gare ON b_offerte_gare.codice_partecipante = r_partecipanti_gare.codice |
|
JOIN b_gare_round ON r_partecipanti_gare.codice_round = b_gare_round.codice |
|
WHERE b_gare_form_data.codice = :codice AND b_gare_form_data.soft_delete = 'N' AND r_partecipanti_gare.conferma = 'S' ", |
|
[":codice"=>$_GET["codice"]])->fetch(PDO::FETCH_ASSOC); |
|
if (!empty($response) && !empty($response["content"])) { |
|
$valutatore = NULL; |
|
if (!empty($_GET["valutatore"])) { $valutatore = true; } |
|
$gara = gara::init($response["codice_gara"],$response["codice_round"],$valutatore); |
|
if (!empty($gara)) { |
|
if ($_SESSION["utente"]->permission("commissione") || $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"],$gara->info["codice"],$id_modulo)) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if (!$lock) { |
|
$content = json_decode($response["content"],true); |
|
if (!empty($content)) { |
|
$content["content"] = simple_decrypt($content["content"],$config["simple_encrypt"]["offer"]); |
|
if (!empty($content["content"])) { |
|
$error = false; |
|
header('Content-Description: File Transfer'); |
|
header('Content-Disposition: attachment; filename=' . str_replace("-",".",$content["filename"])); |
|
header('Content-Type: ' . $content["mime"]); |
|
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: ' . $content["size"]); |
|
echo $content["content"]; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |