Quelltext des aktuellen Standes
<?php $this->layout('layouts/admin', [
'page_title' => 'Leistungsnachweis',
'current_admin_page' => 'tickets',
]); ?>
<?php
/**
* Ansicht eines erstellten Leistungsnachweises.
* Erwartete Variablen: $report, $document.
*/
?>
<div class="settings-page">
<div class="page-back-nav">
<a href="/admin/tickets/service-reports" class="btn btn-sm btn-secondary"><?= $this->te('← Zurück zur Übersicht') ?></a>
</div>
<section class="settings-card">
<div class="settings-card-header">
<span class="settings-card-icon">📄</span>
<div>
<h2><?= $this->e((string)$report['number']) ?></h2>
<p class="settings-card-desc">
<?= $this->e((string)($report['location_name'] ?? '—')) ?>
· <?= $this->e((string)($report['recipient_email'] ?? 'keine Adresse')) ?>
</p>
</div>
</div>
<div class="settings-card-body">
<?php if (!empty($signature_url)): ?>
<div class="form-group">
<label for="sr-link"><?= $this->te('Link zum Unterschreiben') ?></label>
<input type="text" id="sr-link" class="form-control" readonly value="<?= $this->e((string)$signature_url) ?>">
<small class="form-hint"><?= $this->t('Gültig bis {datum}. Der Link steht auch im Anschreiben – hier lässt er sich auf anderem Weg weitergeben.', ['datum' => date('d.m.Y', strtotime((string)$report['signature_expires_at']))]) ?></small>
</div>
<?php endif; ?>
<div class="sr-doc"><?= $document ?></div>
</div>
</section>
<div class="form-actions-bar">
<a class="btn btn-default" href="/service-reports/<?= (int)$report['id'] ?>/pdf" target="_blank" rel="noopener"><?= $this->te('📄 Als PDF') ?></a>
<?php if ((string)$report['status'] !== 'signed'): ?>
<form method="post" action="/service-reports/<?= (int)$report['id'] ?>/cancel" style="display:inline;margin-left:auto;">
<input type="hidden" name="_csrf" value="<?= $this->e($this->csrf()) ?>">
<button class="btn btn-danger"><?= $this->te('Zurückziehen') ?></button>
</form>
<?php endif; ?>
</div>
</div>
<style>
.sr-doc table { width:100%; border-collapse:collapse; margin-top:0.75rem; }
.sr-doc th { background:var(--gray-700); color:var(--color-bg); font-size:0.78rem; padding:0.4rem 0.5rem; text-align:left; }
.sr-doc td { font-size:0.8rem; padding:0.35rem 0.5rem; border-bottom:1px solid var(--gray-200); }
.sr-doc tr.sr-group td { background:var(--gray-100); font-weight:700; }
.sr-doc tr.sr-sum td { background:var(--blue-50); font-weight:700; }
.sr-doc .sr-num { text-align:right; white-space:nowrap; }
</style>