Files
kaffeekasse-saas/resources/views/install/index.php
T
2026-06-23 00:06:31 +02:00

80 lines
3.3 KiB
PHP

<?php require __DIR__ . '/../partials/layout-top.php'; ?>
<section class="page-head">
<span class="eyebrow">Setup</span>
<h1>Plattform installieren</h1>
<p>Die Installation richtet Datenbank, Grundeinstellungen und den ersten Verwaltungszugang ein. Danach können Kaffeelisten eingerichtet werden.</p>
<?php
$availableDrivers = PDO::getAvailableDrivers();
$hasMysql = in_array('mysql', $availableDrivers);
$hasSqlite = in_array('sqlite', $availableDrivers);
?>
<?php if (!$hasMysql && $hasSqlite): ?>
<div class="alert alert-info">
<strong>Hinweis:</strong> MySQL PDO-Treiber ist nicht verfügbar. Die Installation wird automatisch SQLite verwenden.
Geben Sie "sqlite" als DB-Host ein, um SQLite explizit zu verwenden.
</div>
<?php elseif ($hasMysql && $hasSqlite): ?>
<div class="alert alert-info">
<strong>Datenbankoptionen:</strong> Sie können MySQL oder SQLite verwenden.
Für SQLite geben Sie "sqlite" als DB-Host ein.
</div>
<?php elseif (!$hasMysql && !$hasSqlite): ?>
<div class="alert alert-error">
<strong>Fehler:</strong> Weder MySQL noch SQLite PDO-Treiber sind verfügbar.
Bitte installieren Sie mindestens einen der Treiber.
</div>
<?php endif; ?>
</section>
<form class="card form-card" method="post" action="<?= e(url('/install')) ?>">
<?= csrf_field($csrf) ?>
<div class="form-grid">
<label>
<span>App-URL</span>
<input type="url" name="app_url" value="<?= e((string) old('app_url', $config['url'])) ?>" required>
</label>
<label>
<span>DB-Host</span>
<input type="text" name="db_host" value="<?= e((string) old('db_host', '127.0.0.1')) ?>" required>
</label>
<label>
<span>DB-Port</span>
<input type="number" name="db_port" value="<?= e((string) old('db_port', '3306')) ?>" required>
</label>
<label>
<span>DB-Name</span>
<input type="text" name="db_name" value="<?= e((string) old('db_name')) ?>" required>
</label>
<label>
<span>DB-User</span>
<input type="text" name="db_user" value="<?= e((string) old('db_user')) ?>" required>
</label>
<label>
<span>DB-Passwort</span>
<input type="password" name="db_pass" value="<?= e((string) old('db_pass')) ?>">
</label>
<label>
<span>Mail-Absender</span>
<input type="email" name="mail_from" value="<?= e((string) old('mail_from', 'noreply@example.com')) ?>">
</label>
<label>
<span>Admin-Name</span>
<input type="text" name="admin_name" value="<?= e((string) old('admin_name')) ?>" required>
</label>
<label>
<span>Admin-E-Mail</span>
<input type="email" name="admin_email" value="<?= e((string) old('admin_email')) ?>" required>
</label>
<label>
<span>Admin-Passwort</span>
<input type="password" name="admin_password" minlength="12" required>
</label>
</div>
<button class="button button-primary" type="submit">Installation abschließen</button>
</form>
<?php require __DIR__ . '/../partials/layout-bottom.php'; ?>