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.
163 righe
9.8 KiB
163 righe
9.8 KiB
<!doctype html> |
|
<? |
|
include 'lib/api.php'; |
|
if ($_POST['periodo']) { |
|
$periodo = Utils::get_filter_string_POST('periodo'); |
|
} else { |
|
$periodo = date("m/Y"); |
|
} |
|
$elencoRichieste= Utils::elaboraStatistiche($STATS_RICHIESTE); |
|
$dati = array(); |
|
if (array_key_exists($periodo, $elencoRichieste)) { |
|
$dati = $elencoRichieste[$periodo]; |
|
} |
|
?> |
|
<html lang="en"> |
|
<? include_once ROOT . 'layout/head.php'; ?> |
|
<body> |
|
<style> |
|
tr.group, |
|
tr.group:hover { |
|
background-color: #ddd !important; |
|
} |
|
</style> |
|
<? |
|
include_once ROOT . 'layout/header_home.php'; |
|
?> |
|
<main role="main" > |
|
<header class="masthead masthead-page mb-5"> |
|
<div class="container"> |
|
<div class="row align-items-center"> |
|
<div class="col-lg-8 py-5"> |
|
<h1 class="mb-2"><?= APP_NAME ?></h1> |
|
<h2 class="m-0">Statistiche</h2> |
|
</div> |
|
<div class="col-lg-4"> |
|
<h1 style="font-size:10em"><i class="fas fa-solid fa-chart-line"></i></h1> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
include_once ROOT . 'layout/header_svg.php'; |
|
?> |
|
</header> |
|
<div class="container-fluid"> |
|
<div class="row"> |
|
<div class="col-lg-12"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<label for="periodo" class='h5'>Periodo di interesse:</label> |
|
<select class="form-control" id='periodo' onchange='settaPeriodo(this)'> |
|
<option value=''>...Seleziona il periodo di interesse...</option> |
|
<? foreach ($STATS_RICHIESTE as $chiave => $valore) { ?> |
|
<option value='<?= $chiave ?>' <? if ($periodo == $chiave) echo "selected"; ?>><?= $chiave ?></option> |
|
<? } ?> |
|
</select> |
|
</div> |
|
</div> |
|
<? if (count($dati) > 0) { ?> |
|
<div class='row mt-3'> |
|
<div class="col-sm-6"> |
|
<table class="table table-striped table-bordered" style="width:100%"> |
|
<thead class="bg-primary text-light text-center"> |
|
<tr> |
|
<th colspan="3" class='h5'>Numero di Richieste Presentate - Periodo <?= $periodo ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<tr> |
|
<td width="50%"><strong>Tipologia di richiesta di sconto</strong></td> |
|
<td><strong>Numerosità</strong></td> |
|
<td><strong>Totale Sconto [€]</strong></td> |
|
</tr> |
|
<tr> |
|
<td>Residenti (DDG 3158)</td> |
|
<td><?= $dati['RESIDENTI']['NUMERO'] ?></td> |
|
<td><?= $dati['RESIDENTI']['EURO'] ?></td> |
|
</tr> |
|
<tr> |
|
<td>Prioritari (DDG 3158)</td> |
|
<td><?= $dati['PRIORITARI']['NUMERO'] ?></td> |
|
<td><?= $dati['PRIORITARI']['EURO'] ?></td> |
|
</tr> |
|
<? if ($dati['NATIVI_DDG4645']['NUMERO'] > 0) { ?> |
|
<tr> |
|
<td>Nativi (DDG 4645)</td> |
|
<td><?= $dati['NATIVI_DDG4645']['NUMERO'] ?></td> |
|
<td><?= $dati['NATIVI_DDG4645']['EURO'] ?></td> |
|
</tr> |
|
<? } ?> |
|
<? if ($dati['RESIDENTI_DDG4645']['NUMERO'] > 0) { ?> |
|
<tr> |
|
<td>Residenti (DDG 4645)</td> |
|
<td><?= $dati['RESIDENTI_DDG4645']['NUMERO'] ?></td> |
|
<td><?= $dati['RESIDENTI_DDG4645']['EURO'] ?></td> |
|
</tr> |
|
<? } ?> |
|
<tr> |
|
<td><strong>TOTALE</strong></td> |
|
<td><strong><?= $dati['NUMEROSITA_GENERALE_MENSILE'] ?></strong></td> |
|
<td><strong><?= $dati['EURO_GENERALE_MENSILE'] ?></strong></td> |
|
</tr> |
|
</tbody> |
|
</table> |
|
</div> |
|
<div class="col-sm-6"> |
|
<table class="table table-striped table-bordered" style="width:100%"> |
|
<thead class="bg-primary text-light text-center"> |
|
<tr> |
|
<th colspan="3" class='h5'>Richieste per compagnia aerea - Periodo <?= $periodo ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<tr> |
|
<td width="50%"><strong>Compagnia</strong></td> |
|
<td><strong>Numerosità</strong></td> |
|
<td><strong>Totale Sconto [€]</strong></td> |
|
</tr> |
|
<? |
|
$tmpNumero = 0; |
|
$tmpEuro = 0; |
|
foreach ($dati['STATS_COMPAGNIE'] as $compagnia => $valore) { |
|
$tmpNumero += str_replace('.', '', $valore['NUMERO']); |
|
$tmpEuro += (float) str_replace(',', '.', str_replace('.', '', str_replace(['€', ' '], '', $valore['EURO']))) |
|
?> |
|
<tr> |
|
<td><?= $compagnia ?></td> |
|
<td><?= $valore['NUMERO'] ?></td> |
|
<td><?= $valore['EURO'] ?></td> |
|
</tr> |
|
<? } ?> |
|
<tr> |
|
<td><strong>TOTALE</strong></td> |
|
<td><strong><?= number_format($tmpNumero, 0, '', '.'); ?></strong></td> |
|
<td><strong><?= '€ ' . number_format($tmpEuro, 2, ',', '.'); ?></strong></td> |
|
</tr> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12 text-center">Dati aggiornati al <u><?=STATISTICHE_AGGIORNATE_AL?></u></div> |
|
</div> |
|
<? } else { ?> |
|
<h5 class='text-center mt-3 text-primary'>Per il periodo <u><strong><?= $periodo ?></strong></u> i dati non sono ancora disponibili.</h5> |
|
<? } ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<br> |
|
<? include_once ROOT . 'layout/footer.php'; ?> |
|
</main> |
|
</body> |
|
<script> |
|
function settaPeriodo(ricevo) { |
|
console.log(ricevo.value); |
|
$.redirect("statistiche.php", {"periodo": ricevo.value}); |
|
} |
|
</script> |
|
</html>
|
|
|