|
|
@@ -1,27 +1,19 @@
|
|
|
<?php
|
|
|
session_start();
|
|
|
-require_once 'config.php'; // Enthält ADMIN_PASSWORD und DB-Konstanten
|
|
|
+require_once 'config.php';
|
|
|
+require_once 'db_config.php';
|
|
|
|
|
|
-// --- 1. LOGOUT LOGIK ---
|
|
|
-if (isset($_GET['logout'])) {
|
|
|
- session_destroy();
|
|
|
- header("Location: admin.php");
|
|
|
- exit;
|
|
|
-}
|
|
|
+// --- 1. LOGIN / LOGOUT SCHUTZ ---
|
|
|
+if (isset($_GET['logout'])) { session_destroy(); header("Location: admin.php"); exit; }
|
|
|
|
|
|
-// --- 2. LOGIN SCHUTZ ---
|
|
|
$show_login = true;
|
|
|
-if (isset($_SESSION['admin_auth']) && $_SESSION['admin_auth'] === true) {
|
|
|
- $show_login = false;
|
|
|
-}
|
|
|
+if (isset($_SESSION['admin_auth']) && $_SESSION['admin_auth'] === true) { $show_login = false; }
|
|
|
|
|
|
if (isset($_POST['login_auth'])) {
|
|
|
if ($_POST['pw'] === ADMIN_PASSWORD) {
|
|
|
$_SESSION['admin_auth'] = true;
|
|
|
$show_login = false;
|
|
|
- } else {
|
|
|
- $login_error = "Falsches Passwort!";
|
|
|
- }
|
|
|
+ } else { $login_error = "Falsches Passwort!"; }
|
|
|
}
|
|
|
|
|
|
if ($show_login):
|
|
|
@@ -33,11 +25,10 @@ if ($show_login):
|
|
|
<title>Admin Login</title>
|
|
|
<style>
|
|
|
body { font-family: 'Segoe UI', sans-serif; background: #121212; color: white; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
|
|
|
- .login-box { background: #1e1e1e; padding: 40px; border-radius: 12px; border: 1px solid #e67e22; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 300px; }
|
|
|
+ .login-box { background: #1e1e1e; padding: 40px; border-radius: 12px; border: 1px solid #e67e22; text-align: center; width: 300px; }
|
|
|
input { width: 100%; padding: 12px; margin: 15px 0; border-radius: 5px; border: 1px solid #444; background: #2a2a2a; color: white; box-sizing: border-box; }
|
|
|
button { background: #e67e22; color: white; border: none; padding: 12px; border-radius: 5px; cursor: pointer; width: 100%; font-weight: bold; }
|
|
|
- .error { color: #e74c3c; margin-bottom: 10px; font-size: 0.9em; }
|
|
|
- a { color: #888; text-decoration: none; font-size: 0.8em; margin-top: 15px; display: inline-block; }
|
|
|
+ .error { color: #e74c3c; font-size: 0.9em; }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
@@ -48,172 +39,149 @@ if ($show_login):
|
|
|
<input type="password" name="pw" placeholder="Passwort" autofocus required>
|
|
|
<button type="submit" name="login_auth">Einloggen</button>
|
|
|
</form>
|
|
|
- <a href="index.php"> Zurück zum Dashboard</a>
|
|
|
</div>
|
|
|
</body>
|
|
|
</html>
|
|
|
-<?php
|
|
|
- exit;
|
|
|
-endif;
|
|
|
+<?php exit; endif; ?>
|
|
|
|
|
|
-// --- 3. HAUPT-LOGIK ---
|
|
|
-require_once 'db_config.php';
|
|
|
+<?php
|
|
|
+// --- 2. DATENBANK LOGIK ---
|
|
|
$msg = "";
|
|
|
+$msg_type = "success";
|
|
|
|
|
|
-// Bild-Download Hilfsfunktion
|
|
|
-function downloadGameImage($ean, $url) {
|
|
|
- if (!empty($ean) && filter_var($url, FILTER_VALIDATE_URL)) {
|
|
|
- $content = @file_get_contents($url);
|
|
|
- if ($content) {
|
|
|
- if (!is_dir('img')) mkdir('img', 0777, true);
|
|
|
- $path = "img/" . $ean . ".jpg";
|
|
|
- file_put_contents($path, $content);
|
|
|
- return $path;
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
-}
|
|
|
-
|
|
|
-// SPIEL HINZUFÜGEN
|
|
|
+// Spiel hinzufügen
|
|
|
if (isset($_POST['add_new_game'])) {
|
|
|
- $ean = $_POST['new_ean'];
|
|
|
- $bild_url = "https://via.placeholder.com/60?text=Kein+Bild";
|
|
|
- if (!empty($_POST['new_bild_quelle'])) {
|
|
|
- $downloaded = downloadGameImage($ean, $_POST['new_bild_quelle']);
|
|
|
- if ($downloaded) $bild_url = $downloaded;
|
|
|
+ $ean = trim($_POST['new_ean']);
|
|
|
+ $titel = trim($_POST['new_titel']);
|
|
|
+ $level = (empty($_POST['new_level']) || $_POST['new_level'] == 'Unknown') ? 'Unknown' : $_POST['new_level'];
|
|
|
+ $typ_id = ($_POST['new_typ_id'] == '0') ? null : (int)$_POST['new_typ_id'];
|
|
|
+
|
|
|
+ try {
|
|
|
+ $stmt = $pdo->prepare("INSERT INTO spiele (titel, typ_id, ean, level, bild_url) VALUES (?, ?, ?, ?, ?)");
|
|
|
+ $stmt->execute([$titel, $typ_id, $ean, $level, "https://via.placeholder.com/60?text=Scan"]);
|
|
|
+ $msg = "✅ Spiel erfolgreich angelegt!";
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ if ($e->getCode() == 23000) {
|
|
|
+ $msg = "❌ Fehler: Die EAN $ean existiert bereits!";
|
|
|
+ $msg_type = "error";
|
|
|
+ } else { $msg = "Fehler: " . $e->getMessage(); }
|
|
|
}
|
|
|
- $stmt = $pdo->prepare("INSERT INTO spiele (titel, typ_id, ean, level, bild_url) VALUES (?, ?, ?, ?, ?)");
|
|
|
- $stmt->execute([
|
|
|
- $_POST['new_titel'],
|
|
|
- ($_POST['new_typ_id'] == '0' ? null : (int)$_POST['new_typ_id']),
|
|
|
- $ean,
|
|
|
- $_POST['new_level'],
|
|
|
- $bild_url
|
|
|
- ]);
|
|
|
- $msg = "Spiel erfolgreich angelegt!";
|
|
|
}
|
|
|
|
|
|
-// SPIEL AKTUALISIEREN
|
|
|
+// Spiel aktualisieren
|
|
|
if (isset($_POST['update_game'])) {
|
|
|
- $spiel_id = (int)$_POST['spiel_id'];
|
|
|
- $ean = $_POST['ean'];
|
|
|
- if (!empty($_POST['update_bild_quelle'])) {
|
|
|
- $new_path = downloadGameImage($ean, $_POST['update_bild_quelle']);
|
|
|
- if ($new_path) $pdo->prepare("UPDATE spiele SET bild_url = ? WHERE id = ?")->execute([$new_path, $spiel_id]);
|
|
|
- }
|
|
|
$stmt = $pdo->prepare("UPDATE spiele SET titel = ?, typ_id = ?, ean = ?, level = ? WHERE id = ?");
|
|
|
- $stmt->execute([
|
|
|
- $_POST['titel'],
|
|
|
- ($_POST['typ_id'] == '0' ? null : (int)$_POST['typ_id']),
|
|
|
- $ean,
|
|
|
- $_POST['level'],
|
|
|
- $spiel_id
|
|
|
- ]);
|
|
|
- $msg = "Änderungen gespeichert!";
|
|
|
+ $stmt->execute([$_POST['titel'], ($_POST['typ_id'] == '0' ? null : (int)$_POST['typ_id']), $_POST['ean'], $_POST['level'], (int)$_POST['spiel_id']]);
|
|
|
+ $msg = "💾 Änderungen gespeichert!";
|
|
|
}
|
|
|
|
|
|
-// SPIEL LÖSCHEN
|
|
|
+// Löschen
|
|
|
if (isset($_POST['delete_game'])) {
|
|
|
$pdo->prepare("DELETE FROM spiele WHERE id = ?")->execute([(int)$_POST['spiel_id']]);
|
|
|
- $msg = "Spiel wurde gelöscht!";
|
|
|
+ $msg = "🗑 Spiel gelöscht!";
|
|
|
}
|
|
|
|
|
|
-// GRUPPEN & TYPEN LOGIK
|
|
|
-if (isset($_POST['add_player'])) { $pdo->prepare("INSERT INTO spieler (name) VALUES (?)")->execute([$_POST['player_name']]); }
|
|
|
-if (isset($_POST['delete_player'])) { $pdo->prepare("DELETE FROM spieler WHERE id = ?")->execute([(int)$_POST['player_id']]); }
|
|
|
-if (isset($_POST['add_type'])) { $pdo->prepare("INSERT INTO game_typen (bezeichnung) VALUES (?)")->execute([$_POST['type_name']]); }
|
|
|
-if (isset($_POST['delete_type'])) { $pdo->prepare("DELETE FROM game_typen WHERE id = ?")->execute([(int)$_POST['type_id']]); }
|
|
|
-
|
|
|
-// DATEN LADEN
|
|
|
+// Daten abrufen
|
|
|
$spiele = $pdo->query("SELECT s.*, t.bezeichnung as typ_name FROM spiele s LEFT JOIN game_typen t ON s.typ_id = t.id ORDER BY s.id DESC")->fetchAll();
|
|
|
-$spieler = $pdo->query("SELECT * FROM spieler ORDER BY id ASC")->fetchAll();
|
|
|
$typen = $pdo->query("SELECT * FROM game_typen ORDER BY bezeichnung ASC")->fetchAll();
|
|
|
?>
|
|
|
+
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="de">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
- <title>EXIT Admin - Verwaltung</title>
|
|
|
+ <title>EXIT Admin - Stammdaten</title>
|
|
|
<style>
|
|
|
- body { font-family: 'Segoe UI', sans-serif; background: #f4f7f6; padding: 20px; color: #333; }
|
|
|
+ body { font-family: 'Segoe UI', sans-serif; background: #f4f7f6; padding: 20px; }
|
|
|
.container { max-width: 1200px; margin: 0 auto; }
|
|
|
- .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
|
|
|
- .alert { background: #27ae60; color: white; padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; font-weight: bold; }
|
|
|
- .tabs { display: flex; gap: 5px; }
|
|
|
- .tab-button { padding: 12px 25px; cursor: pointer; background: #ddd; border: none; border-radius: 8px 8px 0 0; font-weight: bold; }
|
|
|
- .tab-button.active { background: #fff; border-top: 4px solid #e67e22; color: #e67e22; }
|
|
|
- .tab-content { background: #fff; padding: 25px; border-radius: 0 8px 8px 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: none; }
|
|
|
- .tab-content.active { display: block; }
|
|
|
- table { width: 100%; border-collapse: collapse; margin-top: 15px; }
|
|
|
+ .alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; text-align: center; }
|
|
|
+ .alert-success { background: #27ae60; color: white; }
|
|
|
+ .alert-error { background: #e74c3c; color: white; }
|
|
|
+
|
|
|
+ .admin-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; }
|
|
|
+ table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
|
|
th, td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }
|
|
|
- input, select { padding: 8px; border: 1px solid #ddd; border-radius: 5px; width: 100%; box-sizing: border-box; }
|
|
|
- .btn { padding: 8px 15px; border: none; border-radius: 5px; color: white; cursor: pointer; font-weight: bold; text-decoration: none; display: inline-block; }
|
|
|
- .btn-add { background: #27ae60; } .btn-save { background: #2980b9; } .btn-del { background: #e74c3c; } .logout { background: #c0392b; font-size: 0.8em; }
|
|
|
+ input, select { padding: 10px; border: 1px solid #ddd; border-radius: 6px; width: 100%; box-sizing: border-box; }
|
|
|
+
|
|
|
+ /* Unbekannt Styling */
|
|
|
+ .lvl-unknown { background: #f39c12 !important; color: white; }
|
|
|
+ .btn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; color: white; text-decoration: none; display: inline-block; }
|
|
|
+ .btn-add { background: #27ae60; width: 100%; margin-top: 10px; }
|
|
|
+ .btn-save { background: #2980b9; }
|
|
|
+ .btn-del { background: #e74c3c; }
|
|
|
+ .btn-nav { background: #e67e22; }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
<div class="container">
|
|
|
- <div class="header">
|
|
|
- <h1>🛠 Stammdaten</h1>
|
|
|
+ <div style="display:flex; justify-content: space-between; align-items: center;">
|
|
|
+ <h1>🛠 Stammdaten Verwaltung</h1>
|
|
|
<div>
|
|
|
- <a href="index.php" class="btn btn-save">Dashboard</a>
|
|
|
- <a href="admin.php?logout=1" class="btn logout">Abmelden 🚪</a>
|
|
|
+ <a href="index.php" class="btn btn-nav">Dashboard</a>
|
|
|
+ <a href="admin.php?logout=1" class="btn btn-del">Logout</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <?php if ($msg): ?><div class="alert" id="msg-box"><?= $msg ?></div><?php endif; ?>
|
|
|
+ <?php if ($msg): ?>
|
|
|
+ <div class="alert alert-<?= $msg_type ?>" id="msg-box"><?= $msg ?></div>
|
|
|
+ <?php endif; ?>
|
|
|
|
|
|
- <div class="tabs">
|
|
|
- <button class="tab-button active" onclick="openTab(event, 'tab-spiele')">🎮 Spiele</button>
|
|
|
- <button class="tab-button" onclick="openTab(event, 'tab-gruppen')">👥 Gruppen</button>
|
|
|
- <button class="tab-button" onclick="openTab(event, 'tab-typen')">🏷 Typen</button>
|
|
|
+ <div class="admin-card">
|
|
|
+ <h3>🆕 Neues Spiel hinzufügen</h3>
|
|
|
+ <form method="POST">
|
|
|
+ <div style="display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr; gap: 15px;">
|
|
|
+ <input type="text" name="new_titel" placeholder="Spieltitel" required>
|
|
|
+ <input type="text" name="new_ean" placeholder="EAN Scannen" required>
|
|
|
+ <select name="new_typ_id">
|
|
|
+ <option value="0">-- Typ: Unbekannt --</option>
|
|
|
+ <?php foreach($typen as $t): ?>
|
|
|
+ <option value="<?= $t['id'] ?>"><?= htmlspecialchars($t['bezeichnung']) ?></option>
|
|
|
+ <?php endforeach; ?>
|
|
|
+ </select>
|
|
|
+ <select name="new_level">
|
|
|
+ <option value="Unknown" selected>-- Level: Unbekannt --</option>
|
|
|
+ <option value="Einsteiger">Einsteiger</option>
|
|
|
+ <option value="Fortgeschrittene">Fortgeschrittene</option>
|
|
|
+ <option value="Profi">Profi</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <button type="submit" name="add_new_game" class="btn btn-add">Spiel in Datenbank speichern</button>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
|
|
|
- <div id="tab-spiele" class="tab-content active">
|
|
|
- <div style="background:#f9f9f9; padding:20px; border-radius:8px; border:1px solid #eee; margin-bottom:30px;">
|
|
|
- <h3>🆕 Neues Spiel erfassen</h3>
|
|
|
- <form method="POST">
|
|
|
- <div style="display:grid; grid-template-columns: 2fr 1fr 1fr 1fr 2fr; gap:10px;">
|
|
|
- <input type="text" name="new_titel" placeholder="Spieltitel" required>
|
|
|
- <select name="new_typ_id">
|
|
|
- <option value="0">-- Typ: Unknown --</option>
|
|
|
- <?php foreach($typen as $t): ?><option value="<?= $t['id'] ?>"><?= htmlspecialchars($t['bezeichnung']) ?></option><?php endforeach; ?>
|
|
|
- </select>
|
|
|
- <input type="text" name="new_ean" placeholder="EAN" required>
|
|
|
- <select name="new_level">
|
|
|
- <option value="Unknown" selected>-- Level: Unknown --</option>
|
|
|
- <option value="Einsteiger">Einsteiger</option>
|
|
|
- <option value="Fortgeschrittene">Fortgeschrittene</option>
|
|
|
- <option value="Profi">Profi</option>
|
|
|
- </select>
|
|
|
- <input type="text" name="new_bild_quelle" placeholder="Bild-URL (Download)">
|
|
|
- </div>
|
|
|
- <button type="submit" name="add_new_game" class="btn btn-add" style="margin-top:15px; width:100%;">Spiel in Datenbank speichern</button>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <div class="admin-card">
|
|
|
+ <h3>📋 Aktueller Bestand</h3>
|
|
|
<table>
|
|
|
- <thead><tr><th>Bild</th><th>Titel & Typ</th><th>EAN</th><th>Level</th><th>Aktion</th></tr></thead>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Titel</th>
|
|
|
+ <th>EAN</th>
|
|
|
+ <th>Typ</th>
|
|
|
+ <th>Level</th>
|
|
|
+ <th>Aktion</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
<tbody>
|
|
|
- <?php foreach ($spiele as $sp): ?>
|
|
|
+ <?php foreach ($spiele as $sp):
|
|
|
+ $is_unknown = ($sp['level'] == 'Unknown' || empty($sp['level']));
|
|
|
+ ?>
|
|
|
<tr>
|
|
|
<form method="POST">
|
|
|
<input type="hidden" name="spiel_id" value="<?= $sp['id'] ?>">
|
|
|
- <td width="60"><img src="<?= $sp['bild_url'] ?>" width="50" style="border-radius:4px;" onerror="this.src='https://via.placeholder.com/50?text=?'"></td>
|
|
|
+ <td><input type="text" name="titel" value="<?= htmlspecialchars($sp['titel']) ?>"></td>
|
|
|
+ <td><input type="text" name="ean" value="<?= htmlspecialchars($sp['ean']) ?>"></td>
|
|
|
<td>
|
|
|
- <input type="text" name="titel" value="<?= htmlspecialchars($sp['titel']) ?>" style="margin-bottom:5px;">
|
|
|
<select name="typ_id">
|
|
|
- <option value="0" <?= $sp['typ_id'] == null ? 'selected' : '' ?>>-- Unknown --</option>
|
|
|
+ <option value="0">-- Unbekannt --</option>
|
|
|
<?php foreach($typen as $t): ?>
|
|
|
- <option value="<?= $t['id'] ?>" <?= $sp['typ_id']==$t['id']?'selected':'' ?>><?= htmlspecialchars($t['bezeichnung']) ?></option>
|
|
|
+ <option value="<?= $t['id'] ?>" <?= ($sp['typ_id']==$t['id'])?'selected':'' ?>><?= htmlspecialchars($t['bezeichnung']) ?></option>
|
|
|
<?php endforeach; ?>
|
|
|
</select>
|
|
|
</td>
|
|
|
- <td><input type="text" name="ean" value="<?= htmlspecialchars($sp['ean']) ?>"></td>
|
|
|
<td>
|
|
|
- <select name="level">
|
|
|
- <option value="Unknown" <?= ($sp['level'] == 'Unknown' || empty($sp['level'])) ? 'selected' : '' ?>>Unknown</option>
|
|
|
+ <select name="level" class="<?= $is_unknown ? 'lvl-unknown' : '' ?>" onchange="this.className=this.value=='Unknown'?'lvl-unknown':''">
|
|
|
+ <option value="Unknown" <?= $is_unknown ? 'selected' : '' ?>>Unbekannt</option>
|
|
|
<option value="Einsteiger" <?= $sp['level']=='Einsteiger'?'selected':'' ?>>Einsteiger</option>
|
|
|
<option value="Fortgeschrittene" <?= $sp['level']=='Fortgeschrittene'?'selected':'' ?>>Fortgeschrittene</option>
|
|
|
<option value="Profi" <?= $sp['level']=='Profi'?'selected':'' ?>>Profi</option>
|
|
|
@@ -221,7 +189,7 @@ $typen = $pdo->query("SELECT * FROM game_typen ORDER BY bezeichnung ASC")->fetch
|
|
|
</td>
|
|
|
<td style="white-space:nowrap;">
|
|
|
<button type="submit" name="update_game" class="btn btn-save">💾</button>
|
|
|
- <button type="submit" name="delete_game" class="btn btn-del" onclick="return confirm('Löschen?')">🗑</button>
|
|
|
+ <button type="submit" name="delete_game" class="btn btn-del" onclick="return confirm('Wirklich löschen?')">🗑</button>
|
|
|
</td>
|
|
|
</form>
|
|
|
</tr>
|
|
|
@@ -229,45 +197,15 @@ $typen = $pdo->query("SELECT * FROM game_typen ORDER BY bezeichnung ASC")->fetch
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
-
|
|
|
- <div id="tab-gruppen" class="tab-content">
|
|
|
- <h3>👥 Teams / Spieler</h3>
|
|
|
- <form method="POST" style="display:flex; gap:10px; margin-bottom:20px;">
|
|
|
- <input type="text" name="player_name" placeholder="Name der Gruppe" required>
|
|
|
- <button type="submit" name="add_player" class="btn btn-add">Anlegen</button>
|
|
|
- </form>
|
|
|
- <table>
|
|
|
- <?php foreach ($spieler as $s): ?>
|
|
|
- <tr><td><?= htmlspecialchars($s['name']) ?></td><td><form method="POST"><input type="hidden" name="player_id" value="<?= $s['id'] ?>"><button type="submit" name="delete_player" class="btn btn-del">🗑</button></form></td></tr>
|
|
|
- <?php endforeach; ?>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id="tab-typen" class="tab-content">
|
|
|
- <h3>🏷 Spiel-Typen</h3>
|
|
|
- <form method="POST" style="display:flex; gap:10px; margin-bottom:20px;">
|
|
|
- <input type="text" name="type_name" placeholder="Typ-Bezeichnung" required>
|
|
|
- <button type="submit" name="add_type" class="btn btn-add">Anlegen</button>
|
|
|
- </form>
|
|
|
- <table>
|
|
|
- <?php foreach ($typen as $t): ?>
|
|
|
- <tr><td><?= htmlspecialchars($t['bezeichnung']) ?></td><td><form method="POST"><input type="hidden" name="type_id" value="<?= $t['id'] ?>"><button type="submit" name="delete_type" class="btn btn-del">🗑</button></form></td></tr>
|
|
|
- <?php endforeach; ?>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
- function openTab(evt, tabName) {
|
|
|
- var i, tabcontent, tablinks;
|
|
|
- tabcontent = document.getElementsByClassName("tab-content");
|
|
|
- for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; }
|
|
|
- tablinks = document.getElementsByClassName("tab-button");
|
|
|
- for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); }
|
|
|
- document.getElementById(tabName).style.display = "block";
|
|
|
- evt.currentTarget.className += " active";
|
|
|
- }
|
|
|
- setTimeout(function() { var msg = document.getElementById('msg-box'); if(msg) msg.style.display = 'none'; }, 3000);
|
|
|
+ // Nachricht nach 3 Sek ausblenden
|
|
|
+ setTimeout(() => {
|
|
|
+ const msg = document.getElementById('msg-box');
|
|
|
+ if(msg) msg.style.display = 'none';
|
|
|
+ }, 3000);
|
|
|
</script>
|
|
|
+
|
|
|
</body>
|
|
|
</html>
|