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.
68 righe
2.2 KiB
68 righe
2.2 KiB
<? |
|
$error = true; |
|
if (!isset($root)) { |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
} |
|
if (isset($_SESSION["utente"])) { |
|
if (!isset($categorieSOA)) { |
|
$categorieSOA = getCategorieSOA(); |
|
$years = []; |
|
for($i = 5;$i>0;$i--) { |
|
$years[] = (int)date("Y") - $i; |
|
} |
|
} |
|
if (!isset($fatturati)) { |
|
$id = $_POST["id"]; |
|
$codice_categoria = ""; |
|
foreach($years AS $anno) { |
|
$fatturati[$anno] = ""; |
|
} |
|
} |
|
if (!empty($categorieSOA)) { |
|
$error = false; |
|
?> |
|
<div class="card card-body mb-1"> |
|
<div class="form-group"> |
|
<label for="fatturato[<?= $id ?>][codice_categoria]"><?= __("Categoria") ?>*</label> |
|
<div class="input-group"> |
|
<select name="fatturato[<?= $id ?>][codice_categoria]" title="<?= __("Categoria") ?>" rel="S;1;0;N" class="form-control"> |
|
<option value="">...</option> |
|
<? |
|
foreach($categorieSOA AS $codice_elemento => $elemento) { |
|
?> |
|
<option value="<?= $codice_elemento ?>" <?= ($codice_elemento == $codice_categoria) ? "selected" : "" ?>> |
|
<?= $elemento["descrizione"] ?> |
|
</option> |
|
<? |
|
} |
|
?> |
|
</select> |
|
<div class="input-group-append"> |
|
<button class="btn btn-sm btn-danger" onClick="$(this).parent().parent().parent().parent().remove();"> |
|
<span class="fa fa-times"></span> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="d-flex"> |
|
<? |
|
foreach($years AS $anno) { |
|
?> |
|
<div class="flex-fill px-2 text-center form-group"> |
|
<label class="font-weight-bold" for="fatturato[<?= $id ?>][anni][<?= $anno ?>]"><?= $anno ?></label><br> |
|
<input class='form-control text-right' rel="S;0;0;2D" name="fatturato[<?= $id ?>][anni][<?= $anno ?>]" value="<?= $fatturati[$anno] ?? "" ?>" title="<?= __("Fatturato") . " " . $anno ?>"> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|