feat: created file for registration of actions and a file for functions; started first tests with form for work entries
This commit is contained in:
8
functions.php
Normal file
8
functions.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
function insertentry(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function
|
||||||
|
?>
|
||||||
39
header.php
39
header.php
@@ -1,17 +1,22 @@
|
|||||||
<?php
|
<div class="navbar">
|
||||||
session_start();
|
<div class="navbar-links" id="mobileMenu">
|
||||||
?>
|
<a href="index.php">🏠 Home</a>
|
||||||
|
<?php if ($_SESSION['user']['hasRole']): ?>
|
||||||
<nav>
|
<a href="admin.php">✍️ Eintragung</a>
|
||||||
<a href="index.php">Startseite</a>
|
<div class="dropdown">
|
||||||
|
<a href="#">📂 Verwaltung ▼</a>
|
||||||
<?php if (isset($_SESSION['user']) && $_SESSION['user']['hasRole']): ?>
|
<div class="dropdown-content">
|
||||||
<a href="admin.php">Admin-Menü</a>
|
<a href="statistik.php">📊 Statistik</a>
|
||||||
<?php endif; ?>
|
<a href="lager.php">🔧 Lager</a>
|
||||||
|
<a href="#">📝 Platzhalter</a>
|
||||||
<?php if (isset($_SESSION['user'])): ?>
|
</div>
|
||||||
<a href="logout.php">Logout</a>
|
</div>
|
||||||
<?php else: ?>
|
<?php endif; ?>
|
||||||
<a href="loginform.php">Login</a>
|
</div>
|
||||||
<?php endif; ?>
|
<div class="user-info">
|
||||||
</nav>
|
<img src="https://cdn.discordapp.com/avatars/<?php echo $_SESSION['user']['id']; ?>/<?php echo $_SESSION['user']['avatar']; ?>.png" alt="Avatar">
|
||||||
|
<span><?php echo htmlspecialchars($_SESSION['user']['nickname']); ?></span>
|
||||||
|
<a href="logout.php"><button class="logout-btn">Logout</button></a>
|
||||||
|
<span class="burger" onclick="toggleMenu()">☰</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
36
index.php
36
index.php
@@ -1,11 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
if (!isset($_SESSION)) session_start();
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: loginform.php');
|
header('Location: loginform.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}?>
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -14,37 +12,17 @@ if (!isset($_SESSION['user'])) {
|
|||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<?php include "header.php";?>
|
||||||
<div class="navbar-links" id="mobileMenu">
|
|
||||||
<a href="index.php">🏠 Home</a>
|
|
||||||
<?php if ($_SESSION['user']['hasRole']): ?>
|
|
||||||
<a href="admin.php">✍️ Eintragung</a>
|
|
||||||
<div class="dropdown">
|
|
||||||
<a href="#">📂 Verwaltung ▼</a>
|
|
||||||
<div class="dropdown-content">
|
|
||||||
<a href="statistik.php">📊 Statistik</a>
|
|
||||||
<a href="lager.php">🔧 Lager</a>
|
|
||||||
<a href="#">📝 Platzhalter</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<div class="user-info">
|
|
||||||
<img src="https://cdn.discordapp.com/avatars/<?php echo $_SESSION['user']['id']; ?>/<?php echo $_SESSION['user']['avatar']; ?>.png" alt="Avatar">
|
|
||||||
<span><?php echo htmlspecialchars($_SESSION['user']['nickname']); ?></span>
|
|
||||||
<a href="logout.php"><button class="logout-btn">Logout</button></a>
|
|
||||||
<span class="burger" onclick="toggleMenu()">☰</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
<h1>Willkommen, <?php echo htmlspecialchars($_SESSION['user']['nickname']); ?>!</h1>
|
<h1>Willkommen, <?php echo htmlspecialchars($_SESSION['user']['nickname']); ?>!</h1>
|
||||||
|
|
||||||
<?php if ($_SESSION['user']['hasRole']): ?>
|
<?php if ($_SESSION['user']['hasRole']): ?>
|
||||||
<p>Du bist als <strong><?php echo htmlspecialchars($_SESSION['user']['main_role']); ?></strong> eingeloggt.</p>
|
<p>Du bist als <strong><?php echo htmlspecialchars($_SESSION['user']['main_role']); ?></strong> eingeloggt.</p>
|
||||||
<?php else: ?>
|
<?php else:
|
||||||
<p>Du hast nicht die erforderliche Rolle für Admin-Menüpunkte.</p>
|
session_destroy();
|
||||||
<?php endif; ?>
|
exit();
|
||||||
|
endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
23
registration.php
Normal file
23
registration.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form name="entryform" id="entryform" method="post" action="">
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
input:
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
<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>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="submit" name="button" id="button" value="Submit">
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user