commit 0813dc21d8e39803ffdcf014d9bf6a7cd37e6921 Author: Luki Date: Wed Feb 25 16:23:51 2026 +0100 initial commit diff --git a/UCL.png b/UCL.png new file mode 100644 index 0000000..b808236 Binary files /dev/null and b/UCL.png differ diff --git a/admin_dashboard.php b/admin_dashboard.php new file mode 100644 index 0000000..9350deb --- /dev/null +++ b/admin_dashboard.php @@ -0,0 +1,13 @@ + + +

Admin Bereich

+

Willkommen Admin !

+ +Logout \ No newline at end of file diff --git a/champions_league.sql b/champions_league.sql new file mode 100644 index 0000000..134f3e9 --- /dev/null +++ b/champions_league.sql @@ -0,0 +1,64 @@ +-- Datenbank erstellen +CREATE DATABASE IF NOT EXISTS champions_league +CHARACTER SET utf8mb4 +COLLATE utf8mb4_unicode_ci; + +USE champions_league; + +-- USERS (Login / Rollen) +CREATE TABLE IF NOT EXISTS users ( + user_id INT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + password_hash VARCHAR(255) NOT NULL, + role ENUM('admin','user') NOT NULL DEFAULT 'user' +); + +-- SEASONS (Saison) +CREATE TABLE IF NOT EXISTS seasons ( + season_id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL +); + +-- TEAMS (Teilnehmer) +CREATE TABLE IF NOT EXISTS teams ( + team_id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + country VARCHAR(50), + group_name CHAR(1) +); + +-- PLAYERS (Spieler eines Teams) +CREATE TABLE IF NOT EXISTS players ( + player_id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + position VARCHAR(30), + team_id INT NOT NULL, + FOREIGN KEY (team_id) REFERENCES teams(team_id) ON DELETE CASCADE +); + +-- MATCHES (Spiele) +CREATE TABLE IF NOT EXISTS matches ( + match_id INT AUTO_INCREMENT PRIMARY KEY, + season_id INT NOT NULL, + home_team_id INT NOT NULL, + away_team_id INT NOT NULL, + match_date DATE, + FOREIGN KEY (season_id) REFERENCES seasons(season_id), + FOREIGN KEY (home_team_id) REFERENCES teams(team_id), + FOREIGN KEY (away_team_id) REFERENCES teams(team_id), + CHECK (home_team_id <> away_team_id) +); + +-- GOAL_EVENTS (Tore + Assists) +CREATE TABLE IF NOT EXISTS goal_events ( + goal_id INT AUTO_INCREMENT PRIMARY KEY, + match_id INT NOT NULL, + scorer_id INT NOT NULL, + assist_id INT, + minute INT NOT NULL, + FOREIGN KEY (match_id) REFERENCES matches(match_id) ON DELETE CASCADE, + FOREIGN KEY (scorer_id) REFERENCES players(player_id), + FOREIGN KEY (assist_id) REFERENCES players(player_id) +); + + diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..fb2be37 --- /dev/null +++ b/dashboard.php @@ -0,0 +1,13 @@ + + +

Willkommen !

+

Rolle:

+ +Logout \ No newline at end of file diff --git a/db.php b/db.php new file mode 100644 index 0000000..22a2402 --- /dev/null +++ b/db.php @@ -0,0 +1,19 @@ + PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, +]; + +try { + $pdo = new PDO($dsn, $user, $pass, $options); +} catch (PDOException $e) { + die("Datenbankfehler: " . $e->getMessage()); +} \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..6612175 --- /dev/null +++ b/login.php @@ -0,0 +1,17 @@ + + + + Login - CL Projekt + + +

Login

+ +
+ Benutzername:

+ Passwort:

+ +
+ +Registrieren + + \ No newline at end of file diff --git a/login_process.php b/login_process.php new file mode 100644 index 0000000..bdd1e39 --- /dev/null +++ b/login_process.php @@ -0,0 +1,31 @@ +prepare($sql); +$stmt->execute([$username]); + +$user = $stmt->fetch(); + +if ($user && password_verify($password, $user['password_hash'])) { + + $_SESSION['user_id'] = $user['user_id']; + $_SESSION['username'] = $user['username']; + $_SESSION['role'] = $user['role']; + + // Rollenbasierte Weiterleitung + if ($user['role'] === 'admin') { + header("Location: admin_dashboard.php"); + } else { + header("Location: dashboard.php"); + } + exit(); + +} else { + echo "Falscher Benutzername oder Passwort!"; +} +?> \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..4ca620d --- /dev/null +++ b/logout.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..8fd6024 --- /dev/null +++ b/register.php @@ -0,0 +1,24 @@ + + + + Registrieren - CL Projekt + + +

Registrierung

+ +
+ Benutzername:

+ Passwort:

+ + Rolle: +

+ + +
+ +Zum Login + + \ No newline at end of file diff --git a/register_process.php b/register_process.php new file mode 100644 index 0000000..8fd6024 --- /dev/null +++ b/register_process.php @@ -0,0 +1,24 @@ + + + + Registrieren - CL Projekt + + +

Registrierung

+ +
+ Benutzername:

+ Passwort:

+ + Rolle: +

+ + +
+ +Zum Login + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..2783578 --- /dev/null +++ b/style.css @@ -0,0 +1,57 @@ +body { + margin: 0; + height: 100vh; + font-family: Arial, sans-serif; + background: radial-gradient(circle at top, #0a1a3f, #000814); + display: flex; + justify-content: center; + align-items: center; +} + +.login-container { + background: rgba(255, 255, 255, 0.08); + padding: 40px; + border-radius: 12px; + width: 320px; + text-align: center; + box-shadow: 0 0 30px rgba(0,0,0,0.6); +} + +.logo { + width: 100px; + margin-bottom: 15px; +} + +h2 { + color: #fff; + margin-bottom: 25px; +} + +input { + width: 100%; + padding: 12px; + margin-bottom: 15px; + border-radius: 6px; + border: none; + outline: none; +} + +button { + width: 100%; + padding: 12px; + background: #1e90ff; + border: none; + border-radius: 6px; + color: white; + font-size: 16px; + cursor: pointer; +} + +button:hover { + background: #d3d7dd; +} + +.error { + color: #ff6b6b; + margin-top: 15px; +} diff --git a/teams.php b/teams.php new file mode 100644 index 0000000..e69de29