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.
57 righe
2.0 KiB
57 righe
2.0 KiB
<? |
|
$error = true; |
|
if (empty($settings)) { |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && $_SESSION["utente"]->gerarchia <= 10 && !empty($_GET["modulo"])) { |
|
$reportManager = new reportManager(); |
|
$reportDisponibili = $reportManager->generalSettings; |
|
if (!empty($reportDisponibili)) { |
|
$settings = $reportDisponibili[$_GET["modulo"]] ?? null; |
|
$delete = true; |
|
$id = $_POST["id"]; |
|
} |
|
} |
|
} |
|
if (!empty($settings)) { |
|
$error = false; |
|
?> |
|
<div class="form-group"> |
|
<label for="columns[<?= $id ?>]"><?= __("Campo") ?></label> |
|
<div class="input-group"> |
|
<select name="columns[<?= $id ?>]"> |
|
<? |
|
$labelOperazione = [ |
|
"count" => "Conta", |
|
"sum" => "Somma", |
|
"avg" => "Media" |
|
]; |
|
foreach($settings["fields"] AS $idField => $field) { |
|
if (!empty($field["operazioni"])) { |
|
foreach($field["operazioni"] AS $operazione) { |
|
$idOption = $idField."#".$operazione; |
|
?> |
|
<option value="<?= $idOption ?>" <?= (!empty($colonna["name"]) && !empty($colonna["operazione"]) && ($colonna["name"]."#".$colonna["operazione"]) == $idOption) ? "selected" : "" ?>><?= $field["label"] ?> - <?= $labelOperazione[$operazione] ?></option> |
|
<? |
|
} |
|
} |
|
} |
|
?> |
|
</select> |
|
<? if (!empty($delete)) { ?> |
|
<div class="input-group-append"> |
|
<button type="button" onClick="$(this).parent().parent().parent().slideUp('fast',function() { $(this).remove(); })" class="btn btn-danger btn-sm"> |
|
<span class="fa fa-times"></span> |
|
</button> |
|
</div> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
|
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|