Compare commits

..
Author SHA1 Message Date
bruno 62b0c9c02a Automated merge from dev to live 2026-07-17 20:48:50 +02:00
bruno a8af446f32 Automated merge from main to dev 2026-07-17 20:48:46 +02:00
Tower 951253c559 logout mailing and wording fix when guest logs in 2026-07-17 20:48:38 +02:00
Tower 43fc4ba775 Merge branch 'dev' into live 2026-07-17 20:28:02 +02:00
Tower 7f54bb42f3 Merge branch 'main' into dev 2026-07-17 20:27:54 +02:00
Tower 8f84260186 new service ticket board and ticket control with mailing 2026-07-17 20:26:56 +02:00
bruno f163b9b5ea Automated merge from dev to live 2026-07-16 23:51:11 +02:00
bruno 30e27dae3c Automated merge from main to dev 2026-07-16 23:51:08 +02:00
Tower 448bffd2f5 add logout logging 2026-07-16 23:50:59 +02:00
Tower afc73cb030 Merge branch 'dev' into live 2026-07-16 19:21:42 +02:00
Tower 6459129e1a Merge branch 'main' into dev 2026-07-16 19:21:31 +02:00
Tower db392d915d change new server ip environment 2026-07-16 19:20:27 +02:00
bruno 8ecf7d1f6e Automated merge from dev to live 2026-07-14 19:07:32 +02:00
bruno 54cb7e98ad Automated merge from main to dev 2026-07-14 19:07:30 +02:00
Tower 584f168074 enable html in email 2026-07-14 19:07:01 +02:00
Tower 0e80de4c26 Merge branch 'dev' into live 2026-07-13 20:41:54 +02:00
Tower 75802de142 Merge branch 'main' into dev 2026-07-13 20:41:33 +02:00
Tower ce0d16c1ed add and delete connections 2026-07-13 20:41:23 +02:00
Bruno Eckhardt a73caf0bab Merge branch 'dev' into live 2026-07-13 14:49:50 +02:00
Bruno Eckhardt c5a7addd20 Merge branch 'main' into dev 2026-07-13 14:49:41 +02:00
Bruno Eckhardt b1416aa933 Merge branch 'domain-umzug' 2026-07-13 14:49:30 +02:00
Bruno Eckhardt c8f4f47439 change domain name 2026-07-13 14:47:33 +02:00
Bruno Eckhardt 6798a60d83 Merge branch 'dev' into live 2026-07-13 14:21:58 +02:00
Bruno Eckhardt 4f76da54f3 Merge branch 'main' into dev 2026-07-13 14:21:37 +02:00
Bruno Eckhardt 86c20a63bf add new DB connection 2026-07-13 14:21:24 +02:00
Bruno Eckhardt 13a98f2880 Automated merge from dev to live 2026-07-13 13:33:27 +02:00
Bruno Eckhardt cba34c4329 Automated merge from main to dev 2026-07-13 13:33:18 +02:00
Bruno Eckhardt 1fba004b9b Merge branch 'auto-merge' 2026-07-13 13:32:11 +02:00
Bruno Eckhardt 9622e35ca3 fixes 2026-07-13 13:32:01 +02:00
Bruno Eckhardt c173ea0c18 Automated merge from dev to live 2026-07-13 13:06:52 +02:00
Bruno Eckhardt 82ac74a7ee Automated merge from main to dev 2026-07-13 13:06:43 +02:00
Bruno Eckhardt 2748349060 Merge branch 'auto-merge' 2026-07-13 13:02:52 +02:00
Bruno Eckhardt ebbb6551f7 delete comments 2026-07-13 13:02:40 +02:00
Bruno Eckhardt a0914b60a6 Automated merge from dev to live 2026-07-13 12:35:55 +02:00
Bruno Eckhardt 0541557ae9 Automated merge from main to dev 2026-07-13 12:35:47 +02:00
Bruno Eckhardt 992ac5eb6a Merge branch 'auto-merge' 2026-07-13 12:35:11 +02:00
Bruno Eckhardt d37937f4d8 add form fixes 2026-07-13 12:34:59 +02:00
17 changed files with 465 additions and 271 deletions

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
}
],
"settings": {
"workbench.colorTheme": "Default Dark Modern",
"workbench.colorTheme": "Dark Modern",
"workbench.colorCustomizations": {
"activityBar.background": "#ff000075",
"activityBar.foreground": "#000000",
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
// loginTest.php
$loginUrl = "https://backend.blackpi.ipv64.net/login.php"; // URL zu deinem Login-Script
$loginUrl = "https://backend.mrhossa.de/login.php"; // URL zu deinem Login-Script
// Testfälle
$tests = [
@@ -51,4 +51,4 @@ foreach ($tests as $test) {
} else {
echo "[FAIL] {$test['description']}\n";
}
}
}
+17 -3
View File
@@ -20,6 +20,7 @@ $serviceGroups = array (
2 => 'links',
3 => 'einkaufsliste',
4 => 'termine',
5 => 'ticket_board',
),
),
'Ausbildung' =>
@@ -59,6 +60,7 @@ $serviceGroups = array (
1 => 'services_control',
2 => 'user_control',
3 => 'variablen_control',
4 => 'ticket_control',
),
),
'Test' =>
@@ -220,6 +222,18 @@ $services = array (
'active' => true,
'adminOnly' => false,
),
'ticket_board' =>
array (
'name' => 'Tickets / Ideen',
'active' => true,
'adminOnly' => false,
),
'ticket_control' =>
array (
'name' => 'Tickets',
'active' => true,
'adminOnly' => false,
),
);
$linkGroups = array (
@@ -253,7 +267,7 @@ $linkButtons = array (
0 =>
array (
'label' => 'Gitea',
'url' => 'http://gitea.blackpi.ipv64.net',
'url' => 'http://gitea.mrhossa.de',
'newTab' => true,
'adminOnly' => false,
'group' => 'admin',
@@ -261,7 +275,7 @@ $linkButtons = array (
1 =>
array (
'label' => 'HAProxy',
'url' => 'http://stats.blackpi.ipv64.net',
'url' => 'http://stats.mrhossa.de',
'newTab' => true,
'adminOnly' => false,
'group' => 'admin',
@@ -269,7 +283,7 @@ $linkButtons = array (
2 =>
array (
'label' => 'Public',
'url' => 'https://blackpi.ipv64.net',
'url' => 'https://mrhossa.de',
'newTab' => true,
'adminOnly' => false,
'group' => 'info',
+2 -28
View File
@@ -108,13 +108,7 @@ class getSpecificData {
}
public function getServerIP(): string {
$ServerIP = $_SERVER['SERVER_ADDR'] ?? 'Unbekannt';
if (in_array($ServerIP, ['Unbekannt', '0.0.0.0', '127.0.0.1'])) {
return "Lokal";
} else {
return $ServerIP;
}
return $_SERVER['SERVER_ADDR'] ?? 'Unbekannt';
}
public function getClientIP(): string
@@ -166,27 +160,7 @@ class getSpecificData {
}
function getServerNode($ServerIP) {
$nodes = [
'node1' => '172.30.0.11',
'node1' => '172.30.0.21',
'node2' => '172.30.0.12',
'node2' => '172.30.0.22',
'node3' => '172.30.0.13',
'node3' => '172.30.0.23',
'node4' => '172.30.0.14',
'node4' => '172.30.0.24',
'Lokal' => 'Lokal',
];
foreach ($nodes as $node => $ip) {
if ($ServerIP == $ip) {
return $node;
break;
}
}
return $ServerIP;
}
function getClientStatus($ClientIP) {
+8 -28
View File
@@ -4,7 +4,8 @@ include_once __DIR__ . '/../modules/Mail.php';
include_once __DIR__ . '/../controller/RoutesController.php';
include_once 'DataController.php';
function db_connect() {
function db_connect()
{
$servers = [
'local' => [
'hostaddr' => '127.0.0.1',
@@ -12,36 +13,18 @@ function db_connect() {
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
],
'vpn' => [
'hostaddr' => '100.123.136.86',
'live' => [
'hostaddr' => '152.53.159.169',
'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
],
'backup' => [
'hostaddr' => '10.233.1.241',
'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
'database' => 'LIVE',
],
'dev' => [
'hostaddr' => '10.233.1.243',
'hostaddr' => '152.53.159.169',
'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
],
'live' => [
'hostaddr' => '10.233.1.244',
'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
],
'error' => [
'hostaddr' => '10.233.1.244',
'username' => 'error',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
]
];
$enviroment = 'live';
@@ -59,7 +42,6 @@ function db_connect() {
$conn->set_charset("utf8mb4");
return $conn;
} catch (mysqli_sql_exception $e) {
errorMail(
@@ -67,9 +49,7 @@ function db_connect() {
$e->getMessage(),
false,
);
redirectToWebsite("https://blackpi.ipv64.net");
redirectToWebsite("https://mrhossa.de");
throw $e;
}
}
?>
}
+26 -25
View File
@@ -52,7 +52,8 @@ if (
$selectedService = $_GET['service'];
}
if (!$selectedService &&
if (
!$selectedService &&
isset($defaultService) &&
isset($services[$defaultService]) &&
$services[$defaultService]['active']
@@ -68,14 +69,14 @@ if (!$selectedService) {
}
}
}
if ($selectedService && !in_array($selectedService, $userRights, true)) {
$selectedService = null;
}
$isAdmin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'] === true;
if ((new getSpecificData())->getWebsite() != "backend.blackpi.ipv64.net") {
if ((new getSpecificData())->getWebsite() != "backend.mrhossa.de") {
$title = "DEV Backend";
} else {
$title = "Backend";
@@ -101,7 +102,7 @@ if ((new getSpecificData())->getWebsite() != "backend.blackpi.ipv64.net") {
<div class="main">
<div class="sidebar">
<?php foreach ($serviceGroups as $groupKey => $group): ?>
<?php
<?php
$visibleServices = [];
foreach ($group['services'] as $serviceKey) {
@@ -115,34 +116,34 @@ if ((new getSpecificData())->getWebsite() != "backend.blackpi.ipv64.net") {
if (empty($visibleServices)) continue;
$isOpen = !empty($group['defaultOpen']) || in_array($selectedService, $visibleServices, true);
?>
<div class="service-group <?= $isOpen ? 'open' : '' ?>" data-group="<?= $groupKey ?>">
?>
<div class="service-group <?= $isOpen ? 'open' : '' ?>" data-group="<?= $groupKey ?>">
<div class="group-title">
<?= htmlspecialchars($group['label']) ?>
<span class="arrow">▸</span>
</div>
<div class="group-title">
<?= htmlspecialchars($group['label']) ?>
<span class="arrow">▸</span>
</div>
<div class="group-services">
<?php foreach ($visibleServices as $serviceKey): ?>
<a href="?service=<?= $serviceKey ?>">
<button class="<?= $selectedService === $serviceKey ? 'active' : '' ?>">
<?= htmlspecialchars($services[$serviceKey]['name']) ?>
</button>
</a>
<?php endforeach; ?>
<div class="group-services">
<?php foreach ($visibleServices as $serviceKey): ?>
<a href="?service=<?= $serviceKey ?>">
<button class="<?= $selectedService === $serviceKey ? 'active' : '' ?>">
<?= htmlspecialchars($services[$serviceKey]['name']) ?>
</button>
</a>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="content">
<?php
if ($selectedService) {
include "services/$selectedService.php";
logging();
} else {
echo "<p>Kein aktiver Service verfügbar.</p>";
}
if ($selectedService) {
include "services/$selectedService.php";
logging();
} else {
echo "<p>Kein aktiver Service verfügbar.</p>";
}
?>
</div>
</div>
+1 -1
View File
@@ -32,7 +32,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
logging();
sendMail(
"Gast Login erfolgreich",
"Gast Login Successful",
"Benutzer: gast",
(new getSpecificData())->getRequestURL(),
true,
+9 -2
View File
@@ -1,10 +1,17 @@
<?php
include_once(__DIR__ . '/modules/Mail.php');
include_once(__DIR__ . '/controller/DataController.php');
include_once(__DIR__ . '/controller/LogController.php');
try {
session_start();
logging();
sendMail(
"User Logged Out Successful",
(new getSpecificData())->getUsername(),
(new getSpecificData())->getRequestURL(),
true
);
$_SESSION = array();
session_destroy();
@@ -22,4 +29,4 @@ try {
true,
);
exit();
}
}
+6 -3
View File
@@ -29,9 +29,12 @@ function sendMail($subject, $message, $url, bool $log, $to = "bruno.eckhardt07@g
function errorMail($title, $error, bool $log)
{
$headers = "From: bruno.eckhardt07@gmail.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
mail(
"bruno.eckhardt07@gmail.com",
"ERROR: $title",
"[ERROR] $title",
$error,
$headers,
);
@@ -40,9 +43,9 @@ function errorMail($title, $error, bool $log)
"Mailing",
"DATUM, SUBJECT, MESSAGE, URL, CLIENT_IP",
(new getSpecificData())->getRequestTime(),
"ERROR: $title",
"[ERROR] $title",
$error,
(new getSpecificData())->getClientIP(),
);
}
}
}
+58 -58
View File
@@ -1,14 +1,14 @@
<?php
$conn = db_connect();
$sql = "SELECT DATE(FIRST_REQUEST) as tag, COUNT(*) as anzahl FROM logs WHERE WEBSITE = 'backend.blackpi.ipv64.net' GROUP BY DATE(FIRST_REQUEST) ORDER BY DATE(FIRST_REQUEST)";
$sql = "SELECT DATE(FIRST_REQUEST) as tag, COUNT(*) as anzahl FROM logs WHERE WEBSITE = 'backend.mrhossa.de' GROUP BY DATE(FIRST_REQUEST) ORDER BY DATE(FIRST_REQUEST)";
$result = $conn->query($sql);
$labels = [];
$data = [];
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
while ($row = $result->fetch_assoc()) {
$labels[] = $row['tag'];
$data[] = (int)$row['anzahl'];
}
@@ -33,71 +33,71 @@ $conn->close();
<canvas id="logChart" width="600" height="400"></canvas>
<script>
const ctx = document.getElementById('logChart').getContext('2d');
const logChart = new Chart(ctx, {
type: 'line',
data: {
labels: <?php echo json_encode($labels); ?>,
datasets: [{
label: 'Logs pro Tag',
data: <?php echo json_encode($data); ?>,
borderColor: 'rgba(75, 192, 192, 1)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
fill: true,
tension: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Logs pro Tag'
},
legend: {
display: true,
position: 'top'
},
zoom: {
pan: {
enabled: true,
mode: 'x',
const ctx = document.getElementById('logChart').getContext('2d');
const logChart = new Chart(ctx, {
type: 'line',
data: {
labels: <?php echo json_encode($labels); ?>,
datasets: [{
label: 'Logs pro Tag',
data: <?php echo json_encode($data); ?>,
borderColor: 'rgba(75, 192, 192, 1)',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
fill: true,
tension: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Logs pro Tag'
},
legend: {
display: true,
position: 'top'
},
zoom: {
wheel: {
pan: {
enabled: true,
mode: 'x',
},
mode: 'x',
}
}
},
interaction: {
mode: 'index',
intersect: false
},
scales: {
x: {
title: {
display: true,
text: 'Datum'
zoom: {
wheel: {
enabled: true,
},
mode: 'x',
}
}
},
y: {
min: 0,
max: 100,
title: {
display: true,
text: 'Anzahl Logs'
interaction: {
mode: 'index',
intersect: false
},
scales: {
x: {
title: {
display: true,
text: 'Datum'
}
},
ticks: {
stepSize: 20
},
beginAtZero: true
y: {
min: 0,
max: 100,
title: {
display: true,
text: 'Anzahl Logs'
},
ticks: {
stepSize: 20
},
beginAtZero: true
}
}
}
}
});
});
</script>
</body>
+24 -24
View File
@@ -40,7 +40,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE DATE(FIRST_REQUEST) = CURDATE()
AND (WEBSITE = 'backend.blackpi.ipv64.net')
AND (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql)
ORDER BY FIRST_REQUEST DESC
";
@@ -50,7 +50,7 @@ if (!$useCustom) {
$sql = "
SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter
FROM logs
WHERE (WEBSITE = 'backend.blackpi.ipv64.net')
WHERE (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql)
GROUP BY CLIENT_IP
ORDER BY gesamt_counter DESC
@@ -62,7 +62,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node1'
AND (WEBSITE = 'backend.blackpi.ipv64.net')
AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC
";
break;
@@ -72,7 +72,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node2'
AND (WEBSITE = 'backend.blackpi.ipv64.net')
AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC
";
break;
@@ -82,7 +82,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node3'
AND (WEBSITE = 'backend.blackpi.ipv64.net')
AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC
";
break;
@@ -92,7 +92,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node4'
AND (WEBSITE = 'backend.blackpi.ipv64.net')
AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC
";
break;
@@ -101,7 +101,7 @@ if (!$useCustom) {
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE (WEBSITE = 'backend.blackpi.ipv64.net')
WHERE (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql)
ORDER BY FIRST_REQUEST DESC
";
@@ -116,7 +116,7 @@ if (!$useCustom) {
<select name="filter" onchange="this.form.submit()">
<?php
$options = ['alle','today','node1','node2','node3','node4','counterperip'];
$options = ['alle', 'today', 'node1', 'node2', 'node3', 'node4', 'counterperip'];
foreach ($options as $opt) {
$sel = ($filter === $opt) ? 'selected' : '';
echo "<option value='$opt' $sel>$opt</option>";
@@ -150,25 +150,25 @@ if ($erg = $conn->query($sql)) {
?>
<?php if (!$daten): ?>
<b>Keine Daten gefunden</b>
<b>Keine Daten gefunden</b>
<?php else: ?>
<div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr>
<?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?>
</tr>
<div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr>
<?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?>
</tr>
<?php foreach ($daten as $row): ?>
<tr>
<?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td>
<?php foreach ($daten as $row): ?>
<tr>
<?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
</div>
</table>
</div>
<?php endif; ?>
+17 -17
View File
@@ -57,9 +57,9 @@ $domains = DatabaseShow("Domains", "*");
</h2>
<?php if ($statusMsg): ?>
<div class="status-msg">
<?= htmlspecialchars($statusMsg) ?>
</div>
<div class="status-msg">
<?= htmlspecialchars($statusMsg) ?>
</div>
<?php endif; ?>
@@ -67,27 +67,27 @@ $domains = DatabaseShow("Domains", "*");
<?php foreach ($domains as $domain): ?>
<form method="post" class="admin-card">
<form method="post" class="admin-card">
<input type="hidden" name="id" value="<?= $domain["ID"] ?>">
<input type="hidden" name="id" value="<?= $domain["ID"] ?>">
<label>Subdomain</label>
<label>Subdomain</label>
<input type="text" name="subdomain" value="<?= htmlspecialchars($domain["SUBDOMAIN"]) ?>">
<input type="text" name="subdomain" value="<?= htmlspecialchars($domain["SUBDOMAIN"]) ?>">
<div style="margin-top:10px; display:flex; gap:10px;">
<div style="margin-top:10px; display:flex; gap:10px;">
<button type="submit" name="save_domain" class="btn-save">
Speichern
</button>
<button type="submit" name="save_domain" class="btn-save">
Speichern
</button>
<button type="submit" name="delete_domain" class="btn-delete">
Löschen
</button>
<button type="submit" name="delete_domain" class="btn-delete">
Löschen
</button>
</div>
</div>
</form>
</form>
<?php endforeach; ?>
@@ -100,7 +100,7 @@ $domains = DatabaseShow("Domains", "*");
<label>Subdomain</label>
<input type="text" name="subdomain" placeholder="z.B. kleinerpenis.blackpi.ipv64.net">
<input type="text" name="subdomain" placeholder="z.B. kleinerpenis.mrhossa.de">
<button type="submit" name="add_domain" class="btn-add">
Domain hinzufügen
+45 -45
View File
@@ -35,77 +35,77 @@ if ($customQuery) {
// Standard Queries
if (!$useCustom) {
switch ($filter) {
case 'today':
$sql = "
case 'today':
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql)
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
AND DATE(FIRST_REQUEST) = CURDATE()
ORDER BY FIRST_REQUEST DESC
";
break;
break;
case 'counterperip':
$sql = "
case 'counterperip':
$sql = "
SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter
FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql)
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
GROUP BY CLIENT_IP
ORDER BY gesamt_counter DESC
";
break;
break;
case 'node1':
$sql = "
case 'node1':
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node1'
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
ORDER BY `FIRST_REQUEST` DESC
";
break;
break;
case 'node2':
$sql = "
case 'node2':
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node2'
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
ORDER BY `FIRST_REQUEST` DESC
";
break;
break;
case 'node3':
$sql = "
case 'node3':
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node3'
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
ORDER BY `FIRST_REQUEST` DESC
";
break;
break;
case 'node4':
$sql = "
case 'node4':
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE `SERVER_IP` = 'node4'
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
ORDER BY `FIRST_REQUEST` DESC
";
break;
break;
default:
$sql = "
default:
$sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql)
AND (WEBSITE != 'backend.blackpi.ipv64.net' OR WEBSITE IS NULL)
AND (WEBSITE != 'backend.mrhossa.de' OR WEBSITE IS NULL)
ORDER BY FIRST_REQUEST DESC
";
}
}
}
?>
@@ -116,7 +116,7 @@ if (!$useCustom) {
<select name="filter" onchange="this.form.submit()">
<?php
$options = ['alle','today','node1','node2','node3','node4','counterperip'];
$options = ['alle', 'today', 'node1', 'node2', 'node3', 'node4', 'counterperip'];
foreach ($options as $opt) {
$sel = ($filter === $opt) ? 'selected' : '';
echo "<option value='$opt' $sel>$opt</option>";
@@ -150,25 +150,25 @@ if ($erg = $conn->query($sql)) {
?>
<?php if (!$daten): ?>
<b>Keine Daten gefunden</b>
<b>Keine Daten gefunden</b>
<?php else: ?>
<div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr>
<?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?>
</tr>
<div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr>
<?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?>
</tr>
<?php foreach ($daten as $row): ?>
<tr>
<?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td>
<?php foreach ($daten as $row): ?>
<tr>
<?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
</div>
</table>
</div>
<?php endif; ?>
+101
View File
@@ -0,0 +1,101 @@
<?php
include_once(__DIR__ . '/../controller/DatabaseController.php');
include_once(__DIR__ . '/../controller/RoutesController.php');
include_once(__DIR__ . '/../modules/Mail.php');
$view = $_GET['view'] ?? 'show';
$selectedService = $_GET['service'] ?? null;
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) {
$titel = $_POST['titel'];
$beschreibung = $_POST['beschreibung'];
DatabaseInsert(
"Tickets",
"TITEL, BESCHREIBUNG, STATUS, ERSTELLER",
$titel,
$beschreibung,
"OFFEN",
ucfirst(strtolower((new getSpecificData())->getUsername())),
);
$html = "Titel: $titel\nBeschreibung: $beschreibung";
$user = ucfirst(strtolower((new getSpecificData())->getUsername()));
sendMail(
"Neues Ticket von $user",
$html,
(new getSpecificData())->getRequestURL(),
true,
);
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_entry'])) {
$id = $_POST['id'];
DatabaseDelete("Tickets", "ID = ?", $id);
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
$entries = DatabaseShow(
"Tickets",
"TITEL, BESCHREIBUNG, STATUS",
"ERSTELLER = ?",
((new getSpecificData())->getUsername()),
);
?>
<div>
<div class="vergabe-form">
<h3>Neues Ticket anlegen</h3>
<form method="POST" class="vergabe-grid">
<div class="form-group">
<label>Titel</label>
<input type="text" name="titel" required>
</div>
<div class="form-group">
<label>Beschreibung</label>
<input type="text" name="beschreibung" required>
</div>
<button type="submit" name="add_entry" class="btn-submit-vergabe">
💾 Speichern
</button>
</form>
</div>
<div class="table-container" style="margin-top: 30px;">
<h3>Tickets</h3>
<?php if (!empty($entries)): ?>
<table class="db-table mobile-responsive-table">
<thead>
<tr>
<th>Titel</th>
<th>Beschreibung</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($entries as $entry): ?>
<tr>
<td data-label="Titel"><?= htmlspecialchars($entry['TITEL'] ?? '') ?></td>
<td data-label="Beschreibung"><?= htmlspecialchars($entry['BESCHREIBUNG'] ?? '') ?></td>
<td data-label="Status"><?= htmlspecialchars($entry['STATUS'] ?? '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>Keine Tickets vorhanden.</p>
<?php endif; ?>
</div>
</div>
+103
View File
@@ -0,0 +1,103 @@
<?php
include_once(__DIR__ . '/../controller/DatabaseController.php');
include_once(__DIR__ . '/../controller/RoutesController.php');
include_once(__DIR__ . '/../modules/Mail.php');
$view = $_GET['view'] ?? 'show';
$selectedService = $_GET['service'] ?? null;
$allowedStatuses = ['OFFEN', 'DEPLOYED', 'ABGELEHNT', 'ANGENOMMEN'];
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['edit_entry'])) {
$id = $_POST['id'];
$status = $_POST['status'] ?? '';
if (in_array($status, $allowedStatuses, true)) {
DatabaseUpdate(
"Tickets",
"STATUS = ?",
"ID = ?",
$status,
$id
);
}
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_entry'])) {
$id = $_POST['id'];
DatabaseDelete(
"Tickets",
"ID = ?",
$id
);
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
$entries = DatabaseShow(
"Tickets",
"ID, TITEL, BESCHREIBUNG, STATUS, ERSTELLER",
);
?>
<div>
<div class="table-container" style="margin-top: 30px;">
<h3>Ticket Verwaltung</h3>
<?php if (!empty($entries)): ?>
<table class="db-table mobile-responsive-table">
<thead>
<tr>
<th>Titel</th>
<th>Beschreibung</th>
<th>Status</th>
<th>Ersteller</th>
<th style="width: 220px;">Aktion</th>
</tr>
</thead>
<tbody>
<?php foreach ($entries as $entry): ?>
<tr>
<td data-label="Titel"><?= htmlspecialchars($entry['TITEL'] ?? '') ?></td>
<td data-label="Beschreibung"><?= htmlspecialchars($entry['BESCHREIBUNG'] ?? '') ?></td>
<td data-label="Status"><?= htmlspecialchars($entry['STATUS'] ?? '') ?></td>
<td data-label="Ersteller"><?= htmlspecialchars($entry['ERSTELLER'] ?? '') ?></td>
<td data-label="Aktion">
<form method="POST"
style="margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch;">
<input type="hidden" name="id" value="<?= htmlspecialchars($entry['ID'] ?? '') ?>">
<select name="status" class="status-select">
<?php foreach ($allowedStatuses as $statusOption): ?>
<option value="<?= htmlspecialchars($statusOption) ?>"
<?= ($entry['STATUS'] ?? '') === $statusOption ? 'selected' : '' ?>>
<?= htmlspecialchars($statusOption) ?>
</option>
<?php endforeach; ?>
</select>
<button type="submit" name="edit_entry" class="btn-edit">
Speichern
</button>
</form>
<form method="POST"
style="margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch; margin-top: 3pt;">
<input type="hidden" name="id" value="<?= $entry['ID'] ?? '' ?>">
<button type="submit" name="delete_entry" class="btn-delete">
Löschen
</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>Keine Tickets vorhanden.</p>
<?php endif; ?>
</div>
</div>
+19 -6
View File
@@ -880,6 +880,17 @@ body.dark-mode .user-table .btn-primary:hover {
font-size: 0.8rem;
}
.btn-edit {
background-color: #32b844;
color: white;
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.8rem;
}
/* ===== Toggle Switch ===== */
.toggle-card {
@@ -981,8 +992,7 @@ body.dark-mode .info-value {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
/* table-layout: fixed; */
/* sorgt für feste Spaltenbreite */
table-layout: fixed;
}
.db-table thead {
@@ -996,10 +1006,13 @@ body.dark-mode .info-value {
text-align: left;
border-bottom: 1px solid var(--card-border);
/* Wichtig für gleiche Größe */
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; */
word-wrap: break-word;
overflow-wrap: break-word;
white-space: normal;
}
.db-table td:nth-child(2) {
max-width: 300px;
}
.db-table tr:hover {
+26 -28
View File
@@ -1,42 +1,40 @@
#!/bin/bash
# Erzwingt den Abbruch des Skripts, sobald ein Befehl fehlschlägt
set -e
echo "🚀 Starte automatischen Merge- und Tag-Prozess..."
echo "Starte automatischen Merge- und Tag-Prozess..."
# 1. Sicherstellen, dass wir die neuesten Stände vom Server haben
echo "🔄 Aktualisiere lokale Branches vom Remote..."
git fetch --all
git config core.filemode false
# 2. Main aktualisieren
echo "🌿 Prüfe main..."
git checkout main
git pull origin main
echo "Aktualisiere lokale Branches vom Remote..."
git fetch --all --quiet
# 3. Main in Dev mergen
echo "🔀 Merge: main -> dev..."
git checkout dev
git pull origin dev || true # Falls dev lokal noch nicht existiert
git merge main --no-ff -m "Automated merge from main to dev"
git push origin dev
echo "Wechsle zu main..."
git checkout main --quiet
git pull origin main --quiet
# 4. Dev in Live mergen
echo "🔀 Merge: dev -> live..."
git checkout live
git pull origin live || true # Falls live lokal noch nicht existiert
git merge dev --no-ff -m "Automated merge from dev to live"
git push origin live
echo "Merge: main -> dev..."
git checkout dev --quiet
git pull origin dev --quiet || true
git merge main --no-ff -m "Automated merge from main to dev" --quiet
git push origin dev --quiet
echo "Merge: dev -> live..."
git checkout live --quiet
git pull origin live --quiet || true
git merge dev --no-ff -m "Automated merge from dev to live" --quiet
git push origin live --quiet
# 5. Tag erstellen und pushen
# Format: vYYYY.MM.DD-HHMM (z. B. v2026.07.13-1430)
TAG_NAME="v$(date +'%Y.%m.%d-%H%M')"
echo "🏷️ Erstelle Tag: $TAG_NAME..."
echo " Erstelle Tag: $TAG_NAME..."
git tag -a "$TAG_NAME" -m "Automated release tag $TAG_NAME"
git push origin "$TAG_NAME"
git push origin "$TAG_NAME" --quiet
# Zurück auf den Ausgangs-Branch (main) wechseln
git checkout main
git checkout main --quiet
echo "✅ Fertig! Alles erfolgreich gemergt und Tag $TAG_NAME wurde gepusht."
echo ""
echo "========================================================"
echo "✅ FERTIG! Alles sauber durchgelaufen."
echo "📦 Neuer Release-Tag gepusht: $TAG_NAME"
echo "========================================================"