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.
137 righe
5.2 KiB
137 righe
5.2 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
|
|
$required_js[] = "/src/highcharts/modules/exporting.js"; |
|
$required_js[] = "/src/highcharts/modules/offline-exporting.js"; |
|
$required_js[] = "/src/highcharts/modules/drilldown.js"; |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb[""] = __("Elaborazioni"); |
|
include_once ($beRoot."/layout/top.php"); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
$reportManager = new reportManager(); |
|
$reportDisponibili = $reportManager->generalSettings; |
|
if (!empty($reportDisponibili)) { |
|
$elaborazioniRichieste = []; |
|
if (!empty($_POST["report"])) { |
|
foreach($_POST["report"] AS $modulo => $templates) { |
|
foreach($templates AS $template) { |
|
$infoTemplate = $reportDisponibili[$modulo]["templates"][$template] ?? null; |
|
if (!empty($infoTemplate)) { |
|
if (!isset($elaborazioniRichieste[$modulo])) { |
|
$elaborazioniRichieste[$modulo] = []; |
|
} |
|
$elaborazioniRichieste[$modulo][$template] = $infoTemplate; |
|
} |
|
} |
|
} |
|
} |
|
if (!empty($elaborazioniRichieste)) { |
|
$reportManager = new reportManager(); |
|
$reportManager->from = date2mysql($_POST["data_inizio"]); |
|
$reportManager->to = date2mysql($_POST["data_fine"]); |
|
$reportManager->group = $_POST["raggruppamento"] ?? "M"; |
|
$reportManager->richieste = $elaborazioniRichieste; |
|
$reportManager->filters = $_POST["filtro"] ?? null; |
|
$grafici = $reportManager->genera(); |
|
session_write_close(); |
|
if (!empty($grafici)) { |
|
?> |
|
<script> |
|
var charts = []; |
|
</script> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 col-lg-4"> |
|
<div class="card card-body"> |
|
<?= __("Data inizio") ?><br> |
|
<?= mysql2date($reportManager->from) ?> |
|
</div> |
|
</div> |
|
<div class="col-12 col-lg-4"> |
|
<div class="card card-body"> |
|
<?= __("Data fine") ?><br> |
|
<?= mysql2date($reportManager->to) ?> |
|
</div> |
|
</div> |
|
<div class="col-12 col-lg-4"> |
|
<div class="card card-body"> |
|
<?= __("Raggruppa per") ?><br> |
|
<? |
|
switch($reportManager->group) { |
|
case "W": echo __("Settimane"); break; |
|
case "M": echo __("Mesi"); break; |
|
case "Y": echo __("Anni"); break; |
|
} |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
foreach($grafici AS $modulo => $graphs) { |
|
$infoModulo = Modulo::getInfo($modulo); |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<span class="h3 card-title"><?= $infoModulo["titolo"] ?></span> |
|
<a class="float-right btn btn-info" target="_blank" href="/backend/report/exportCSV.php?modulo=<?= $modulo ?>&token=<?= $reportManager->tokenElaborazione ?>"><span class='fa fa-download'></span> <?= __("Download CSV") ?></a> |
|
</div> |
|
<div class="card-body" id="report-<?= $modulo ?>"> |
|
<div class="row"> |
|
<? |
|
foreach($graphs AS $graph) { |
|
?> |
|
<div class="col-12 col-lg-4 my-2"> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<span class="card-title"> |
|
<strong><?= $graph["info"]["titolo"] ?></strong><br> |
|
<small><?= $graph["info"]["descrizione"] ?? "" ?></small> |
|
</span> |
|
|
|
</div> |
|
</div> |
|
<div class="card-body bg-white"> |
|
<?= $graph["html"] ?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
if (!empty($reportManager->errors)) { |
|
$errors = implode("<br>",$reportManager->errors); |
|
alertManager::printWarningBox(__("Errori di elaborazione"),$errors); |
|
} |
|
} else { |
|
alertManager::printWarningBox(__("Nessun report richiesto")); |
|
} |
|
} else { |
|
alertManager::printWarningBox(__("Nessun report disponibile")); |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|