feat(phase2): aircraft market, fleet management, finances, loans

- market.php: Buy new aircraft (6 types: Dash8 to A380)
- aircraft.php: Fleet management, crew assignment, route planning
- finances.php: Account balance, transactions, loans
- Database.php: Extended with loan/transaction/aircraft methods
- schema.sql: Aircraft types table, 10M starting balance, INSERT OR IGNORE
- dashboard.php: Updated with fleet/financial overview
- Fixed: duplicate function declarations in Database.php
- Fixed: initializeSchema() with idempotent error handling
This commit is contained in:
2026-04-24 17:27:02 +02:00
parent ab5f97acbf
commit 12ddf5a185
9 changed files with 2052 additions and 36 deletions

View File

@@ -24,6 +24,10 @@ $todayStats = $db->getTodayStats($userId);
$aircraft = $db->getUserAircraft($userId);
$routes = $db->getUserRoutes($userId);
// Kredite und Finanzen
$totalDebt = $db->getTotalDebtWithInterest($userId);
$maintenanceDue = $db->checkMaintenanceDue($userId);
// Level-Fortschritt berechnen
$expForNextLevel = $config['game']['level_up_threshold'] * pow($config['game']['level_multiplier'], $user['level'] - 1);
$levelProgress = ($user['experience'] / $expForNextLevel) * 100;
@@ -47,9 +51,10 @@ $levelProgress = ($user['experience'] / $expForNextLevel) * 100;
<button class="navbar-toggle" aria-label="Menü">☰</button>
<ul class="navbar-menu">
<li><a href="<?= BASE_PATH ?>dashboard.php" class="navbar-item active">📊 Dashboard</a></li>
<li><a href="<?= BASE_PATH ?>airports.php" class="navbar-item">🌍 Weltkarte</a></li>
<li><a href="<?= BASE_PATH ?>airports.php?action=fleet" class="navbar-item">✈️ Flotte</a></li>
<li><a href="<?= BASE_PATH ?>airports.php?action=routes" class="navbar-item">🛫 Routen</a></li>
<li><a href="<?= BASE_PATH ?>airports.php" class="navbar-item">🌍 Flughäfen</a></li>
<li><a href="<?= BASE_PATH ?>aircraft.php" class="navbar-item">✈️ Flotte</a></li>
<li><a href="<?= BASE_PATH ?>finances.php" class="navbar-item">💰 Finanzen</a></li>
<li><a href="<?= BASE_PATH ?>market.php" class="navbar-item">🛒 Markt</a></li>
<li>
<span class="navbar-item">
💰 <?= formatMoney($user['balance']) ?>
@@ -124,6 +129,29 @@ $levelProgress = ($user['experience'] / $expForNextLevel) * 100;
<div class="stat-value"><?= formatNumber($stats['total_flights'] ?? 0) ?></div>
<div class="stat-label">Flüge (gesamt)</div>
</div>
<div class="stat-card">
<div class="stat-icon">🏦</div>
<div class="stat-value <?= $totalDebt > 0 ? 'text-warning' : '' ?>">
<?= formatMoney($totalDebt) ?>
</div>
<div class="stat-label">Schulden</div>
</div>
<div class="stat-card">
<div class="stat-icon">🔧</div>
<div class="stat-value <?= count($maintenanceDue) > 0 ? 'text-danger' : '' ?>">
<?= count($maintenanceDue) ?>
</div>
<div class="stat-label">Wartung fällig</div>
</div>
<?php if (!empty($maintenanceDue)): ?>
<div class="alert alert-warning mt-md mb-none">
⚠️ Bei <?= count($maintenanceDue) ?> Flugzeug(en) ist die Wartung fällig!
<a href="<?= BASE_PATH ?>aircraft.php" class="btn btn-sm btn-warning ml-md">Jetzt warten</a>
</div>
<?php endif; ?>
</div>
<!-- Quick Actions -->