feat: Benutzerverwaltung um Zahlungsstatus für aktuelle Saison erweitern

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
torsten 2026-10-04 17:40:59 +02:00
parent 9767767b13
commit fd20fab5b4
3 changed files with 73 additions and 0 deletions

View file

@ -14,6 +14,7 @@ use App\Models\User;
use App\Models\Round;
use App\Models\Season;
use App\Models\Ranking;
use App\Models\Payment;
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$page = $_GET['page'] ?? null;
@ -57,6 +58,7 @@ if ($page === 'login') {
Auth::requireLogin();
Auth::requireAdmin();
$currentSeason = Season::getCurrent();
$message = null;
$error = null;
@ -83,6 +85,9 @@ if ($page === 'login') {
$_SESSION['admin_message'] = "Benutzer erfolgreich erstellt.";
} elseif ($userId) {
User::update($userId, $data);
if ($currentSeason) {
Payment::setPaidStatus($userId, $currentSeason['id'], isset($_POST['has_paid']));
}
$_SESSION['admin_message'] = "Benutzer erfolgreich aktualisiert.";
}
} elseif ($action === 'delete' && $userId) {
@ -110,6 +115,10 @@ if ($page === 'login') {
}
$users = User::getAll();
$payments = [];
if ($currentSeason) {
$payments = Payment::getPaymentsBySeason($currentSeason['id']);
}
$editUser = null;
if (isset($_GET['edit_id'])) {
$editUser = User::findById((int)$_GET['edit_id']);