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.
 
 
 

188 righe
11 KiB

<!doctype html>
<?php
include '../../lib/api.php';
define('THIS_PERMISSION', GRUPPO_STATISTICHE);
define('THIS_PERMISSION2', GRUPPO_REGIONE);
include_once (ROOT . "layout/include_permission.php");
$toDay = new DateTime();
$toDay->sub(new DateInterval('P1D'));
$oggi = $toDay->format('Y-m-d');
$dPost = (isset($_POST['dataElaborazione']) ? $_POST['dataElaborazione'] : $toDay->format('d-m-Y') );
$data_elaborazione = new DateTime($dPost);//07-12-2023
$dataElaborazione = $data_elaborazione->format('d/m/Y');
$num_account = Domanda::GetUtentiRegistratiFromData('04/12/2023 09:00:00', $dataElaborazione . ' 23:59:59');
$num_sconti = Domanda::GetScontiFromData('04/12/2023 09:00:00', $dataElaborazione . ' 23:59:59');
$num_compagnie = Domanda::GetScontiFromCompagnieFromData('04/12/2023 09:00:00', $dataElaborazione . ' 23:59:59');
?>
<html lang="en">
<? include_once ROOT . 'layout/head.php'; ?>
<body>
<? include_once ROOT . 'layout/header.php'; ?>
<? include_once ROOT . 'layout/menu.php'; ?>
<main role="main" class="<?= $cssColumNavBar ?>">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Report statistiche</li>
</ol>
</nav>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="card-title">
<form class="form-inline" method="post" action="report_statistiche.php">
<label class="my-1 mr-2" >Report statistiche al</label>
<input type="date" class="form-control " required autocomplete="new-password" min="<?= MIN_DATA_ACQUISTO_BIGLIETTO_JS ?>" max="<?= $dataElaborazione ?>" name="dataElaborazione" id="dataElaborazione" value="<?= (trim($dataElaborazione) != "" ? $data_elaborazione->format('Y-m-d'): '') ?>">
<button type="submit" class="btn btn-primary m-3">Applica la data</button>
</form>
</div>
<div class="row">
<div class="col-sm-12">
<h3 class="bg-primary text-white p-2">PERIODO DAL 04/12/2023 09:00 AL <?= $dataElaborazione ?> 23:59</h3>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="card bg-warning mb-1">
<div class="card-header">
<h4 class="card-title"><i class="fas fa-user-tag"></i> &nbsp;UTENTI REGISTRATI</h4>
</div>
<div class="card-body">
<table class="table table-hover">
<tbody>
<tr class="table-light">
<th scope="row">TIPO</th>
<th scope="row">NUMERO</th>
</tr>
<tr class="table-light">
<th scope="row"><i class="fas fa-male"></i>&nbsp;MASCHI</th>
<td><?=$num_account['M']?></td>
</tr>
<tr class="table-light">
<th scope="row"><i class="fas fa-female"></i>&nbsp;FEMMINE</th>
<td><?=$num_account['F']?></td>
</tr>
<tr class="table-dark">
<th scope="row">TOTALE</th>
<th scope="row"><?=($num_account['M']+$num_account['F'])?></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="card bg-success mb-1">
<div class="card-header">
<h4 class="card-title"><i class="fas fa-ticket-alt"></i> &nbsp;NUMERO RICHIESTE SCONTI</h4>
</div>
<div class="card-body">
<table class="table table-hover">
<tbody>
<?
$totale_num = 0;
$totale_importo = 0;
echo '<tr class="table-light">';
echo "<th scope='row'>TIPO</th>";
echo "<th scope='row'>NUMERO RICHIESTE SCONTI</th>";
echo "<th scope='row'>TOTALE SCONTI</th>";
echo "</tr>";
foreach ($num_sconti as $key => $value) {
echo '<tr class="table-light">';
foreach ($value as $k => $v) {
$euro = '';
if($k == 'NUM'){
$totale_num+=$v;
}
if($k == 'IMPORTO'){
$totale_importo+=$v;
$euro = '&euro;.';
$v= number_format($v, 2 , ',', '.');
}
echo "<td>$euro $v</td>";
}
echo "</tr>";
}
?>
<tr class="table-dark">
<th scope="row">TOTALE</th>
<th scope="row"><?=$totale_num?></th>
<th scope="row">&euro;. <?=number_format($totale_importo, 2 , ',', '.')?></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card bg-info mb-1">
<div class="card-header">
<h4 class="card-title"><i class="fas fa-plane"></i> &nbsp;RICHIESTE PER COMPAGNIA AEREA</h4>
</div>
<div class="card-body">
<table class="table table-hover">
<tbody>
<tr class="table-light">
<th scope="row">COMPAGNIA AEREA</th>
<th scope="row">NUMERO RICHIESTE</th>
<th scope="row">TOTALE SCONTI</th>
</tr>
<?
$totale_c_num = 0;
$totale_c_importo = 0;
foreach ($num_compagnie as $key => $value) {
echo '<tr class="table-light">';
echo "<td>$key</td>";
foreach ($value as $k => $v) {
$euro = '';
if($k == 'TOT_SCONTO'){
$totale_c_importo+=$v;
$euro = '&euro;.';
$v= number_format($v, 2 , ',', '.');
}
if($k == 'N_RICHIESTE'){
$totale_c_num+=$v;
}
echo "<td>$euro $v</td>";
}
echo "</tr>";
}
?>
<tr class="table-dark">
<th scope="row">TOTALE</th>
<th scope="row"><?=$totale_c_num?></th>
<th scope="row">&euro;. <?=number_format($totale_c_importo, 2 , ',', '.')?></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<? include_once ROOT . 'layout/footer.php'; ?>
</body>
</html>