Skip to content

Commit

Permalink
more development for ticket system [#1]
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDev701 committed Aug 10, 2023
1 parent 893e5e0 commit e6d244f
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 5 deletions.
51 changes: 51 additions & 0 deletions src/bug_detail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bug Detail</title>
<link rel="stylesheet" href="style.css">
<link href="sunlight.png" rel="icon">
</head>
<body>

<header>
<h1>Bug Detail</h1>
</header>
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="tickets.php" class="active">Bug Reports</a></li>
</ul>
</nav>

<div class="content">
<?php
@include 'util.php';

if (isset($_GET['bug_id'])) {
$bug_id = $_GET['bug_id'];

$query = mysqli_query(database_blogpost(), "SELECT * FROM bug_reports WHERE id = $bug_id");

if ($result = $query) {
foreach ($query as $bug) {
echo "<div class='bug-detail'>";
echo "<h2>Bug #" . $bug['id'] . "</h2>";
echo "<p><strong>Description:</strong> " . $bug['description'] . "</p>";
echo "<p><strong>Reporter:</strong> " . $bug['reporter_name'] . "</p>";
echo "<p><strong>Created at:</strong> " . $bug['created_at'] . "</p>";
echo "<p><strong>Status:</strong> " . $bug['status'] . "</p>";
echo "</div>";
}
} else {
echo "Bug not found.";
}
} else {
echo "Bug ID not provided.";
}
?>
</div>

</body>
</html>
2 changes: 2 additions & 0 deletions src/create_bug.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
$description = $_POST['description'];
$reporter_name = $_POST['reporter_name'];

$description = nl2br($description);

$query = mysqli_query(database_blogpost(), "INSERT INTO bug_reports (title, description, reporter_name, status, created_at)
VALUES ('$title', '$description', '$reporter_name', 'Open', NOW())");

Expand Down
2 changes: 1 addition & 1 deletion src/downloadpage.html → src/downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>Downloads</h1>
<ul>
<li><a href="index.php">Hauptseite</a></li>
<li><a href="tickets.php">Ticket Ansicht</a></li>
<li><a class="active" href="downloadpage.html">Downloads</a></li>
<li><a class="active" href="downloads.html">Downloads</a></li>
<li><a href="https://github.com/SunLightScorpion" target="_blank">Github</a></li>
<li><a href="https://discord.gg/DRKeawjsq7" target="_blank">Discord</a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ul>
<li><a href="index.php" class="active">Hauptseite</a></li>
<li><a href="tickets.php">Ticket Ansicht</a></li>
<li><a href="downloadpage.html">Downloads</a></li>
<li><a href="downloads.html">Downloads</a></li>
<li><a href="https://github.com/SunLightScorpion" target="_blank">Github</a></li>
<li><a href="https://discord.gg/DRKeawjsq7" target="_blank">Discord</a></li>
</ul>
Expand Down
3 changes: 3 additions & 0 deletions src/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo "LOGIN: soon";
3 changes: 3 additions & 0 deletions src/register.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo "REGISTER: soon";
6 changes: 3 additions & 3 deletions src/tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ul>
<li><a href="index.php">Hauptseite</a></li>
<li><a href="tickets.php" class="active">Ticket Ansicht</a></li>
<li><a href="downloadpage.html">Downloads</a></li>
<li><a href="downloads.html">Downloads</a></li>
<li><a href="https://github.com/SunLightScorpion" target="_blank">Github</a></li>
<li><a href="https://discord.gg/DRKeawjsq7" target="_blank">Discord</a></li>
</ul>
Expand All @@ -34,11 +34,11 @@

if ($query) {
echo "<table>";
echo "<tr><th>Ticket-ID</th><th>Beschreibung</th></tr>";
echo "<tr><th>BugID</th><th>Beschreibung</th></tr>";

foreach ($query as $bug) {
echo "<tr>";
echo "<td>" . $bug['id'] . "</td>";
echo "<td><a href='bug_detail.php?bug_id=" . $bug['id'] . "' class='bug-link'>" . $bug['id'] . "</a></td>";
echo "<td>" . $bug['title'] . "</td>";
echo "</tr>";
}
Expand Down

0 comments on commit e6d244f

Please sign in to comment.