setLotto($_POST["codice_lotto"])) { $partecipante = $gara->miaPartecipazione(); if (!empty($partecipante)) { $sql = "SELECT codice FROM b_offerte_gare WHERE tipo = 'asta' AND codice = :codice AND codice_partecipante = :codice_partecipante "; $ris = $pdo->go($sql,array(":codice_partecipante"=>$partecipante["codice"],":codice"=>$_POST["codice"])); if ($ris->rowCount()>0) { $offer = $ris->fetch(PDO::FETCH_ASSOC); $sql = "SELECT * FROM b_offerte_gare WHERE codice = :codice "; $ris = $pdo->go($sql,array(":codice"=>$offer["codice"])); $offer = $ris->fetch(PDO::FETCH_ASSOC); if (!empty($offer["content"])) { $content = base64_decode($offer["content"]); } } } } } if ($content !== false) { if (!isset($unitTestExecution)) { header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename='.str_replace(" ","-",__("Offerta") . " {$offer["codice"]}").'.pdf'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $content; } else { file_put_contents($pathFileOfferta,$content); } } else { header('HTTP/1.0 403 Forbidden'); echo __("Errore nella richiesta"); die(); } } ?>