feat: added adminpanel with overview; added holiday page with functionality; added payout page + functionality; added notification Feature
This commit is contained in:
37
payout.php
Normal file
37
payout.php
Normal 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>
|
||||
|
||||
Reference in New Issue
Block a user