Updateanpassung Drucklisten
This commit is contained in:
@@ -1759,7 +1759,7 @@ function app_print_list_detail(PDO $pdo, string $tenantId, string $listId): ?arr
|
||||
|
||||
$list['items'] = app_query_all(
|
||||
$pdo,
|
||||
'SELECT id, member_id, member_name, row_number, front_strokes, back_strokes, total_strokes FROM print_list_items WHERE print_list_id = :print_list_id ORDER BY row_number ASC',
|
||||
'SELECT id, member_id, member_name, list_position, front_strokes, back_strokes, total_strokes FROM print_list_items WHERE print_list_id = :print_list_id ORDER BY list_position ASC',
|
||||
['print_list_id' => $listId]
|
||||
);
|
||||
|
||||
@@ -1820,13 +1820,13 @@ function app_create_print_list(PDO $pdo, array $auth, array $settings, array $da
|
||||
foreach ($members as $member) {
|
||||
app_execute(
|
||||
$pdo,
|
||||
'INSERT INTO print_list_items (id, print_list_id, member_id, member_name, row_number, front_strokes, back_strokes, total_strokes, created_at, updated_at) VALUES (:id, :print_list_id, :member_id, :member_name, :row_number, 0, 0, 0, :created_at, :updated_at)',
|
||||
'INSERT INTO print_list_items (id, print_list_id, member_id, member_name, list_position, front_strokes, back_strokes, total_strokes, created_at, updated_at) VALUES (:id, :print_list_id, :member_id, :member_name, :list_position, 0, 0, 0, :created_at, :updated_at)',
|
||||
[
|
||||
'id' => app_uuid(),
|
||||
'print_list_id' => $listId,
|
||||
'member_id' => $member['id'],
|
||||
'member_name' => $member['display_name'],
|
||||
'row_number' => $rowNumber++,
|
||||
'list_position' => $rowNumber++,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]
|
||||
|
||||
@@ -620,7 +620,7 @@ $canManageTenant = app_can_manage_tenant($auth);
|
||||
<?php elseif ($page === 'exports'): ?>
|
||||
<?php if (isset($_GET['view']) && $_GET['view'] === 'print' && is_array($activePrintList)): ?>
|
||||
<section class="hero"><div class="eyebrow">PDF-Ansicht</div><h1><?= h((string) $activePrintList['title']) ?></h1><p>Diese Ansicht ist druckfertig vorbereitet. Du kannst sie im Browser direkt als PDF speichern.</p><div class="actions" style="margin-top:18px"><a class="button secondary" href="/exports/?list=<?= h((string) $activePrintList['id']) ?>">Zurück</a><button type="button" onclick="window.print()">Jetzt drucken / als PDF speichern</button></div></section>
|
||||
<section class="card"><div class="grid grid-2"><article><h2><?= h((string) ($tenantSettings['front_page_label'] ?? 'Vorderseite')) ?></h2><div class="table"><table><thead><tr><th>#</th><th>Person</th><th>Striche</th></tr></thead><tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['row_number']) ?></td><td><?= h((string) $item['member_name']) ?></td><td>________</td></tr><?php endforeach; ?></tbody></table></div></article><article><h2><?= h((string) ($tenantSettings['back_page_label'] ?? 'Rückseite')) ?></h2><div class="table"><table><thead><tr><th>#</th><th>Person</th><th>Striche</th></tr></thead><tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['row_number']) ?></td><td><?= h((string) $item['member_name']) ?></td><td>________</td></tr><?php endforeach; ?></tbody></table></div></article></div></section>
|
||||
<section class="card"><div class="grid grid-2"><article><h2><?= h((string) ($tenantSettings['front_page_label'] ?? 'Vorderseite')) ?></h2><div class="table"><table><thead><tr><th>#</th><th>Person</th><th>Striche</th></tr></thead><tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['list_position']) ?></td><td><?= h((string) $item['member_name']) ?></td><td>________</td></tr><?php endforeach; ?></tbody></table></div></article><article><h2><?= h((string) ($tenantSettings['back_page_label'] ?? 'Rückseite')) ?></h2><div class="table"><table><thead><tr><th>#</th><th>Person</th><th>Striche</th></tr></thead><tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['list_position']) ?></td><td><?= h((string) $item['member_name']) ?></td><td>________</td></tr><?php endforeach; ?></tbody></table></div></article></div></section>
|
||||
<?php else: ?>
|
||||
<section class="hero"><div class="eyebrow">Exporte und Drucklisten</div><h1>Drucklisten als PDF vorbereiten und später aus Papier nacherfassen</h1><p>Hier erzeugst du druckfertige Listen, speicherst sie als PDF und buchst anschließend die Striche aus Vorder- und Rückseite zurück ins System.</p></section>
|
||||
<section class="grid grid-2">
|
||||
@@ -677,7 +677,7 @@ $canManageTenant = app_can_manage_tenant($auth);
|
||||
<div class="table" style="margin-top:18px">
|
||||
<table>
|
||||
<thead><tr><th>#</th><th>Person</th><th>Vorderseite</th><th>Rückseite</th><th>Gesamt</th></tr></thead>
|
||||
<tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['row_number']) ?></td><td><?= h((string) $item['member_name']) ?></td><td><input type="number" min="0" step="1" name="strokes[<?= h((string) $item['id']) ?>][front]" value="<?= h((string) ($item['front_strokes'] ?? 0)) ?>"></td><td><input type="number" min="0" step="1" name="strokes[<?= h((string) $item['id']) ?>][back]" value="<?= h((string) ($item['back_strokes'] ?? 0)) ?>"></td><td><?= h((string) ($item['total_strokes'] ?? 0)) ?></td></tr><?php endforeach; ?></tbody>
|
||||
<tbody><?php foreach (($activePrintList['items'] ?? []) as $item): ?><tr><td><?= h((string) $item['list_position']) ?></td><td><?= h((string) $item['member_name']) ?></td><td><input type="number" min="0" step="1" name="strokes[<?= h((string) $item['id']) ?>][front]" value="<?= h((string) ($item['front_strokes'] ?? 0)) ?>"></td><td><input type="number" min="0" step="1" name="strokes[<?= h((string) $item['id']) ?>][back]" value="<?= h((string) ($item['back_strokes'] ?? 0)) ?>"></td><td><?= h((string) ($item['total_strokes'] ?? 0)) ?></td></tr><?php endforeach; ?></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="actions" style="margin-top:18px"><button type="submit">Striche verbuchen</button><a class="button secondary" href="/exports/?list=<?= h((string) $activePrintList['id']) ?>&view=print">Zur PDF-Ansicht</a></div>
|
||||
|
||||
@@ -26,7 +26,7 @@ CREATE TABLE IF NOT EXISTS print_list_items (
|
||||
print_list_id CHAR(36) NOT NULL,
|
||||
member_id CHAR(36) NOT NULL,
|
||||
member_name VARCHAR(255) NOT NULL,
|
||||
row_number INT NOT NULL,
|
||||
list_position INT NOT NULL,
|
||||
front_strokes INT NOT NULL DEFAULT 0,
|
||||
back_strokes INT NOT NULL DEFAULT 0,
|
||||
total_strokes INT NOT NULL DEFAULT 0,
|
||||
|
||||
Reference in New Issue
Block a user