Design angepasst
This commit is contained in:
@@ -3,10 +3,10 @@ session_start();
|
||||
|
||||
require_once '../inc/header.php'; ?>
|
||||
|
||||
<div class="container">
|
||||
<h1 class="mb-4">Debug-Informationen</h1>
|
||||
<div class="container mt-5">
|
||||
<h2 class="mb-4">Debug-Informationen</h2>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h4>Session-Daten ($_SESSION)</h4>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@ require_once '../inc/header.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card shadow">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h4>Cookie-Daten ($_COOKIE)</h4>
|
||||
</div>
|
||||
|
||||
@@ -135,7 +135,7 @@ require_once '../inc/header.php';
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Hex-Code</th>
|
||||
<th>Vorschau</th>
|
||||
<th>Farbe</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -7,8 +7,10 @@ if ($_SESSION['role'] !== 'admin') {
|
||||
die("Zugriff nur für Admins");
|
||||
}
|
||||
|
||||
// Datenbankverbindung einbinden
|
||||
|
||||
$message = '';
|
||||
$message_type = '';
|
||||
$edit_mode = false;
|
||||
$edit_user = null;
|
||||
|
||||
// Benutzer hinzufügen
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['username'], $_POST['password'], $_POST['role'])) {
|
||||
@@ -19,8 +21,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['username'], $_POST['pa
|
||||
$sql = "INSERT INTO users (username, password, role) VALUES ('$username', '$password', '$role')";
|
||||
if (mysqli_query($conn, $sql)) {
|
||||
$message = "Benutzer erfolgreich hinzugefügt.";
|
||||
$message_type = 'success';
|
||||
} else {
|
||||
$message = "Fehler beim Hinzufügen: " . mysqli_error($conn);
|
||||
$message_type = 'danger';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,39 +37,91 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
require_once '../inc/header.php';
|
||||
require_once('../inc/header.php');
|
||||
?>
|
||||
|
||||
<h1>Benutzerverwaltung</h1>
|
||||
<div class="container mt-5">
|
||||
<h2 class="mb-4">Benutzerverwaltung</h2>
|
||||
|
||||
<?php if (isset($message)) echo "<p><strong>$message</strong></p>"; ?>
|
||||
<?php if ($message) : ?>
|
||||
<div id="status-message" class="alert alert-<?php echo $message_type; ?> alert-dismissible fade show" role="alert">
|
||||
<?php echo htmlspecialchars($message); ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h4 class="mb-0">Neuen Benutzer hinzufügen</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
<label>Benutzername: <input type="text" name="username" required></label><br>
|
||||
<label>Passwort: <input type="password" name="password" required></label><br>
|
||||
<label>Rolle:
|
||||
<select name="role">
|
||||
<div class="row g-3 align-items-end">
|
||||
<div class="col-md-4">
|
||||
<label for="username" class="form-label">Benutzername</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
<div class="form-text" style="visibility: hidden;"> </div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="password" class="form-label">Passwort</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
<div class="form-text" style="visibility: hidden;"> </div>
|
||||
</div>
|
||||
<div class="col-md-4 d-flex flex-column justify-content-end">
|
||||
<label for="role" class="form-label">Rolle</label>
|
||||
<div class="d-flex w-100">
|
||||
<select class="form-select w-100" id="role" name="role">
|
||||
<option value="member">Mitglied</option>
|
||||
<option value="admin">Admin</option>
|
||||
</select>
|
||||
</label><br>
|
||||
<button type="submit">Benutzer hinzufügen</button>
|
||||
</form>
|
||||
|
||||
<h2>Benutzerübersicht</h2>
|
||||
<table border="1" cellpadding="5">
|
||||
</div>
|
||||
</div><button type="submit" class="btn btn-primary ms-2">Hinzufügen</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow">
|
||||
<div class="card-header bg-secondary text-white">
|
||||
<h4 class="mb-0">Benutzerübersicht</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Benutzername</th>
|
||||
<th>Rolle</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($user['id']) ?></td>
|
||||
<td><?= htmlspecialchars($user['username']) ?></td>
|
||||
<td><?= htmlspecialchars($user['role']) ?></td>
|
||||
<td>
|
||||
<span class="badge rounded-pill bg-<?= $user['role'] === 'admin' ? 'info' : 'secondary' ?>">
|
||||
<?= htmlspecialchars($user['role']) ?>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="text-dark me-1 text-decoration-none" data-bs-toggle="tooltip" data-bs-placement="top" title="Bearbeiten">
|
||||
<span class="material-icons">mode_edit_outline</span>
|
||||
</a>
|
||||
<a href="#" class="text-danger text-decoration-none" data-bs-toggle="tooltip" data-bs-placement="top" title="Löschen">
|
||||
<span class="material-icons">delete_outline</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include('../inc/footer.php'); ?>
|
||||
@@ -1,5 +1,6 @@
|
||||
body {
|
||||
background-color: #e6e6e6ff;
|
||||
padding-top: 40px; /* Anpassen an die Höhe Ihres Menüs */
|
||||
}
|
||||
|
||||
.container {
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
</head>
|
||||
|
||||
<!-- Farbe über Bootstrap festlegen mit Transparent -->
|
||||
<!-- <body class="bg-info bg-opacity-10"> -->
|
||||
|
||||
<body>
|
||||
|
||||
<? include('menu.php') ?>
|
||||
@@ -1,4 +1,4 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand d-flex" href="../index.php">DoMiLi</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@@ -25,7 +25,7 @@
|
||||
<a class="nav-link d-flex align-items-center dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"><span class="material-icons md-18 me-1">admin_panel_settings</span>Admin</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="../admin/colors.php">Farben</a></li>
|
||||
<li><a class="dropdown-item" href="../admin/date.php">Termine</a></li>
|
||||
<li><a class="dropdown-item" href="../admin/meeting.php">Termine</a></li>
|
||||
<li><a class="dropdown-item" href="../admin/users.php">Benutzer</a></li>
|
||||
<li><a class="dropdown-item" href="../admin/check_session.php">Session prüfen</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user