-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a18683
commit 7535da2
Showing
6 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="de"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Bug Report erstellen</title> | ||
</head> | ||
<body> | ||
<h1>Bug Report erstellen</h1> | ||
<form action="create_bug.php" method="post"> | ||
<label for="title">Titel:</label> | ||
<input type="text" id="title" name="title" required><br> | ||
<label for="description">Beschreibung:</label> | ||
<textarea id="description" name="description" rows="4" required></textarea><br> | ||
<input type="hidden" name="reporter_name" value="GreenDevBlood"> | ||
<button type="submit">Bug melden</button> | ||
</form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
@include 'util.php'; | ||
|
||
if ($_SERVER['REQUEST_METHOD'] === 'POST') { | ||
$title = $_POST['title']; | ||
$description = $_POST['description']; | ||
$reporter_name = $_POST['reporter_name']; | ||
|
||
$query = mysqli_query(database_blogpost(), "INSERT INTO bug_reports (title, description, reporter_name, status, created_at) | ||
VALUES ('$title', '$description', '$reporter_name', 'Open', NOW())"); | ||
|
||
if ($query) { | ||
echo "Bug erfolgreich gemeldet!"; | ||
} else { | ||
echo "Fehler beim Melden des Bugs."; | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Ticket Ansicht</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<link href="sunlight.png" rel="icon"> | ||
</head> | ||
<body> | ||
|
||
<header> | ||
<h1>Ticket Ansicht</h1> | ||
</header> | ||
<nav> | ||
<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="https://github.com/SunLightScorpion" target="_blank">Github</a></li> | ||
<li><a href="https://discord.gg/DRKeawjsq7" target="_blank">Discord</a></li> | ||
</ul> | ||
</nav> | ||
|
||
<div class="content"> | ||
<?php | ||
@include 'util.php'; | ||
|
||
$per_page = 25; | ||
$current_page = isset($_GET['page']) ? $_GET['page'] : 1; | ||
$offset = ($current_page - 1) * $per_page; | ||
|
||
$query = mysqli_query(database_blogpost(), "SELECT * FROM bug_reports ORDER BY created_at DESC LIMIT $offset, $per_page"); | ||
|
||
if ($query) { | ||
echo "<table>"; | ||
echo "<tr><th>BugID</th><th>Beschreibung</th></tr>"; | ||
|
||
foreach ($query as $bug) { | ||
echo "<tr>"; | ||
echo "<td>" . $bug['id'] . "</td>"; | ||
echo "<td>" . $bug['title'] . "</td>"; | ||
echo "</tr>"; | ||
} | ||
|
||
echo "</table>"; | ||
|
||
$total_bugs = mysqli_query(database_bugtracker(), "SELECT COUNT(*) as total FROM bug_reports"); | ||
$total_bugs = mysqli_fetch_assoc($total_bugs)['total']; | ||
$total_pages = ceil($total_bugs / $per_page); | ||
|
||
if ($total_pages > 1) { | ||
echo "<div class='pagination'>"; | ||
|
||
if ($current_page > 1) { | ||
echo "<a href='tickets.php?page=" . ($current_page - 1) . "'>Prev</a>"; | ||
} | ||
|
||
for ($i = 1; $i <= $total_pages; $i++) { | ||
if ($i == $current_page) { | ||
echo "<span class='current'>$i</span>"; | ||
} else { | ||
echo "<a href='tickets.php?page=$i'>$i</a>"; | ||
} | ||
} | ||
|
||
if ($current_page < $total_pages) { | ||
echo "<a href='tickets.php?page=" . ($current_page + 1) . "'>Next</a>"; | ||
} | ||
|
||
echo "</div>"; | ||
} | ||
} else { | ||
echo "Fehler beim Abrufen der Daten."; | ||
} | ||
?> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters