feat: added adminpanel with overview; added holiday page with functionality; added payout page + functionality; added notification Feature

This commit is contained in:
Ioannis20x
2025-07-08 12:31:34 +02:00
parent f64500c9a0
commit a2bfd6079c
5 changed files with 155 additions and 3 deletions

43
holiday.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
session_start();
require 'config.php';
require 'db.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$userId = $_SESSION['user']['id'];
$von = $_POST['von'];
$bis = $_POST['bis'];
$grund = $dbhandle->real_escape_string($_POST['grund']);
// Urlaub eintragen
$stmt = $dbhandle->prepare("INSERT INTO urlaub (user_id, von, bis, grund) VALUES (?, ?, ?, ?)");
$stmt->bind_param("isss", $userId, $von, $bis, $grund);
$stmt->execute();
$stmt->close();
// Benachrichtigung für Admins
$message = "hat einen Urlaubsantrag gestellt: {$von} bis {$bis}.";
$notif = $dbhandle->prepare("INSERT INTO notifications (user_id, message, type) VALUES (?, ?, 'urlaub')");
$notif->bind_param("is", $userId, $message);
$notif->execute();
$notif->close();
echo "✅ Urlaub beantragt!";
}
?>
<?php require "header.php"?>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form method="post">
<label>Von:</label>
<input type="date" name="von" required>
<label>Bis:</label>
<input type="date" name="bis" required>
<label>Grund:</label>
<textarea name="grund"></textarea>
<button type="submit">Urlaub beantragen</button>
</form>
</body>