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.
222 righe
8.4 KiB
222 righe
8.4 KiB
<? |
|
$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"]); |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<div data-target="#dettaglioCriterio<?= $criterio["codice"] ?>" class="card-title"> |
|
<strong><?= $count . " - " . $criterio["denominazione"] ?></strong><br> |
|
<small><?= $criterio["descrizione"] ?></small> |
|
</div> |
|
</div> |
|
<div class="card-body p-0" id="dettaglioCriterio<?= $criterio["codice"] ?>"> |
|
<table class="table table-condensed table-striped m-0"> |
|
<thead> |
|
<tr> |
|
<th>#</th> |
|
<th><?= __("Partita IVA") ?></th> |
|
<th><?= __("Ragione Sociale") ?></th> |
|
<th><?= __("Punteggio") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
$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++; |
|
?> |
|
<tr> |
|
<td class="text-center" width="10"><?= $i ?></td> |
|
<td class="text-center" width="10%"><?= $partecipante["codice_fiscale"] ?></td> |
|
<td> |
|
<strong> |
|
<?= $partecipante["ragione_sociale"] ?> |
|
</strong> |
|
</td> |
|
<td width="10" class="text-center"><?= $punti ?></td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
$count++; |
|
} |
|
$html = ob_get_clean(); |
|
if (count($criteri) > 1) { |
|
ob_start(); |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<div data-target="#dettaglioCriterio<?= $criterio["codice"] ?>" class="card-title"> |
|
<strong><?= __("Totale") ?></strong> |
|
</div> |
|
</div> |
|
<div class="card-body p-0" id="dettaglioCriterio<?= $criterio["codice"] ?>"> |
|
<table class="table table-condensed table-striped m-0"> |
|
<thead> |
|
<tr> |
|
<th>#</th> |
|
<th><?= __("Partita IVA") ?></th> |
|
<th><?= __("Ragione Sociale") ?></th> |
|
<th><?= __("Punteggio") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
$i = 0; |
|
foreach($partecipanti AS $partecipante) { |
|
$i++; |
|
?> |
|
<tr> |
|
<td class="text-center" width="10"><?= $i ?></td> |
|
<td class="text-center" width="10%"><?= $partecipante["codice_fiscale"] ?></td> |
|
<td> |
|
<strong> |
|
<?= $partecipante["ragione_sociale"] ?> |
|
</strong> |
|
</td> |
|
<td width="10" class="text-center"><?= $totale[$partecipante["codice"]] ?? "" ?></td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<hr> |
|
<? |
|
$html = ob_get_clean() . $html; |
|
} |
|
if (empty($_GET["pdf"])) { |
|
echo $html; |
|
$_GET["pdf"] = true; |
|
$query_string = http_build_query($_GET); |
|
?><br> |
|
<a target="_blank" href="grid.php?<?= $query_string ?>" class="btn btn-block btn-danger"> |
|
<span class="far fa-file-pdf"></span> <?= __("Esporta PDF") ?> |
|
</a> |
|
<? |
|
} else { |
|
ob_start(); |
|
?> |
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
<title><?= __("Graduatoria") ?></title> |
|
<style type="text/css"> |
|
html, body { |
|
margin: 0px; |
|
padding: 0px; |
|
} |
|
body { |
|
font-family: "Helvetica", sans-serif; |
|
font-size: 10pt; |
|
padding-top: 1cm; |
|
} |
|
|
|
.card { |
|
margin:0.1cm 0.5cm; |
|
padding:0.5cm; |
|
} |
|
|
|
.text-center { |
|
text-align:center |
|
} |
|
|
|
.bg-success { |
|
background-color:#0C0; |
|
} |
|
|
|
.bg-danger { |
|
background-color:#C00; |
|
} |
|
|
|
table { |
|
width: 100%; |
|
border-spacing: 0; |
|
border-collapse: collapse; |
|
} |
|
th { |
|
background-color:#CCC; |
|
} |
|
td,th { |
|
border: 1px solid #666; |
|
margin:0; |
|
padding: 0.2cm; |
|
} |
|
|
|
</style> |
|
</head> |
|
<body> |
|
<div style="margin-left:0.5cm"> |
|
<h1><?= $record["oggetto"] ?> - <?= __("Fase") ?> <?= $round["numero"] ?></h1> |
|
<h3><?= __("Lotto") ?> <?= $gara->lotto["numero"] ?> - <?= $gara->lotto["cig"] ?></h3> |
|
<strong><?= ($economica) ? __("Valutazione economica") : __("Valutazione tecnica") ?></strong> |
|
</div> |
|
<? |
|
$html = ob_get_clean() . $html . "</body></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(); |
|
} |
|
?>
|
|
|