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.
206 righe
9.3 KiB
206 righe
9.3 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_GET) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 100) { |
|
if (!empty($_GET["modulo"]) && !empty($_GET["codice_elemento"])) { |
|
$manager = new Commissione($_GET["modulo"],$_GET["codice_elemento"],"commissione"); |
|
$query_string = http_build_query($_GET); |
|
if ($manager->checkAdminPermission()) { |
|
$settings = $manager->getInfo(); |
|
$object = $manager->getObject(null); |
|
if (!empty($object)) { |
|
if (method_exists($object,"chooseLotto")) { |
|
$continua = false; |
|
$object->printSelectLottiConditions = ["hasPartecipanti","hasCriteriCommissione"]; |
|
if ($object->chooseLotto($_GET["codice_lotto"] ?? false,$_SERVER["PHP_SELF"]."?".http_build_query($_GET))) { |
|
$continua = true; |
|
$lotto = $object->lotto; |
|
} |
|
} else { |
|
$continua = true; |
|
} |
|
if ($continua) { |
|
$criteri = []; |
|
$tmp = $object->getCriteriValutabili(); |
|
$totaleValutazioni = 0; |
|
$valutazioni = $object->getCoefficientiValutazione(); |
|
foreach($tmp AS $criterio) { |
|
if ($criterio["tipologia"] == "Q") { |
|
$criteri[] = $criterio; |
|
$totaleValutazioni++; |
|
} |
|
} |
|
$partecipanti = $object->getPartecipanti(NULL,TRUE); |
|
if (count($criteri) > 0 && count($partecipanti) > 0) { |
|
ob_start(); |
|
$error = false; |
|
$commissari = $manager->getCommissari($_GET["codice_utente"] ?? NULL); |
|
foreach($partecipanti AS $index => $partecipante) { |
|
$partecipante["codice_partecipante"] = $partecipante["codice"]; |
|
$partecipanti[$index] = $partecipante; |
|
} |
|
if (!empty($commissari)) { |
|
$coppie = true; |
|
if (count($partecipanti) < 3 || $settings["modalita"] == "R") { $coppie = false; } |
|
if (empty($_GET["pdf"]) && count($commissari) == 1 && $coppie) { |
|
?> |
|
<button onClick="showModalWithURL('/backend/common/commissioni/coppie.php?<?= $query_string ?>')" |
|
class="btn btn-sm btn-block btn-info mb-2"><span class="fa fa-th"></span> <?= __("Visualizza griglie di confronto a coppie") ?></button> |
|
<? |
|
} |
|
foreach($criteri AS $criterio) { |
|
?> |
|
<div class="card card-body mb-2"> |
|
<span class="h4"> |
|
<strong><?= $criterio["denominazione"] ?></strong><br> |
|
<small><?= $criterio["descrizione"] ?></small> |
|
</span> |
|
<div class="table-responsive"> |
|
<table class="table table-striped"> |
|
<thead> |
|
<tr> |
|
<? if ($manager->modulo != "concorsi") { ?> |
|
<th class="text-center" colspan="2"><?= __("Partecipante") ?></th> |
|
<? } else { ?> |
|
<th><?= __("ID") ?></th> |
|
<? } ?> |
|
<? foreach($commissari AS $commissario) { ?> |
|
<th class="text-center" width="15%"><span class="fa fa-user"></span><br><?= $commissario["cognome"] . " " .$commissario["nome"] ?></th> |
|
<? } ?> |
|
<th class="text-center" width="10" <?= ($settings["riparametra"] == "S") ? "colspan=\"2\"" : "" ?>><?= __("Media") ?></th> |
|
<th class="text-center" width="10"><?= __("Punteggio") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
$results = $object->getSommaMediaPunteggiCoefficienti($criterio["codice"],(count($commissari) > 1) ? NULL : $commissari[0]["codice_utente"]); |
|
$somme = ""; |
|
$medie = ""; |
|
$normalizzazione = ""; |
|
$punteggi = ""; |
|
if (!empty($results)) { |
|
$somme = $results["somme"]; |
|
$medie = $results["medie"]; |
|
$normalizzazione = $results["normalizzazione"]; |
|
$punteggi = $results["punteggi"]; |
|
} |
|
foreach($partecipanti AS $partecipante) { |
|
?> |
|
<tr> |
|
<? if ($manager->modulo != "concorsi") { ?> |
|
<td><?= $partecipante["codice_fiscale"] ?></td> |
|
<td><strong><?= $partecipante["ragione_sociale"] ?></strong></td> |
|
<? } else { ?> |
|
<td><?= $partecipante["id"] ?></td> |
|
<? }?> |
|
<? |
|
foreach($commissari AS $commissario) { |
|
?> |
|
<td class="text-center"> |
|
<?= $valutazioni[$criterio["codice"]][$commissario["codice_utente"]][$partecipante["codice_partecipante"]] ?? "" ?> |
|
</td> |
|
<? |
|
} |
|
?> |
|
<td width="10" class="text-center"> |
|
<?= $medie[$partecipante["codice_partecipante"]] ?? "" ?> |
|
</td> |
|
<? if ($settings["riparametra"] == "S") { ?> |
|
<td width="10" class="text-center"> |
|
<?= $normalizzazione[$partecipante["codice_partecipante"]] ?? "" ?> |
|
</td> |
|
<? } ?> |
|
<td width="10" class="text-center"> |
|
<strong><?= $punteggi[$partecipante["codice_partecipante"]] ?? "" ?></strong> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
$html = ob_get_clean(); |
|
if (empty($_GET["pdf"])) { |
|
echo $html; |
|
$_GET["pdf"] = true; |
|
$query_string = http_build_query($_GET); |
|
?> |
|
<a target="_blank" href="/backend/common/commissioni/report.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><?= __("Report valutazione") ?></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; |
|
border: 1px solid #000; |
|
} |
|
|
|
.text-center { |
|
text-align:center |
|
} |
|
|
|
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> |
|
<h1 style="margin-left:0.5cm"><?= $manager->getInfo()["oggetto"] ?></h1> |
|
<? |
|
$html = ob_get_clean() . $html . "</body></html>"; |
|
$content = documentConverter::getPDFWithDOMPDF($html,"A3","landscape"); |
|
$fileName = 'Report.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(); |
|
} |
|
?>
|
|
|