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.
 
 
 
 
 

79 righe
3.2 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$error = true;
if (isset($_SESSION["utente"]) && !empty($_SESSION["ente"])) {
if ($_SESSION["utente"]->isSupporto() || $_SESSION["utente"]->gerarchia === 1) {
$settings = settingsManager::getSettings($_GET["gruppo"]??"");
if (!empty($settings)) {
$error = false;
?>
<form action="/backend/enti/saveSettings.php" rel="validate">
<input name="token" type="hidden" value="<?= tokenGen() ?>">
<table class="table table-striped">
<thead>
<tr>
<th><?= __("Impostazione") ?></th>
<th><?= __("Valore") ?></th>
<th width="10"><?= __("Default") ?></th>
</tr>
</thead>
<tbody>
<?
foreach($settings AS $id => $set) {
$name = "setting[{$id}]";
$rel = "N;0;0;A";
$value = settingsManager::getValue($id);
ob_start();
?>checkbox = $(this).parent().parent().find("input[type=checkbox]"); if ($(this).val() != "") { checkbox.removeAttr("checked") } else { checkbox.attr("checked","checked") } <?
$onChange = ob_get_clean();
if ($value == $set["default"]) { $value = false; }
if ($set["tipo"] == "number") { $rel = "N;0;0;N"; }
?>
<tr>
<td width="70%">
<b><?= $set["descrizione"] ?></b>
</td>
<td>
<?
if (!empty($set["options"])) {
?>
<select onChange='<?= $onChange ?>' name="<?= $name ?>" rel="<?= $rel ?>">
<option value=""><?= __("Seleziona") ?></option>
<?
foreach($set["options"] AS $val => $label) {
?>
<option <?= ($val == $value) ? "selected" : ""; ?> value="<?= $val ?>"><?= $label ?></option>
<?
}
?>
</select>
<?
} else {
?>
<input class="form-control text-center" onChange='<?= $onChange ?>' name="<?= $name ?>" rel="<?= $rel ?>" value="<?= $value ?>">
<?
}
?>
</td>
<td class="text-center">
<input name="delete[]" value="<?= $id ?>" type="checkbox" <?= ($value === false) ? "checked" : ""; ?>><br>
<small><b>[<?= $set["default"] ?>]</b></small>
</td>
</tr>
<?
}
?>
</tbody>
</table>
<button class="btn btn-block btn-success"><span class="fa fa-save"></span> <?= __("Salva") ?></button>
</form>
<?
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>