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!"; } ?>