/* 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 ' Du hast noch keine Tickets erstellt.
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 'ID
Status
Betreff
Erstellt am
';
echo ' ';
}while ($stmt->fetch());
;echo '
'.$ticketId .' ';
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 ''.$statusText .' ';
echo ''.$subject .' ';
$datetime = new DateTime($createdAt,new DateTimeZone('Europe/Berlin'));
echo ''.$datetime->format('d.m.Y H:i') .' ';
echo "";
echo '
';
}else {
echo '