feat: added Sessionstart to header; changed navlinks in header; rework registration of services; created employee list with refund; created function for getting avatar and insert entry; changed data fetch for user; new style added
This commit is contained in:
@@ -1,8 +1,26 @@
|
||||
<?php
|
||||
function insertentry(){
|
||||
function insertEntry($conn, $userId, $service, $name) {
|
||||
// Query vorbereiten
|
||||
$stmt = $conn->prepare("INSERT INTO contracts (clientid, service, name) VALUES (?, ?, ?)");
|
||||
$stmt->bind_param("iss", $userId, $service, $name); // i=int, s=string
|
||||
|
||||
if ($stmt->execute()) {
|
||||
echo "Eintrag erfolgreich gespeichert!";
|
||||
} else {
|
||||
echo "Fehler: " . $stmt->error;
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
|
||||
function
|
||||
?>
|
||||
function getDiscordAvatarUrl($user) {
|
||||
if ($user['avatar']) {
|
||||
// Prüfen ob Animated Avatar (fängt mit "a_")
|
||||
$format = str_starts_with($user['avatar'], 'a_') ? 'gif' : 'png';
|
||||
return "https://cdn.discordapp.com/avatars/{$user['discord_id']}/{$user['avatar']}.$format?size=512";
|
||||
} else {
|
||||
// Standard-Avatar (User hat kein eigenes Profilbild)
|
||||
$defaultAvatar = $user['discriminator'] % 5;
|
||||
return "https://cdn.discordapp.com/embed/avatars/{$defaultAvatar}.png";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user