redesign for mulituser

change validation concept (client and server)
using entities
This commit is contained in:
Markus
2026-10-06 08:55:35 +02:00
parent 14e050e4ba
commit 995e2ec111
41 changed files with 2402 additions and 1223 deletions

View File

@@ -0,0 +1,56 @@
<?php
if (!$template) {
$parentList = $booking['cat_parent'][$i];
$subList = $booking['cat_sub'][$i];
$account_id = $booking['account_id'][$i];
$parent_id = $booking['parent_id'][$i];
$comment = $booking['comment'][$i];
$input = $booking['input'][$i];
$output = $booking['output'][$i];
$sid = $booking['sid'][$i];
} else {
$i = 0;
$account_id = 0;
$parent_id = 0;
$parentList = $booking['category']['parent'];
$subList = $booking['category']['subs']->{$parent_id};
$comment = '';
$input = '';
$output = '';
$sid = 0;
}
?>
<div <?=(($template)?'id="template"':'')?> class="row <?=(($template)?'d-none':'')?>">
<input type="hidden" value="<?= $sid ?>" name="sid[]">
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0">
<select name="parent_id[]" class="form-select parent" <?=(($i==0 && !$template)?'required':'')?>>
<option value="">----</option>
<?php foreach ($parentList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $parent_id)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0" <?=(($i==0 && !$template)?'required':'')?>>
<select name="account_id[]" class="form-select sub">
<?php foreach ($subList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $account_id && $account_id>0)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="w-100 d-md-none"></div>
<div class="col-lg-2 col-6 <?=(($i>0)?'multi':'')?> <?= ($booking['transfer']?' d-none':'') ?> px-0 order-sm-2">
<input type="text" name="input[]" class="form-control dt-subamount input" placeholder="Einnahme" value="<?= $input ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)">
</div>
<div class="<?= ($booking['transfer']?'col-lg-4 col-12':'col-lg-2 col-6') ?> <?=(($i>0)?'multi':'')?> px-0 order-sm-2">
<input type="text" name="output[]" placeholder="Ausgabe" value="<?= $output ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)" class="form-control dt-subamount output text-danger" >
</div>
<div class="col-lg-2 col-12 col-md-12 <?=(($i>0)?'multi':'')?> order-sm-1 px-0 mb-3 mb-md-0">
<input type="text" name="comment[]" class="form-control" placeholder="Kommentar" value="<?= $comment ?>">
</div>
</div>