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

37
payout.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
session_start();
require 'config.php';
require 'db.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$userId = $_SESSION['user']['id'];
$betrag = floatval($_POST['betrag']);
// Auszahlung eintragen
$stmt = $dbhandle->prepare("INSERT INTO payouts (user_id, betrag) VALUES (?, ?)");
$stmt->bind_param("id", $userId, $betrag);
$stmt->execute();
$stmt->close();
// Benachrichtigung für Admins
$message = "hat eine Auszahlung in Höhe von {$betrag}€ beantragt.";
$notif = $dbhandle->prepare("INSERT INTO notifications (user_id, message, type) VALUES (?, ?, 'payout')");
$notif->bind_param("is", $userId, $message);
$notif->execute();
$notif->close();
echo "✅ Auszahlung beantragt!";
}
?>
<?php require "header.php"?>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form method="post">
<label>Betrag (€):</label>
<input type="number" name="betrag" step="0.01" required>
<button type="submit">Auszahlung beantragen</button>
</form>
</body>