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(); }