feat: added Sessionstart to header; changed navlinks in header; rework registration of services; created employee list with refund; created function for getting avatar and insert entry; changed data fetch for user; new style added
This commit is contained in:
50
callback.php
50
callback.php
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
$config = require 'config.php';
|
$config = require 'config.php';
|
||||||
|
require 'db.php'; // Stelle sicher, dass hier die $dbhandle-Verbindung aufgebaut wird
|
||||||
|
|
||||||
if (!isset($_GET['code'])) {
|
if (!isset($_GET['code'])) {
|
||||||
die('Keine Autorisierungscode empfangen');
|
die('Keine Autorisierungscode empfangen');
|
||||||
@@ -50,7 +51,7 @@ if (isset($guild_member['message'])) {
|
|||||||
die('Du bist nicht auf dem Discord-Server.');
|
die('Du bist nicht auf dem Discord-Server.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🆕 Rollen-ID → Rollenname Mapping
|
// Rollen-ID → Rollenname Mapping
|
||||||
$role_names = [
|
$role_names = [
|
||||||
"1350944151381999666" => "Geschäftsführung",
|
"1350944151381999666" => "Geschäftsführung",
|
||||||
"1350944244843544709" => "Stv. Geschäftsführung",
|
"1350944244843544709" => "Stv. Geschäftsführung",
|
||||||
@@ -60,22 +61,12 @@ $role_names = [
|
|||||||
"1350945530519224320" => "Meister",
|
"1350945530519224320" => "Meister",
|
||||||
"1350945581194809376" => "Tuner",
|
"1350945581194809376" => "Tuner",
|
||||||
"1350945688560861285" => "Stift"
|
"1350945688560861285" => "Stift"
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 🆕 Rollen-Rang (höchste zuerst)
|
// Rollen-Rang (höchste zuerst)
|
||||||
$role_order = [
|
$role_order = array_keys($role_names);
|
||||||
"1350944151381999666",
|
|
||||||
"1350944244843544709",
|
|
||||||
"1350943536891297914",
|
|
||||||
"1350945302395224206",
|
|
||||||
"1350945473338544138",
|
|
||||||
"1350945530519224320",
|
|
||||||
"1350945581194809376",
|
|
||||||
"1350945688560861285"
|
|
||||||
];
|
|
||||||
|
|
||||||
// 🆕 Höchste Rolle finden
|
// Höchste Rolle finden
|
||||||
$main_role_name = "Mitglied"; // Fallback
|
$main_role_name = "Mitglied"; // Fallback
|
||||||
foreach ($role_order as $role_id) {
|
foreach ($role_order as $role_id) {
|
||||||
if (in_array($role_id, $guild_member['roles'])) {
|
if (in_array($role_id, $guild_member['roles'])) {
|
||||||
@@ -87,15 +78,40 @@ foreach ($role_order as $role_id) {
|
|||||||
// Rollen prüfen (ob die Person die „Adminrolle“ hat)
|
// Rollen prüfen (ob die Person die „Adminrolle“ hat)
|
||||||
$hasRole = in_array($config['role_id'], $guild_member['roles']);
|
$hasRole = in_array($config['role_id'], $guild_member['roles']);
|
||||||
|
|
||||||
|
// Server-Nickname oder globalen Username nehmen
|
||||||
|
$nickname = $guild_member['nick'] ?? $user['username'];
|
||||||
|
|
||||||
|
// ✅ Prüfen ob User schon in der Datenbank existiert
|
||||||
|
$stmt = $dbhandle->prepare("SELECT id FROM users WHERE discord_id = ?");
|
||||||
|
$stmt->bind_param("s", $user['id']);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->store_result();
|
||||||
|
|
||||||
|
if ($stmt->num_rows > 0) {
|
||||||
|
// User existiert → hole interne User-ID
|
||||||
|
$stmt->bind_result($user_id);
|
||||||
|
$stmt->fetch();
|
||||||
|
} else {
|
||||||
|
// User existiert nicht → neuen Eintrag erstellen
|
||||||
|
$insert = $dbhandle->prepare("INSERT INTO users (discord_id, discord_name) VALUES (?, ?)");
|
||||||
|
$insert->bind_param("ss", $user['id'], $nickname);
|
||||||
|
$insert->execute();
|
||||||
|
$user_id = $insert->insert_id;
|
||||||
|
$insert->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt->close();
|
||||||
|
|
||||||
// Session setzen
|
// Session setzen
|
||||||
$_SESSION['user'] = [
|
$_SESSION['user'] = [
|
||||||
'id' => $user['id'],
|
'id' => $user_id, // interne DB-ID
|
||||||
|
'discord_id' => $user['id'],
|
||||||
'username' => $user['username'],
|
'username' => $user['username'],
|
||||||
'discriminator' => $user['discriminator'],
|
'discriminator' => $user['discriminator'],
|
||||||
'avatar' => $user['avatar'],
|
'avatar' => $user['avatar'],
|
||||||
'hasRole' => $hasRole,
|
'hasRole' => $hasRole,
|
||||||
'nickname' => $guild_member['nick'] ?? $user['username'], // Nick wenn vorhanden
|
'nickname' => $nickname, // Server-Nickname
|
||||||
'main_role' => $main_role_name // 🆕 höchster Rollenname
|
'main_role' => $main_role_name
|
||||||
];
|
];
|
||||||
|
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
|
|||||||
103
callback.php.bak
Normal file
103
callback.php.bak
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
$config = require 'config.php';
|
||||||
|
|
||||||
|
if (!isset($_GET['code'])) {
|
||||||
|
die('Keine Autorisierungscode empfangen');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token holen
|
||||||
|
$ch = curl_init('https://discord.com/api/oauth2/token');
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
|
||||||
|
'client_id' => $config['client_id'],
|
||||||
|
'client_secret' => $config['client_secret'],
|
||||||
|
'grant_type' => 'authorization_code',
|
||||||
|
'code' => $_GET['code'],
|
||||||
|
'redirect_uri' => $config['redirect_uri'],
|
||||||
|
'scope' => 'identify guilds.members.read'
|
||||||
|
]));
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
|
||||||
|
if (!isset($data['access_token'])) {
|
||||||
|
die('Fehler beim Token-Austausch');
|
||||||
|
}
|
||||||
|
|
||||||
|
$access_token = $data['access_token'];
|
||||||
|
|
||||||
|
// API Request Funktion
|
||||||
|
function apiRequest($url, $token) {
|
||||||
|
$ch = curl_init($url);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
|
"Authorization: Bearer $token"
|
||||||
|
]);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return json_decode($response, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// User-Daten holen
|
||||||
|
$user = apiRequest('https://discord.com/api/users/@me', $access_token);
|
||||||
|
|
||||||
|
// Mitgliedschaft prüfen
|
||||||
|
$guild_member = apiRequest("https://discord.com/api/users/@me/guilds/{$config['guild_id']}/member", $access_token);
|
||||||
|
|
||||||
|
if (isset($guild_member['message'])) {
|
||||||
|
die('Du bist nicht auf dem Discord-Server.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🆕 Rollen-ID → Rollenname Mapping
|
||||||
|
$role_names = [
|
||||||
|
"1350944151381999666" => "Geschäftsführung",
|
||||||
|
"1350944244843544709" => "Stv. Geschäftsführung",
|
||||||
|
"1350943536891297914" => "Leitungsebene",
|
||||||
|
"1350945302395224206" => "Werkstattleiter",
|
||||||
|
"1350945473338544138" => "Ausbilder",
|
||||||
|
"1350945530519224320" => "Meister",
|
||||||
|
"1350945581194809376" => "Tuner",
|
||||||
|
"1350945688560861285" => "Stift"
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
// 🆕 Rollen-Rang (höchste zuerst)
|
||||||
|
$role_order = [
|
||||||
|
"1350944151381999666",
|
||||||
|
"1350944244843544709",
|
||||||
|
"1350943536891297914",
|
||||||
|
"1350945302395224206",
|
||||||
|
"1350945473338544138",
|
||||||
|
"1350945530519224320",
|
||||||
|
"1350945581194809376",
|
||||||
|
"1350945688560861285"
|
||||||
|
];
|
||||||
|
|
||||||
|
// 🆕 Höchste Rolle finden
|
||||||
|
$main_role_name = "Mitglied"; // Fallback
|
||||||
|
foreach ($role_order as $role_id) {
|
||||||
|
if (in_array($role_id, $guild_member['roles'])) {
|
||||||
|
$main_role_name = $role_names[$role_id];
|
||||||
|
break; // erste gefundene Rolle nehmen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rollen prüfen (ob die Person die „Adminrolle“ hat)
|
||||||
|
$hasRole = in_array($config['role_id'], $guild_member['roles']);
|
||||||
|
|
||||||
|
// Session setzen
|
||||||
|
$_SESSION['user'] = [
|
||||||
|
'id' => $user['id'],
|
||||||
|
'username' => $user['username'],
|
||||||
|
'discriminator' => $user['discriminator'],
|
||||||
|
'avatar' => $user['avatar'],
|
||||||
|
'hasRole' => $hasRole,
|
||||||
|
'nickname' => $guild_member['nick'] ?? $user['username'], // Nick wenn vorhanden
|
||||||
|
'main_role' => $main_role_name // 🆕 höchster Rollenname
|
||||||
|
];
|
||||||
|
|
||||||
|
header('Location: index.php');
|
||||||
|
exit;
|
||||||
|
?>
|
||||||
6
db.php
6
db.php
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$mysqli = new mysqli("ioannisdev.de", "samp", "Kokoras_12!!", "Alphacar");
|
$dbhandle = new mysqli("ioannisdev.de", "samp", "Kokoras_12!!", "Alphacar");
|
||||||
|
|
||||||
if($mysqli -> connect_errno) {
|
if($dbhandle -> connect_errno) {
|
||||||
echo "Fehler beim verbinden: " . $mysqli -> connect_error;
|
echo "Fehler beim verbinden: " . $dbhandle -> connect_error;
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -1,8 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
function insertentry(){
|
function insertEntry($conn, $userId, $service, $name) {
|
||||||
|
// Query vorbereiten
|
||||||
|
$stmt = $conn->prepare("INSERT INTO contracts (clientid, service, name) VALUES (?, ?, ?)");
|
||||||
|
$stmt->bind_param("iss", $userId, $service, $name); // i=int, s=string
|
||||||
|
|
||||||
|
if ($stmt->execute()) {
|
||||||
|
echo "Eintrag erfolgreich gespeichert!";
|
||||||
|
} else {
|
||||||
|
echo "Fehler: " . $stmt->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDiscordAvatarUrl($user) {
|
||||||
function
|
if ($user['avatar']) {
|
||||||
?>
|
// Prüfen ob Animated Avatar (fängt mit "a_")
|
||||||
|
$format = str_starts_with($user['avatar'], 'a_') ? 'gif' : 'png';
|
||||||
|
return "https://cdn.discordapp.com/avatars/{$user['discord_id']}/{$user['avatar']}.$format?size=512";
|
||||||
|
} else {
|
||||||
|
// Standard-Avatar (User hat kein eigenes Profilbild)
|
||||||
|
$defaultAvatar = $user['discriminator'] % 5;
|
||||||
|
return "https://cdn.discordapp.com/embed/avatars/{$defaultAvatar}.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
17
header.php
17
header.php
@@ -1,20 +1,29 @@
|
|||||||
<div class="navbar">
|
<?php
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="navbar">
|
||||||
<div class="navbar-links" id="mobileMenu">
|
<div class="navbar-links" id="mobileMenu">
|
||||||
<a href="index.php">🏠 Home</a>
|
<a href="index.php">🏠 Home</a>
|
||||||
<?php if ($_SESSION['user']['hasRole']): ?>
|
<?php if ($_SESSION['user']['hasRole']): ?>
|
||||||
<a href="admin.php">✍️ Eintragung</a>
|
<a href="registration.php">✍️ Eintragung</a>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<a href="#">📂 Verwaltung ▼</a>
|
<a href="#">📂 Verwaltung ▼</a>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
<a href="statistik.php">📊 Statistik</a>
|
<a href="statistik.php">📊 Statistik</a>
|
||||||
<a href="lager.php">🔧 Lager</a>
|
<a href="lager.php">🔧 Lager</a>
|
||||||
<a href="#">📝 Platzhalter</a>
|
<a href="personal.php">📝 Personalakten</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<img src="https://cdn.discordapp.com/avatars/<?php echo $_SESSION['user']['id']; ?>/<?php echo $_SESSION['user']['avatar']; ?>.png" alt="Avatar">
|
<img src="https://cdn.discordapp.com/avatars/<?php echo $_SESSION['user']['discord_id']; ?>/<?php echo $_SESSION['user']['avatar']; ?>.png" alt="Avatar">
|
||||||
<span><?php echo htmlspecialchars($_SESSION['user']['nickname']); ?></span>
|
<span><?php echo htmlspecialchars($_SESSION['user']['nickname']); ?></span>
|
||||||
<a href="logout.php"><button class="logout-btn">Logout</button></a>
|
<a href="logout.php"><button class="logout-btn">Logout</button></a>
|
||||||
<span class="burger" onclick="toggleMenu()">☰</span>
|
<span class="burger" onclick="toggleMenu()">☰</span>
|
||||||
|
|||||||
51
personal.php
Normal file
51
personal.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require 'config.php';
|
||||||
|
require 'db.php';
|
||||||
|
|
||||||
|
if ($dbhandle->connect_error) {
|
||||||
|
die("Verbindung fehlgeschlagen: " . $dbhandle->connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query
|
||||||
|
$sql = "SELECT clientname, SUM(preis) AS gesamt_einnahmen, ROUND(SUM(preis) * 0.1, 2) AS abschlag
|
||||||
|
FROM contracts
|
||||||
|
GROUP BY clientname
|
||||||
|
ORDER BY gesamt_einnahmen DESC";
|
||||||
|
|
||||||
|
$result = $dbhandle->query($sql);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Übersicht</title>
|
||||||
|
<style>
|
||||||
|
table { border-collapse: collapse; width: 80%; margin: auto; }
|
||||||
|
th, td { border: 1px solid #ddd; padding: 8px; text-align: center; }
|
||||||
|
th { background-color: #4CAF50; color: white; }
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php include "header.php"?>
|
||||||
|
<h1 style="text-align:center;">Übersicht der Einnahmen</h1>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Dienstnummer + Name</th>
|
||||||
|
<th>Gesamteinnahmen (€)</th>
|
||||||
|
<th>10 % Abschlag (€)</th>
|
||||||
|
</tr>
|
||||||
|
<?php while($row = $result->fetch_assoc()): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo htmlspecialchars($row['clientname']); ?></td>
|
||||||
|
<td><?php echo number_format($row['gesamt_einnahmen'], 2, ',', '.'); ?> €</td>
|
||||||
|
<td><?php echo number_format($row['abschlag'], 2, ',', '.'); ?> €</td>
|
||||||
|
</tr>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?php
|
||||||
|
$dbhandle->close();
|
||||||
|
?>
|
||||||
113
registration.php
113
registration.php
@@ -1,23 +1,100 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require 'config.php';
|
||||||
|
require 'db.php';
|
||||||
|
|
||||||
|
// Prüfen ob das Formular abgeschickt wurde
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
|
||||||
|
// DB Verbindung herstellen
|
||||||
|
|
||||||
|
if ($dbhandle->connect_error) {
|
||||||
|
die("Verbindung fehlgeschlagen: " . $dbhandle->connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Daten holen & absichern
|
||||||
|
$clientid = $_SESSION['user']['id']; // Discord-ID
|
||||||
|
$clientname = $_SESSION['user']['nickname']; // Server-Nickname
|
||||||
|
$service = $dbhandle->real_escape_string($_POST['Services']);
|
||||||
|
$preis = $dbhandle->real_escape_string($_POST['preis']);
|
||||||
|
$modell = $dbhandle->real_escape_string($_POST['modell']);
|
||||||
|
$kennzeichen = $dbhandle->real_escape_string($_POST['kennzeichen']);
|
||||||
|
|
||||||
|
// Eintrag speichern
|
||||||
|
$stmt = $dbhandle->prepare("INSERT INTO contracts (clientid, clientname, service, preis, modell, kennzeichen) VALUES (?, ?, ?, ?, ?, ?)");
|
||||||
|
$stmt->bind_param("ississ", $clientid, $clientname, $service, $preis, $modell, $kennzeichen);
|
||||||
|
|
||||||
|
|
||||||
|
if ($stmt->execute()) {
|
||||||
|
$meldung = "✅ Eintrag erfolgreich gespeichert!";
|
||||||
|
} else {
|
||||||
|
$meldung = "❌ Fehler: " . htmlspecialchars($stmt->error);
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt->close();
|
||||||
|
$dbhandle->close();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Eintragung</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php include "header.php"?>
|
||||||
|
<div id="formdiv">3
|
||||||
|
<div class="form-group">
|
||||||
|
<?php if (isset($meldung)): ?>
|
||||||
|
<p style="color: lime; font-weight: bold; text-align: center;"><?php echo $meldung; ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div class="form-group">
|
||||||
|
<form name="entryform" id="entryform" method="post" action="">
|
||||||
|
<h1>Eintragung</h1>
|
||||||
|
|
||||||
<form name="entryform" id="entryform" method="post" action="">
|
<div class="form-group">
|
||||||
<p>
|
<label for="service">Wähle eine Dienstleistung:</label>
|
||||||
<label>
|
<select name="Services" id="service">
|
||||||
input:
|
<option value="Reparatur">Reparatur</option>
|
||||||
</label>
|
<option value="Carplay">Carplay</option>
|
||||||
</p>
|
<option value="Tuning">Tuning</option>
|
||||||
<label for="cars">Choose a car:</label>
|
|
||||||
<select name="cars" id="cars" form="carform">
|
|
||||||
<option value="volvo">Volvo</option>
|
|
||||||
<option value="saab">Saab</option>
|
|
||||||
<option value="opel">Opel</option>
|
|
||||||
<option value="audi">Audi</option>
|
|
||||||
</select>
|
</select>
|
||||||
<p>
|
</div>
|
||||||
<label>
|
|
||||||
<input type="submit" name="button" id="button" value="Submit">
|
<div class="form-group">
|
||||||
</label>
|
<label for="name">Preis:</label>
|
||||||
</p>
|
<input type="number" name="preis" id="preis" placeholder="0">
|
||||||
</form>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="modell">Automodell:</label>
|
||||||
|
<input type="text" name="modell" id="name" placeholder="infernus">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="kennzeichen">Kennzeichen:</label>
|
||||||
|
<input type="text" name="kennzeichen" id="kennzeichen" placeholder="RXJ 661">
|
||||||
|
</div>
|
||||||
|
<input type="submit" name="button" id="button" value="Absenden">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('service').addEventListener('change', function () {
|
||||||
|
const preisField = document.getElementById('preis');
|
||||||
|
if (this.value === 'Carplay') {
|
||||||
|
preisField.value = 3000;
|
||||||
|
} else {
|
||||||
|
preisField.value = ''; // Lösche den Wert, falls etwas anderes gewählt wird
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
94
style.css
94
style.css
@@ -146,3 +146,97 @@ body::before {
|
|||||||
height: 24px;
|
height: 24px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*EINTRAGUNG*/
|
||||||
|
|
||||||
|
#formdiv {
|
||||||
|
width: 40%;
|
||||||
|
height: 70vh; /* mittlere Box-Höhe */
|
||||||
|
display: flex;
|
||||||
|
justify-content: center; /* Zentriert horizontal */
|
||||||
|
align-items: center; /* Zentriert vertikal */
|
||||||
|
border: 2px solid cyan;
|
||||||
|
background-color: rgba(255, 0, 255, 0.5);
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 10px; /* optional: runde Ecken */
|
||||||
|
}
|
||||||
|
|
||||||
|
#entryform {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; /* Elemente untereinander */
|
||||||
|
justify-content: space-between; /* gleichmäßig verteilen */
|
||||||
|
align-items: stretch;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; /* Label + Input untereinander */
|
||||||
|
gap: 5px; /* kleiner Abstand zwischen Label & Input */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#entryform h1 {
|
||||||
|
text-align: center; /* Überschrift mittig */
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#entryform select,
|
||||||
|
#entryform input[type="number"],
|
||||||
|
#entryform input[type="text"],
|
||||||
|
#entryform input[type="submit"] {
|
||||||
|
width: 100%; /* volle Breite */
|
||||||
|
height: 40px;
|
||||||
|
margin-top: 10px; /* Abstand nach oben */
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button {
|
||||||
|
background-color: cyan;
|
||||||
|
font-weight: bolder;
|
||||||
|
border: 2px solid white;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*#formdiv{
|
||||||
|
width: 40%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: cyan;
|
||||||
|
background-color: rgba(255, 0, 255, 0.5);
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#entryform{
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#entryform #button{
|
||||||
|
background-color: cyan;
|
||||||
|
width: 75%;
|
||||||
|
height: 75px;
|
||||||
|
align-content: left;
|
||||||
|
font-weight: bolder;
|
||||||
|
border: 2px solid yellow;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button {
|
||||||
|
display: block;
|
||||||
|
margin-left: 0;
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: larger;
|
||||||
|
}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user