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.
228 righe
9.1 KiB
228 righe
9.1 KiB
<? |
|
$error = true; |
|
if (!isset($gara)) { |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "asta"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
$ajaxRequestMonitor = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_gara"],$id_modulo) && !empty($_GET["codice_gara"]) && !empty($_GET["codice_lotto"]) && !empty($_GET["codice_round"])) { |
|
$gara = gara::init($_GET["codice_gara"],$_GET["codice_round"]); |
|
$gara->setLotto($_GET["codice_lotto"]); |
|
$asta = $gara->getAsta(true); |
|
} |
|
} |
|
if (!empty($asta)) { |
|
$error = false; |
|
$scadenza = $asta->getScadenza(); |
|
?> |
|
<div class="mb-3"> |
|
<? if ($scadenza > 0) { |
|
$time = secondsToTime($scadenza) ?> |
|
<div class="card card-body bg-warning text-white text-center"> |
|
<div class="d-flex"> |
|
<? if (!empty($time["giorni"])) { ?> |
|
<div class="col text-center"> |
|
<span class="h1"><?= $time["giorni"] ?></span><br> |
|
<small><?= __("Giorni") ?></small> |
|
</div> |
|
<? } ?> |
|
<div class="col text-center"> |
|
<span class="h1"><?= $time["ore"] ?></span><br> |
|
<small><?= __("Ore") ?></small> |
|
</div> |
|
<div class="col text-center"> |
|
<span class="h1"><?= $time["minuti"] ?></span><br> |
|
<small><?= __("Minuti") ?></small> |
|
</div> |
|
<div class="col text-center"> |
|
<span class="h1"><?= $time["secondi"] ?></span><br> |
|
<small><?= __("Secondi") ?></small> |
|
</div> |
|
</div> |
|
<small><?= __("Scadenza") ?></small> |
|
</div> |
|
<? } else { |
|
if (!empty($ajaxRequestMonitor)) { ?> |
|
<script> |
|
window.location.reload(); |
|
</script> |
|
<? } |
|
} ?> |
|
</div> |
|
<div class="row"> |
|
<div class="col-12 col-xl-4"> |
|
<? |
|
$rilanci = $asta->getRilanci(); |
|
$graduatoria = $gara->getGraduatoria(TRUE); |
|
if (!empty($graduatoria)) { |
|
$posizione = 0; |
|
foreach($graduatoria AS $partecipante) { |
|
$verificata = false; |
|
foreach($rilanci AS $rilancio) { |
|
if ($rilancio["codice_partecipante"] == $partecipante["codice"]) { |
|
if ($rilancio["verificata"] == "S") { |
|
$verificata = true; |
|
} |
|
reset($rilanci); |
|
break; |
|
} |
|
} |
|
$class = ""; |
|
$glyph = ""; |
|
$posizione++; |
|
if ($partecipante["aggiudicatario"] == "S") { |
|
$class = "bg-success text-white"; |
|
$glyph = "<span class=\"fa fa-trophy\"></span>"; |
|
} |
|
?> |
|
<div class="card card-body <?= $class ?>"> |
|
<div class="row"> |
|
<div class="col-12 col-xl-2 text-center"> |
|
<?= $posizione ?> |
|
<?= $glyph ?> |
|
</div> |
|
<div class="col-12 col-xl-7"> |
|
<?= $partecipante["ragione_sociale"] ?> |
|
<? if ($verificata) { ?> |
|
<div class="badge badge-success"><?= __("Rilancio confermato") ?></div> |
|
<? } else { ?> |
|
<div class="badge badge-danger"><?= __("Rilancio non confermato") ?></div> |
|
<? } ?> |
|
</div> |
|
<div class="col-12 col-xl-3 text-center"> |
|
<?= $partecipante["totale"] ?> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
?> |
|
</div> |
|
<div class="col-12 col-xl-8"> |
|
<? |
|
$tmp = $gara->getCriteriValutabili(); |
|
$criteri = []; |
|
if (!empty($tmp)) { |
|
foreach($tmp AS $criterio) { |
|
if (!empty($criterio["auto"])) { |
|
$criteri[$criterio["codice"]] = $criterio; |
|
} |
|
} |
|
if (!empty($rilanci) && !empty($criteri)) { |
|
foreach($rilanci AS $rilancio) { |
|
if (!empty($rilancio["dettagli"])) { |
|
foreach($rilancio["dettagli"] AS $codice_criterio => $offerte) { |
|
foreach($offerte AS $partecipante => $valore) { |
|
if (!isset($criteri[$codice_criterio]["eventi"])) { |
|
$criteri[$codice_criterio]["eventi"] = []; |
|
} |
|
$criteri[$codice_criterio]["eventi"][$rilancio["timestamp"]] = ["value"=>$valore,"label"=>$rilancio["ragione_sociale"]]; |
|
} |
|
} |
|
} |
|
} |
|
$col = ""; |
|
if (count($criteri) > 1) { |
|
$col = "col-xl-6"; |
|
} |
|
?> |
|
<div class="row"> |
|
<? |
|
foreach($criteri AS $criterio) { |
|
$criterio["eventi"] = array_reverse($criterio["eventi"],true); |
|
?> |
|
<div class="col-12 <?= $col ?>"> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<span class="card-title"><?= $criterio["denominazione"] ?></span> |
|
</div> |
|
<div class="card-body m-0 p-0"> |
|
<div id="graph-<?= $criterio["codice"] ?>"></div> |
|
<script> |
|
var thisChart<?= $criterio["codice"] ?> = Highcharts.chart('graph-<?= $criterio["codice"] ?>', { |
|
chart: { |
|
spacing:20, |
|
margin:100, |
|
backgroundColor: 'rgb(255, 255, 255)', |
|
showAxes: true, |
|
<?= (isset($ajaxRequestMonitor)) ? "" : "zoomType: 'x'," ?> |
|
height: "<?= (empty($col)) ? "500" : "300" ?>", |
|
animation: <?= (isset($ajaxRequestMonitor)) ? "false" : "true" ?> |
|
}, |
|
exporting: { |
|
enabled: false |
|
}, |
|
xAxis: { |
|
categories: ['<? |
|
$cat = array_keys($criterio["eventi"]); |
|
echo implode("','",$cat); |
|
?>'], |
|
type: 'datetime', |
|
visible: false, |
|
crosshair: true |
|
}, |
|
yAxis: { |
|
title: { |
|
text: '<?= __("Valore") ?>' |
|
} |
|
}, |
|
plotOptions: { |
|
series: { |
|
dataLabels: { |
|
enabled: true |
|
} |
|
} |
|
}, |
|
title: { text: "<?= $criterio["denominazione"] ?>"}, |
|
tooltip: { |
|
align: "center", |
|
formatter: function(d) { |
|
return "<span style=\"font-size: 10px\">"+this.point.category+"</span><br/><strong style='font-size:1.2em'>" + number_format(this.point.y,2,",",".") + "</strong><br>" + this.point.description; |
|
} |
|
}, |
|
series: [{ |
|
name : 'Offerta', |
|
dataLabels: { |
|
enabled: true |
|
}, |
|
animation: <?= (isset($ajaxRequestMonitor)) ? "false" : "true" ?>, |
|
type: 'line', |
|
data: [ |
|
<? |
|
foreach($criterio["eventi"] AS $datetime => $y) { |
|
?> |
|
{ |
|
y: <?= $y["value"] ?>, |
|
description: "<?= $y["label"] ?>" |
|
}, |
|
<? |
|
} |
|
?> |
|
] |
|
}] |
|
}) |
|
</script> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
<? |
|
} else { |
|
alertManager::printInfoBox("Nessun rilancio presente"); |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|