gestione gare pubbliche
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.
 
 
 
 
 

76 righe
2.5 KiB

<?
if (isset($_SESSION["utente"]) && isset($modulo) && $_SESSION["utente"]->permission($id_modulo)) {
$bind = [":codice_gestore"=>$_SESSION["ente"]->codice];
$sql_d = "SELECT count(codice) AS totale, stato FROM b_concorsi WHERE codice > 0 ";
if (!$_SESSION["utente"]->fromHere()) {
$sql_d .= " AND codice_ente = :codice_ente";
$bind[":codice_ente"] = $_SESSION["utente"]->codice_ente;
}
$ris_d = $pdo->go($sql_d." GROUP BY stato ORDER BY stato",$bind);
if ($ris_d->rowCount() > 0) {
$totale = 0;
$ris_d = $ris_d->fetchAll(PDO::FETCH_ASSOC);
foreach($ris_d AS $concorsiTotale) { $totale += $concorsiTotale["totale"]; }
$stati = concorso::getStati();
ob_start();
?>
<div id="concorsiGraph"></div>
<script>
Highcharts.chart('concorsiGraph', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false,
backgroundColor: 'transparent'
},
title: {
text: "<div style='text-align:center'><?= $totale ?><br><small><?= strtoupper(__("concorsi")) ?></small></div>",
useHTML: true,
align: 'center',
verticalAlign: 'middle',
style: { "color": "inerith", "fontSize": "2em" },
y: 70
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%'],
size: '110%'
}
},
series: [{
type: 'pie',
name: 'Stato',
innerSize: '75%',
data: [
<?
foreach($ris_d AS $stato) {
?>{
name: "<?= __($stati[$stato["stato"]]["titolo"]) ?>",
color: "<?= $stati[$stato["stato"]]["color"] ?>",
y: <?= $stato["totale"] ?>
},
<?
}
?>
]
}]
});
</script>
<?
$cards[] = ob_get_clean();
}
}
?>