gestione gare pubbliche
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.
 
 
 
 
 

45 righe
1.8 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$content = false;
if (empty($_POST["codice_gara"]) && !empty($_GET["codice_gara"])) $_POST = $_GET;
if (!empty($_SESSION["utente"]) && !empty($_POST["codice"]) && !empty($_POST["codice_lotto"]) && tokenVerify($_POST["token"])) {
$codice_round = $_POST["codice_round"] ?? NULL;
$gara = publicGara::init($_POST["codice_gara"],$codice_round);
if (!empty($gara)) {
if ($gara->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();
}
}
?>