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.
118 righe
5.7 KiB
118 righe
5.7 KiB
<? |
|
if (isset($this) && is_a($this,"PannelloCommissione")) { |
|
$infoCommissione = $this->info; |
|
$manager = new Commissione($infoCommissione["modulo"],$infoCommissione["codice_elemento"],"commissione"); |
|
$object = $manager->getObject(); |
|
if (!empty($object)) { |
|
$continua = true; |
|
if (isset($get["codice_lotto"])) { |
|
$continua = false; |
|
if ($object->setLotto($get["codice_lotto"])) { |
|
$inputLotto = true; |
|
$continua = true; |
|
} |
|
} |
|
if ($continua) { |
|
$criteri = $object->getCriteri($get["codice_criterio"]); |
|
$partecipanti = $object->getPartecipanti(NULL,TRUE); |
|
if (!empty($criteri)) { |
|
$criterio = $criteri[0]; |
|
$coppie = true; |
|
$coefficienti = []; |
|
if (count($partecipanti) < 3 || $infoCommissione["modalita"] == "R") { $coppie = false; } |
|
if ($coppie) { |
|
ob_start(); |
|
$saved = $this->db->prepare("SELECT punteggio_partecipante_1, punteggio_partecipante_2 FROM b_confronto_coppie WHERE codice_commissione = :codice |
|
AND codice_utente = :codice_utente AND codice_criterio = :codice_criterio AND codice_partecipante_1 = :a AND codice_partecipante_2 = :b "); |
|
$saved->bindValue(":codice",$infoCommissione["codice"]); |
|
$saved->bindValue(":codice_utente",$_SESSION["utente"]->codice); |
|
$saved->bindValue(":codice_criterio",$criterio["codice"]); |
|
?> |
|
<form action="save.php" method="post" rel="validate"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $infoCommissione["codice"] ?>"> |
|
<input id="codice_criterio" type="hidden" name="codice_criterio" value="<?= $criterio["codice"] ?>"> |
|
<? if (!empty($inputLotto)) { ?> |
|
<input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $object->lotto["codice"] ?>"> |
|
<? } ?> |
|
<table class="table"> |
|
<? |
|
$colors[6] = "#67FF23"; |
|
$colors[5] = "#95FE24"; |
|
$colors[4] = "#C2FD25"; |
|
$colors[3] = "#EEFC26"; |
|
$colors[2] = "#FBDD27"; |
|
foreach($partecipanti AS $partecipante) { |
|
if ($partecipante["codice"] == $get["partecipante"]) { |
|
$a = $partecipante; |
|
$a["codice_partecipante"] = $partecipante["codice"]; |
|
} |
|
if ($partecipante["codice"] > $get["partecipante"]) { |
|
$b = $partecipante; |
|
$b["codice_partecipante"] = $partecipante["codice"]; |
|
$echo = true; |
|
?> |
|
<tr> |
|
<th class="text-left"><?= $a["ragione_sociale"] ?></th> |
|
<th class="text-right"><?= $b["ragione_sociale"] ?></th> |
|
</tr> |
|
<tr> |
|
<td class="text-center" colspan="2"> |
|
<table class="table"> |
|
<tr> |
|
<? |
|
$value = ""; |
|
$saved->bindValue(":a",$a["codice_partecipante"]); |
|
$saved->bindValue(":b",$b["codice_partecipante"]); |
|
$saved->execute(); |
|
if ($saved->rowCount() > 0) { |
|
$value = $saved->fetch(PDO::FETCH_ASSOC); |
|
$value = $value["punteggio_partecipante_1"] . "_" . $value["punteggio_partecipante_2"]; |
|
} |
|
$name = $a["codice_partecipante"] . "_" . $b["codice_partecipante"]; |
|
for($p=6;$p>=2;$p--) { |
|
?> |
|
<td class="text-center" style="border-bottom: 5px solid <?= $colors[$p] ?>"> |
|
<input type="radio" name="valutazione[<?= $name ?>]" value="<?= $p ?>_0" <?= ($value == $p . "_0") ? "checked" : "" ?>><br> |
|
+<?= $p ?> |
|
</td> |
|
<? |
|
} |
|
?> |
|
<td class="text-center"> |
|
<input type="radio" name="valutazione[<?= $name ?>]" value="1_1" <?= ($value == "1_1") ? "checked" : "" ?>><br> |
|
<?= __("Equivalente") ?> |
|
</td> |
|
<? |
|
for($p=2;$p<=6;$p++) { |
|
?> |
|
<td class="text-center" style="border-bottom: 5px solid <?= $colors[$p] ?>"> |
|
<input type="radio" name="valutazione[<?= $name ?>]" value="0_<?= $p ?>" <?= ($value == "0_" . $p) ? "checked" : "" ?>><br> |
|
+<?= $p ?> |
|
</td> |
|
<? |
|
} |
|
?> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
} |
|
?> |
|
</table> |
|
<button type="submit" class="btn btn-block btn-success"><span class="fa fa-save"></span> <?= __("Salva") ?></button> |
|
</form> |
|
<? |
|
$html = ob_get_clean(); |
|
if (isset($echo)) { |
|
$error = false; |
|
echo $html; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
?>
|
|
|