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.
 
 
 
 
 

127 righe
5.6 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (!function_exists("fatal_handler")) {
function fatal_handler() {
$error = error_get_last();
if( $error !== NULL && ($error['type'] === E_ERROR || $error['type'] === E_USER_ERROR))
{
global $record;
?>
<h3 class="alert alert-danger"><?= __("errore") . " " . __("upload") ?></h3>
<?
}
}
}
register_shutdown_function('fatal_handler');
if (!empty($_SESSION["utente"]) && !empty($_POST["codice_lotto"])) {
$gara = publicGara::init($_POST["codice"]);
if (!empty($gara)) {
if ($gara->setLotto($_POST["codice_lotto"])) {
$asta = $gara->getAsta(true);
if (!empty($asta->info) && !$asta->confirmDeadline(true) && $asta->info["richiedi_firma"] == "S") {
$partecipante = $gara->miaPartecipazione();
$record = $gara->info;
$round = $gara->round;
$lotto = $gara->lotto;
$breadcrumb = array();
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"];
$breadcrumb["/".$radice."/dettaglio.php?codice={$record["codice"]}&codice_lotto={$lotto["codice"]}"] = __("Dettaglio");
$breadcrumb["/".$radice."/partecipa/partecipa.php?codice={$record["codice"]}&codice_lotto={$lotto["codice"]}"] = __("Pannello");
$breadcrumb["pannello.php?codice={$record["codice"]}&codice_lotto={$lotto["codice"]}"] = __("Asta");
$breadcrumb[] = __("Conferma rilancio");
include_once ($root."/layout/top.php");
?>
<div class="container">
<h3><?= $record["oggetto"] ?></h3>
<?
$offerta = $asta->ultimoRilancio();
if (!empty($offerta)) {
$check_hash = true;
$error = false;
$msg = "";
if (strpos($_POST["filechunk"], "../")===false) {
$chunkPath = $config["chunk_folder"]."/".$_SESSION["utente"]->codice."/".$_POST["filechunk"];
$p7m = new P7Manager($chunkPath);
if ($p7m !== false) {
$signed = true;
$esito = $p7m->checkSignatures();
if ($esito) {
$found = false;
$hashVerify = array();
if ($offerta["md5"] != "") { $hashVerify[] = $p7m->find($offerta["md5"],"md5",$signed); }
if ($offerta["sha1"] != "") { $hashVerify[] = $p7m->find($offerta["sha1"],"sha1",$signed); }
if ($offerta["sha256"] != "") { $hashVerify[] = $p7m->find($offerta["sha256"],"sha256",$signed); }
if (!empty($hashVerify) && in_array(false,$hashVerify)!==false) {
if ($p7m->find($offerta["shaContent"],"sha256",$signed,true)) {
$found = true;
}
} else {
$found = true;
}
if ($found) {
$path = $gara->getBustePath()."/asta";
if (!is_dir($path)) {
mkdir($path,0777,true);
}
$path .= "/rilancio" . $offerta["codice"] . "-" . sanitize_string($_POST["filechunk"]);
if (file_put_contents($path,$p7m->fileContent)) {
$offerta["verificata"] = "S";
$salva = new salva();
$salva->debug = false;
$salva->nome_tabella = "b_offerte_gare";
$salva->operazione = "UPDATE";
$salva->oggetto = $offerta;
$codice_offerta = $salva->save();
if (!empty($codice_offerta)) {
$asta->aggiornaGraduatoria();
alertManager::printSuccessBox(__('Operazione effettuata con successo'));
} else {
alertManager::printAlertBox(__('errore nel salvataggio offerta') . " - #009");
}
} else {
alertManager::printAlertBox(__('errore nel salvataggio offerta') . " - #008");
}
} else {
alertManager::printAlertBox(__('Errore riconoscimento offerta') . " - #007");
}
} else {
alertManager::printAlertBox(__('Errore firma digitale') . " - #005");
}
} else {
alertManager::printAlertBox(__("errore") . " " . __("upload") . " - #003");
}
} else {
alertManager::printAlertBox(__("errore") . " " . __("upload") . " - #002");
}
} else {
alertManager::printAlertBox(__('Impossibile continuare') . " - #000");
}
} else {
alertManager::printAlertBox(__('Impossibile continuare'));
}
?>
<a class="btn btn-block btn-lg btn-default" href="pannello.php?codice=<?= $record["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>">
<?= __("Torna al pannello per continuare le operazioni") ?>
</a>
</div>
<?
include_once ($root."/layout/bottom.php");
} else {
echo '<meta http-equiv="refresh" content="0;URL=/index.php">';
die();
}
} else {
echo '<meta http-equiv="refresh" content="0;URL=/index.php">';
die();
}
} else {
echo '<meta http-equiv="refresh" content="0;URL=/index.php">';
die();
}
?>