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.
217 righe
12 KiB
217 righe
12 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "punteggiTecnici"; |
|
$cmd_info = concorso::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$concorso = concorso::init($_GET["codice"],$codice_round); |
|
if (!empty($concorso)) { |
|
$record = $concorso->info; |
|
$round = $concorso->round; |
|
|
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
|
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/panel.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Pannello"); |
|
if (!empty($_GET["codice_lotto"])) { |
|
$breadcrumb["/concorsi/punteggi/index.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Scelta lotto"); |
|
} |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
|
|
?><h1><?= $titolo_modulo ?></h1><? |
|
$concorso->printSelectLottiConditions = ["hasPartecipanti"]; |
|
if ($concorso->chooseLotto($_GET["codice_lotto"] ?? false,"{$_SERVER["PHP_SELF"]}?codice=".$record["codice"]."&codice_round=".$round["codice"])) { |
|
$lock = $concorso->checkLock($cmd_info["id"]); |
|
$lotto = $concorso->lotto; |
|
$partecipanti = $concorso->getPartecipanti(); |
|
$criteri = $concorso->getCriteriValutabili(); |
|
if (!empty($criteri)) { |
|
$auto = false; |
|
$commissione = $concorso->getCommissari("commissione"); |
|
$num_criteri = count($criteri); |
|
$codici_criteri = []; |
|
foreach($criteri AS $criterio) { |
|
$codici_criteri[] = (int) $criterio["codice"]; |
|
if (!empty($criterio["auto"])) { |
|
$auto = true; |
|
} |
|
} |
|
$report = false; |
|
if (count($partecipanti) > 0) { |
|
if (count($criteri) === 1) { |
|
?> |
|
<h2><?= $criteri[0]["denominazione"] ?></h2> |
|
<? |
|
} |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<? |
|
$autoCoef = false; |
|
if (!empty($commissione)) { |
|
$infoCommissione = $concorso->getManagerCommissione("commissione")->getInfo(); |
|
if (!empty($infoCommissione)) { |
|
$coefficienti = $pdo->go("SELECT codice FROM b_coefficienti_commissari WHERE codice_commissione = :codice",[":codice"=>$infoCommissione["codice"]]); |
|
if ($coefficienti->rowCount() > 0) { |
|
$auto = true; |
|
$autoCoef = true; |
|
} |
|
if (!empty($concorso->getManagerCommissione("commissione")->getCommissari())) { |
|
?> |
|
<button class="btn btn-info mx-1 ignore-lock" onClick="showModalWithURL('monitor.php?codice=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>')"> |
|
<span class="fa fa-users"></span> <?= __("Gestione commissione valutatrice") ?> |
|
</button> |
|
<? |
|
} |
|
} |
|
} |
|
if (!$lock) { |
|
if ($auto) { |
|
$sql = "SELECT b_dettaglio_offerte_concorsi.tipo FROM b_dettaglio_offerte_concorsi JOIN b_offerte_concorsi ON b_dettaglio_offerte_concorsi.codice_offerta = b_offerte_concorsi.codice |
|
WHERE b_dettaglio_offerte_concorsi.offerta IS NOT NULL AND b_offerte_concorsi.codice_round = :codice "; |
|
$ris = $pdo->go($sql,array(":codice"=>$round["codice"])); |
|
if ($ris->rowCount() > 0 || $autoCoef) { |
|
?> |
|
<form rel="validate" method="post" id="import-form" action="import.php" class="form-inline float-right"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $record["codice"] ?>"> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"> |
|
<button class="btn btn-warning "><span class="fa fa-magic"></span> <?= __("Calcola i punteggi automaticamente") ?></button> |
|
</form> |
|
<? |
|
} |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? if (!$lock) { ?> |
|
<div id="modal-exclude" class="modal fade" role="dialog" tabindex="-1"> |
|
<div class="modal-dialog" role="document"> |
|
<div class="modal-content"> |
|
<div class="modal-header text-right"> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
|
</div> |
|
<div class="modal-body"> |
|
<form rel="validate" method="post" action="disable.php"> |
|
<input id="codice-escluso" type="hidden" name="codice" value=""> |
|
<div class="form-group"> |
|
<label for="motivazione"> |
|
<?= __("motivazione") ?>* |
|
</label> |
|
<textarea class="ckeditor_simple" id="motivazione" class="form-control" name="motivazione" title="<?= __("motivazione") ?>" rel="S;2;0;A"></textarea> |
|
</div> |
|
<div class="alert alert-warning"> |
|
<div class="form-check"> |
|
<input class="form-check-input" type="checkbox" name="sendMsg" value="S" id="sendMsg"> |
|
<label class="form-check-label" for="sendMsg"> |
|
<?= __("Invia una comunicazione al partecipante") ?> |
|
</label> |
|
</div> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<form rel="validate" method="post" action="save.php" id="edit-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $record["codice"] ?>"> |
|
<input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<? } else { ?><div id="edit-form"><?} ?> |
|
<div class="card card-body mb-2 mt-2 p-0"> |
|
<div class="table-responsive"> |
|
<table class="table table-striped" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10">#</th> |
|
<th><?= __("ID") ?></th> |
|
<th width="100"><?= __("Punteggi") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
$i = 0; |
|
foreach($partecipanti as $partecipante) { |
|
$i++; |
|
?> |
|
<tr id="row-<?= $partecipante["codice"] ?>"> |
|
<td><?= $i ?></td> |
|
<td><?= $partecipante["id"] ?></td> |
|
<? |
|
$sql = "SELECT codice, valore FROM b_concorsi_punteggi_partecipanti WHERE codice_partecipante = :codice_partecipante AND codice_criterio IN (".implode(",",$codici_criteri).")"; |
|
$ris_punt = $pdo->go($sql,array(":codice_partecipante"=>$partecipante["codice"])); |
|
$num_punteggi = $ris_punt->rowCount(); |
|
if ($num_punteggi > 0) { $report = true; } |
|
if (count($criteri) > 1) { |
|
?> |
|
<td class="text-center"> |
|
<button onClick='showModalWithURL("dettaglio.php?codice=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>&codice_partecipante=<?= $partecipante["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>"); return false;' title='<?= __("visualizza") ?>' class='btn-<?= ($num_punteggi != $num_criteri) ? "warning" : "info" ?> btn-sm ignore-lock'><span class='fa fa-<?= ($num_punteggi != $num_criteri) ? "exclamation-triangle" : "search" ?>'></span></button><br> |
|
</td> |
|
<? |
|
} else { |
|
$punti = ""; |
|
if ($ris_punt->rowCount() === 1) { |
|
$punti = $ris_punt->fetch(PDO::FETCH_ASSOC); |
|
$report = true; |
|
if (!empty($punti)) { |
|
$punti = $punti["valore"]; |
|
} |
|
} |
|
?> |
|
<td class="text-center form-group"> |
|
<input type="text" title="<?= __("punti") ?> #<?= $partecipante["id"] ?>" class="form-control text-center" size="4" name="punteggio[<?= $partecipante["codice"] ?>][<?= $criterio["codice"] ?>]" rel="S;0;0;N;<?= $criterio["peso"] ?>;<=" value="<?= $punti ?>"> |
|
</td> |
|
<? |
|
} |
|
?> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
if (!$lock) { ?> |
|
<button class="btn btn-block btn-lg btn-warning"><span class="fa fa-save"></span> <?= __("Salva punteggi") ?></button> |
|
</form> |
|
<? } else { ?> |
|
</div> |
|
<script>$(":input").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? } ?> |
|
<? if ($report) { ?> |
|
<button type="button" onClick='showModalWithURL("grid.php?codice=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>");' class="mt-3 btn btn-block btn-lg ignore-lock btn-info"><span class="fa fa-search"></span> <?= __("Riepilogo") ?></button> |
|
<? } ?> |
|
<script> |
|
$('.motivazioni').popover({html:true}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
} else { |
|
alertManager::printWarningBox(__("Nessun criterio da valutare")); |
|
} |
|
} |
|
include_once ($beRoot."/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(); |
|
} |
|
?>
|
|
|