$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$error = true;
if (!empty($_GET["economica"])) {
$economica = true;
$id_modulo = "punteggiEconomici";
} else {
$economica = false;
$id_modulo = "punteggiTecnici";
}
$cmd_info = gara::getInfoModulo($id_modulo);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && !empty($_GET["codice_lotto"])) {
$codice_round = $_GET["codice_round"] ?? NULL;
$gara = gara::init($_GET["codice"],$codice_round);
if (!empty($gara) && $gara->setLotto($_GET["codice_lotto"])) {
$record = $gara->info;
$round = $gara->round;
$lotto = $gara->lotto;
$lock = $gara->checkLock($cmd_info["id"]);
$criteri = ($economica) ? $gara->getCriteriEconomiciValutabili() : $gara->getCriteriTecniciValutabili();
if (!empty($criteri)) {
$partecipanti = $gara->getPartecipanti();
if (!empty($partecipanti)) {
$error = false;
ob_start();
$sql = "SELECT valore FROM b_gare_punteggi_partecipanti WHERE codice_criterio = :codice_criterio AND codice_partecipante = :codice_partecipante ";
$ris = $pdo->prepare($sql);
$totale = [];
$count = "A";
foreach($criteri AS $criterio) {
$ris->bindValue(":codice_criterio",$criterio["codice"]);
?>
">
| # |
= __("Partita IVA") ?> |
= __("Ragione Sociale") ?> |
= __("Punteggio") ?> |
$i = 0;
foreach($partecipanti AS $partecipante) {
$punti = "";
$ris->bindValue(":codice_partecipante",$partecipante["codice"]);
$ris->execute();
if ($ris->rowCount() == 1) {
$punti = $ris->fetch(PDO::FETCH_COLUMN);
}
if (!isset($totale[$partecipante["codice"]])) {
$totale[$partecipante["codice"]] = 0;
}
if ($punti !== "") {
$totale[$partecipante["codice"]] += $punti;
}
$i++;
?>
| = $i ?> |
= $partecipante["codice_fiscale"] ?> |
= $partecipante["ragione_sociale"] ?>
|
= $punti ?> |
}
?>
$count++;
}
$html = ob_get_clean();
if (count($criteri) > 1) {
ob_start();
?>
">
| # |
= __("Partita IVA") ?> |
= __("Ragione Sociale") ?> |
= __("Punteggio") ?> |
$i = 0;
foreach($partecipanti AS $partecipante) {
$i++;
?>
| = $i ?> |
= $partecipante["codice_fiscale"] ?> |
= $partecipante["ragione_sociale"] ?>
|
= $totale[$partecipante["codice"]] ?? "" ?> |
}
?>
$html = ob_get_clean() . $html;
}
if (empty($_GET["pdf"])) {
echo $html;
$_GET["pdf"] = true;
$query_string = http_build_query($_GET);
?>
= __("Esporta PDF") ?>
} else {
ob_start();
?>
= __("Graduatoria") ?>
= $record["oggetto"] ?> - = __("Fase") ?> = $round["numero"] ?>
= __("Lotto") ?> = $gara->lotto["numero"] ?> - = $gara->lotto["cig"] ?>
= ($economica) ? __("Valutazione economica") : __("Valutazione tecnica") ?>
$html = ob_get_clean() . $html . "";
$content = documentConverter::getPDFWithDOMPDF($html,"A3","landscape");
$fileName = 'Riepilogo.pdf';
if (!empty($content)) {
$error = false;
header("Content-type:application/pdf");
header("Content-Disposition:attachment;filename={$fileName}");
echo $content;
}
}
}
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>