Entdecke unsere Pakete
Entdecke unser Dienstleistungsangebot, das dich dabei unterstützt, selbstbewusst voranzukommen, egal, wohin dich dein Weg führt.
Innenarchitektur
✳︎
Neubau
✳︎
Renovierungen
✳︎
Umbauten
✳︎
Kommerzielles Design
✳︎
Innenarchitektur ✳︎ Neubau ✳︎ Renovierungen ✳︎ Umbauten ✳︎ Kommerzielles Design ✳︎
Beliebt
2025
New York
Das Atlast-Projekt →
„Die Kommunikation war einwandfrei und das Endergebnis war sogar besser, als wir es uns vorgestellt hatten. Eine rundum super Erfahrung.“
Ehemaliger Kunde
inTransaction()) {
db()->rollBack();
}
} catch (Throwable $ignored) {
}
http_response_code(500);
echo '';
foreach ($depts as $d) {
$r = $grid[$cur][(int)$d['id']] ?? null;
$state = !$r ? 'Noch nicht begonnen' : ($r['status'] === 'closed' ? 'Abgeschlossen' : 'In Arbeit');
echo ''
. '' . e($d['name']) . ''
. '' . e($state) . ''
. '' . ($r ? e(fmt_money((float)$r['total'])) : '–') . '';
}
echo ' ';
echo '
';
}
layout_foot();
}
/* =====================================================================
Abteilung: Inventurliste
===================================================================== */
function page_dept(int $deptId): void
{
$d = require_dept($deptId);
$st = db()->prepare(
'SELECT i.*, u.name AS closer,
(SELECT COUNT(*) FROM inventory_items WHERE inventory_id = i.id) AS n,
(SELECT COALESCE(SUM(quantity * price), 0) FROM inventory_items WHERE inventory_id = i.id) AS total
FROM inventories i LEFT JOIN users u ON u.id = i.closed_by
WHERE i.department_id = ? ORDER BY i.period DESC'
);
$st->execute([$deptId]);
$invs = $st->fetchAll();
$c = db()->prepare('SELECT COUNT(*) FROM articles WHERE department_id = ? AND active = 1');
$c->execute([$deptId]);
$nArt = (int)$c->fetchColumn();
layout_head($d['name'], $d, 'Monatsinventuren');
?>
prepare(
'UPDATE articles SET name = ?, category = ?, unit = ?, price = ?, active = ?
WHERE id = ? AND department_id = ?'
);
$pdo->beginTransaction();
foreach ((array)($_POST['a'] ?? []) as $id => $row) {
if (!is_array($row)) {
continue;
}
$name = clean_text($row['name'] ?? '', 150);
if ($name === '') {
continue;
}
$up->execute([
$name,
clean_text($row['category'] ?? '', 80),
clean_text($row['unit'] ?? '', 30) ?: 'Stk',
parse_num($row['price'] ?? 0),
!empty($row['active']) ? 1 : 0,
(int)$id,
$deptId,
]);
}
sync_open_inventories($deptId);
$pdo->commit();
flash('Artikel gespeichert.');
} elseif ($action === 'add') {
$name = clean_text($_POST['name'] ?? '', 150);
if ($name === '') {
flash('Bitte einen Artikelnamen eingeben.', 'err');
} else {
$pdo->prepare('INSERT INTO articles (department_id, name, category, unit, price) VALUES (?,?,?,?,?)')
->execute([$deptId, $name, clean_text($_POST['category'] ?? '', 80),
clean_text($_POST['unit'] ?? '', 30) ?: 'Stk', parse_num($_POST['price'] ?? 0)]);
sync_open_inventories($deptId);
flash('Artikel „' . $name . '“ angelegt.');
}
}
redirect($self);
}
$st = $pdo->prepare("SELECT * FROM articles WHERE department_id = ? ORDER BY active DESC, category = '', category, name");
$st->execute([$deptId]);
$arts = $st->fetchAll();
$cats = array_values(array_unique(array_filter(array_column($arts, 'category'))));
sort($cats);
layout_head('Artikel ' . $d['name'], $d, 'Artikel');
datalists($cats);
?>
Ein Fehler ist aufgetreten. Die Änderung wurde nicht gespeichert. Bitte erneut versuchen oder den Administrator informieren.
'; } /* ===================================================================== Anmeldung ===================================================================== */ function page_login(): void { if (current_user()) { redirect('index.php'); } $err = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { csrf_check(); if (($_SESSION['login_lock'] ?? 0) > time()) { $err = 'Zu viele Fehlversuche. Bitte in 5 Minuten erneut versuchen.'; } else { $st = db()->prepare('SELECT * FROM users WHERE username = ? AND active = 1'); $st->execute([trim((string)($_POST['username'] ?? ''))]); $u = $st->fetch(); if ($u && password_verify((string)($_POST['password'] ?? ''), $u['password_hash'])) { session_regenerate_id(true); $_SESSION['uid'] = (int)$u['id']; $_SESSION['seen'] = time(); unset($_SESSION['login_fail'], $_SESSION['login_lock']); if (password_needs_rehash($u['password_hash'], PASSWORD_DEFAULT)) { db()->prepare('UPDATE users SET password_hash = ? WHERE id = ?') ->execute([password_hash((string)$_POST['password'], PASSWORD_DEFAULT), $u['id']]); } redirect('index.php'); } sleep(1); $_SESSION['login_fail'] = ($_SESSION['login_fail'] ?? 0) + 1; if ($_SESSION['login_fail'] >= 5) { $_SESSION['login_lock'] = time() + 300; $_SESSION['login_fail'] = 0; } $err = 'Benutzername oder Passwort ist falsch.'; } } layout_head('Anmelden'); ?> query( 'SELECT i.id, i.department_id, i.period, i.status, (SELECT COALESCE(SUM(quantity * price), 0) FROM inventory_items WHERE inventory_id = i.id) AS total FROM inventories i ORDER BY i.period DESC' )->fetchAll(); $grid = []; foreach ($rows as $r) { $grid[$r['period']][(int)$r['department_id']] = $r; } $cur = date('Y-m'); layout_head('Übersicht'); echo 'Inventur ' . e(period_label($cur)) . '
'; echo 'Verlauf
'; if (!$grid) { echo 'Noch keine Inventuren. Sobald eine Abteilung ihre erste Inventur startet, erscheint sie hier.
'; } else { echo '| Monat | '; foreach ($depts as $d) { echo '' . e($d['name']) . ' | '; } echo 'Gesamt | |
|---|---|---|---|
| ' . e(period_label($period)) . ' | '; foreach ($depts as $d) { $r = $cols[(int)$d['id']] ?? null; if ($r) { $sum += (float)$r['total']; $mark = $r['status'] === 'open' ? ' offen' : ''; echo '' . e(fmt_money((float)$r['total'])) . '' . $mark . ' | '; } else { echo '– | '; } } echo '' . e(fmt_money($sum)) . ' |
Bisherige Inventuren
Noch keine Inventur angelegt. Wähle oben einen Monat und öffne die erste Inventur.
| Monat | Status | Positionen | Gesamtwert | Abgeschlossen | |
|---|---|---|---|---|---|
| = e(period_label($i['period'])) ?> | = $i['status'] === 'closed' ? 'Abgeschlossen' : 'In Arbeit' ?> | = (int)$i['n'] ?> | = e(fmt_money((float)$i['total'])) ?> | = $i['closed_at'] ? e(date('d.m.Y H:i', strtotime($i['closed_at']))) . ' · ' . e($i['closer'] ?? '') : '–' ?> | CSV |
Alle Artikel (= count($arts) ?>)
Noch keine Artikel. Lege oben den ersten Artikel an.
'; foreach ($cats as $c) { echo '