| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web31/web/invoice/ |
Upload File : |
<?php
$invoices = array();
if (file_exists('invoices.txt')) {
$lines = file('invoices.txt', FILE_IGNORE_NEW_LINES);
$current = array();
foreach ($lines as $line) {
if ($line === '### START ###') {
$current = array();
continue;
}
if ($line === '### END ###') {
if (!empty($current['invoice_number'])) {
$invoices[] = $current;
}
continue;
}
if (strpos($line, 'item:') === 0) {
$current['items'][] = substr($line, 5);
} else {
$parts = explode(':', $line, 2);
$key = $parts[0];
$val = isset($parts[1]) ? $parts[1] : '';
$current[$key] = $val;
}
}
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Rechnungsübersicht</title>
<style>
body { font-family: sans-serif; max-width: 800px; margin: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
th { background-color: #f2f2f2; }
</style>
</head>
<body>
<h1>Rechnungsübersicht</h1>
<table>
<tr>
<th>Rechnungsnummer</th>
<th>Datum</th>
<th>Empfänger</th>
<th>Aktionen</th>
</tr>
<?php foreach ($invoices as $inv): ?>
<tr>
<td><?php echo htmlspecialchars($inv['invoice_number']); ?></td>
<td><?php echo htmlspecialchars($inv['invoice_date']); ?></td>
<td><?php echo htmlspecialchars($inv['recipient']); ?></td>
<td>
<a href="form.php?edit=<?php echo urlencode($inv['invoice_number']); ?>">Bearbeiten</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>