/* Decoded by unphp.net */ session_start(); require 'db_connection.php'; if (!isset($_SESSION['user_id'])) { header("Location: ".($phpenable === 'true'?$login_url .'.php': $login_url)); exit; } $sql = "SELECT * FROM benutzer WHERE id = ".$_SESSION['user_id']; $result = $conn->query($sql); $user = $result->fetch_assoc(); if ($user['gesperrt'] == 1) { session_destroy(); header("Location: ".($phpenable === 'true'?$login_url .'.php': $login_url)); exit; } $userId = $_SESSION['user_id']; $ticketCreated = false; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $ticketId = rand(10000000,99999999); $subject = $_POST['subject']; $message = $_POST['message']; $sql = "INSERT INTO tickets (id, user_id, subject, message) VALUES (?, ?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("iiss",$ticketId,$userId,$subject,$message); $stmt->execute(); $stmt->close(); $ticketCreated = true; } include 'settings/config.php'; include 'settings/head.php'; include 'settings/header.php'; ;echo '
';if (isset($_SESSION['success_message'])) {;echo ' ';unset($_SESSION['success_message']); ;echo ' ';};echo ' ';if (isset($_SESSION['error_message'])) {;echo ' ';unset($_SESSION['error_message']); ;echo ' ';};echo '

Deine Tickets

'; $userId = $_SESSION['user_id']; $sql = "SELECT id, subject, status, created_at FROM tickets WHERE user_id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("i",$userId); $stmt->execute(); $stmt->bind_result($ticketId,$subject,$status,$createdAt); if ($stmt->fetch()) { ;echo '
'; do { echo ''; echo ''; if ($status == "offen") { $badgeClass = "bg-success xl"; $statusText = "Offen"; }elseif ($status == "geschlossen") { $badgeClass = "bg-danger"; $statusText = "Geschlossen"; }elseif ($status == "bearbeitung") { $badgeClass = "bg-warning"; $statusText = "In Bearbeitung"; }else { $badgeClass = "bg-secondary"; $statusText = "Unbekannt"; } echo ''; echo ''; $datetime = new DateTime($createdAt,new DateTimeZone('Europe/Berlin')); echo ''; echo "'; }while ($stmt->fetch()); ;echo '
ID Status Betreff Erstellt am
'.$ticketId .''.$statusText .''.$subject .''.$datetime->format('d.m.Y H:i') .'"; echo '

'; }else { echo '

Du hast noch keine Tickets erstellt.

'; } $stmt->close(); ;echo '

'; include 'settings/footer.php'; ;