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
Bruno Eckhardt e98dbdc77b Automated merge from dev to live 2026-07-13 12:32:44 +02:00
Bruno Eckhardt aa4829343e Automated merge from main to dev 2026-07-13 12:32:36 +02:00
Bruno Eckhardt 523400ac0e Merge branch 'auto-merge' 2026-07-13 12:31:02 +02:00
Bruno Eckhardt 2064546b19 add auto merge script 2026-07-13 12:30:48 +02:00
Bruno Eckhardt 7d8a891798 Merge branch 'dev' into live 2026-07-13 10:46:24 +02:00
Bruno Eckhardt ddbf5b697f Merge branch 'main' into dev 2026-07-13 10:46:18 +02:00
Bruno Eckhardt d71e2c1e2d api controller fixes 2026-07-13 10:45:32 +02:00
Bruno Eckhardt 643be91c57 Merge branch 'dev' into live 2026-07-08 09:41:07 +02:00
Bruno Eckhardt f1b58a3399 Merge branch 'main' into dev 2026-07-08 09:40:54 +02:00
Bruno Eckhardt 62dadd175c Merge branch 'vergabe-service' 2026-07-08 09:40:41 +02:00
Bruno Eckhardt 3c9eb7091f feat: search persons and onjects 2026-07-08 09:40:32 +02:00
Bruno Eckhardt 7abcac5f04 feat: autofill and archive deleted things 2026-07-08 09:31:20 +02:00
Bruno Eckhardt 61ada9f2e3 Merge branch 'dev' into live 2026-07-08 08:59:44 +02:00
Bruno Eckhardt 5759f999c5 Merge branch 'main' into dev 2026-07-08 08:59:32 +02:00
Bruno Eckhardt 7d03579d31 Merge branch 'vergabe-service' 2026-07-08 08:59:19 +02:00
Bruno Eckhardt 742c5d5b56 feat: autofill 2026-07-08 08:59:03 +02:00
Bruno Eckhardt 20e0e09305 Merge branch 'dev' into live 2026-07-08 08:16:57 +02:00
Bruno Eckhardt d8a0121ac2 Merge branch 'main' into dev 2026-07-08 08:16:50 +02:00
Bruno Eckhardt 0952d6de13 Merge branch 'berufsschulberichte' 2026-07-08 08:15:57 +02:00
Tower 5a9a08421f new berufsschulreport service 2026-07-07 22:13:12 +02:00
Tower 733fc7dc12 Merge branch 'dev' into live 2026-07-07 19:20:36 +02:00
Tower 99f4f8a746 Merge branch 'main' into dev 2026-07-07 19:20:24 +02:00
Tower ffcc8821ed update 2026-07-07 19:19:57 +02:00
Bruno Eckhardt 72f188e239 raw form 2026-07-07 15:44:07 +02:00
Bruno Eckhardt 81ff082d71 Merge branch 'dev' into live 2026-07-07 14:28:05 +02:00
Bruno Eckhardt 3b7453563d Merge branch 'main' into dev 2026-07-07 14:27:52 +02:00
Bruno Eckhardt 6ec159f75c fix email 2026-07-07 14:27:37 +02:00
Bruno Eckhardt 9b1dfa8441 Merge branch 'dev' into live 2026-07-07 10:08:57 +02:00
Bruno Eckhardt 2f285f284b Merge branch 'main' into dev 2026-07-07 10:08:46 +02:00
Bruno Eckhardt d6e70a08eb Merge branch 'termin-service' 2026-07-07 10:08:34 +02:00
Bruno Eckhardt fe5979d4d0 Merge branch 'dev' into live 2026-07-07 09:07:50 +02:00
Bruno Eckhardt 950fcd6f3b Merge branch 'main' into dev 2026-07-07 09:07:39 +02:00
Bruno Eckhardt 10472843a7 Merge branch 'termin-service' 2026-07-07 09:07:27 +02:00
Tower 3843677903 Merge branch 'dev' into live 2026-07-06 22:30:50 +02:00
Tower ca867e91d0 Merge branch 'main' into dev 2026-07-06 22:30:45 +02:00
Tower ad763caaf5 Merge branch 'dev' into live 2026-07-06 22:26:56 +02:00
Tower 9ca5e7617c Merge branch 'main' into dev 2026-07-06 22:26:50 +02:00
Tower 37871de69f Merge branch 'dev' into live 2026-07-06 21:52:19 +02:00
Tower 0431257a44 Merge branch 'main' into dev 2026-07-06 21:52:03 +02:00
Bruno Eckhardt 33e4388b20 Merge branch 'dev' into live 2026-07-06 15:51:42 +02:00
Bruno Eckhardt 5479d0e364 Merge branch 'main' into dev 2026-07-06 15:51:36 +02:00
Bruno Eckhardt 206d56b10c Merge branch 'dev' into live 2026-07-06 15:18:31 +02:00
Bruno Eckhardt f0f7c16abc Merge branch 'main' into dev 2026-07-06 15:18:25 +02:00
Bruno Eckhardt 859f67ca02 Merge branch 'dev' into live 2026-07-06 14:33:49 +02:00
Bruno Eckhardt 69199c78eb Merge branch 'main' into dev 2026-07-06 14:33:41 +02:00
Bruno Eckhardt e0e9bca81a Merge branch 'dev' into live 2026-07-06 14:25:43 +02:00
Bruno Eckhardt 232cc27ce3 Merge branch 'main' into dev 2026-07-06 14:25:25 +02:00
Bruno Eckhardt d727452dd8 Merge branch 'dev' into live 2026-07-06 14:22:17 +02:00
Bruno Eckhardt 636f6b5c37 Merge branch 'main' into dev 2026-07-06 14:22:06 +02:00
Bruno Eckhardt 62844653d2 Merge branch 'dev' into live 2026-07-06 14:13:54 +02:00
Bruno Eckhardt 88a95d28e3 Merge branch 'main' into dev 2026-07-06 14:13:46 +02:00
Bruno Eckhardt 14e01891a2 Merge branch 'dev' into live 2026-07-06 13:50:26 +02:00
Bruno Eckhardt 4cadcf263d Merge branch 'main' into dev 2026-07-06 13:50:21 +02:00
Bruno Eckhardt 1dfc6c9ac5 Merge branch 'dev' into live 2026-07-06 13:42:29 +02:00
Bruno Eckhardt 4e43f234c2 Merge branch 'main' into dev 2026-07-06 13:42:22 +02:00
Bruno Eckhardt 671688f37d Merge branch 'dev' into live 2026-07-06 08:47:47 +02:00
Bruno Eckhardt 1eff0a54a6 Merge branch 'main' into dev 2026-07-06 08:47:42 +02:00
Bruno Eckhardt 5ea0308b83 mobile optimizing 2026-07-06 08:46:30 +02:00
Bruno Eckhardt 859c1563fb Merge branch 'dev' into live 2026-07-06 08:41:00 +02:00
Bruno Eckhardt 9c1c86a7e7 Merge branch 'main' into dev 2026-07-06 08:40:53 +02:00
Tower d6232f6418 Merge branch 'DEV' into LIVE 2026-07-05 19:13:32 +02:00
Tower 878b691ab1 Merge branch 'main' into DEV 2026-07-05 19:13:20 +02:00
Tower a7368eb18f Merge branch 'DEV' into LIVE 2026-07-05 19:07:18 +02:00
Tower 38adea29cf Merge branch 'main' into DEV 2026-07-05 19:07:07 +02:00
Tower f6fbc8404c Merge branch 'DEV' into LIVE 2026-07-01 20:10:15 +02:00
Tower e45fecf6ff Merge branch 'main' into DEV 2026-07-01 20:09:58 +02:00
Bruno Eckhardt 5dce558640 Merge branch 'DEV' into LIVE 2026-05-20 12:33:38 +02:00
Bruno Eckhardt ffb6f38af0 Merge branch 'main' into DEV 2026-05-20 12:33:26 +02:00
Tower 3e54b917ca Merge branch 'DEV' into LIVE 2026-05-19 19:50:24 +02:00
Tower 4756d0586f Merge branch 'main' into DEV 2026-05-19 19:50:14 +02:00
Bruno Eckhardt 86a1eecd8d Merge branch 'DEV' into LIVE 2026-05-19 10:38:34 +02:00
Bruno Eckhardt 9dcf0ced19 Merge branch 'main' into DEV 2026-05-19 10:38:20 +02:00
Bruno Eckhardt c05f9f721c Merge branch 'DEV' into LIVE 2026-05-19 10:11:25 +02:00
Bruno Eckhardt 04c89fb676 Merge branch 'main' into DEV 2026-05-19 10:11:14 +02:00
Bruno Eckhardt 5160bbc5a5 Merge branch 'DEV' into LIVE 2026-05-19 07:17:41 +02:00
Bruno Eckhardt e9550b9a05 Merge branch 'main' into DEV 2026-05-19 07:17:31 +02:00
Bruno Eckhardt c5aabcf5d1 Merge branch 'DEV' into LIVE 2026-05-11 14:17:44 +02:00
Bruno Eckhardt e13ac6c503 Merge branch 'main' into DEV 2026-05-11 14:17:15 +02:00
Bruno Eckhardt bcaaac8a19 Merge branch 'DEV' into LIVE 2026-05-11 13:18:35 +02:00
Bruno Eckhardt e2ee377e35 Merge branch 'main' into DEV 2026-05-11 13:18:23 +02:00
Bruno Eckhardt 57813e3309 Merge branch 'DEV' into LIVE 2026-05-11 13:14:55 +02:00
Bruno Eckhardt 9eb06a3a16 Merge branch 'main' into DEV 2026-05-11 13:14:46 +02:00
Bruno Eckhardt a920fe99a8 Merge branch 'DEV' into LIVE 2026-05-11 13:09:39 +02:00
Bruno Eckhardt 0776ae8dd0 Merge branch 'main' into DEV 2026-05-11 13:09:30 +02:00
Bruno Eckhardt 21fa9145cb Merge branch 'DEV' into LIVE 2026-05-11 12:55:32 +02:00
Bruno Eckhardt c350f4c776 Merge branch 'main' into DEV 2026-05-11 12:55:21 +02:00
Tower fd5f3093c6 Merge branch 'DEV' into LIVE 2026-04-10 21:44:08 +02:00
Tower c47723ec00 Merge branch 'main' into DEV 2026-04-10 21:43:42 +02:00
Tower 737ea6e962 Merge branch 'DEV' into LIVE 2026-04-08 16:54:39 +02:00
Tower 0e5cdcd725 Merge branch 'main' into DEV 2026-04-08 16:54:24 +02:00
Bruno Eckhardt 739fda06e7 db fix 2026-04-08 16:36:53 +02:00
Bruno Eckhardt 3d170a38d8 Merge branch 'main' into DEV 2026-04-08 16:35:47 +02:00
Bruno Eckhardt 03febbc877 fix 2026-03-27 06:57:33 +01:00
Bruno Eckhardt bdc41bbd48 Merge branch 'main' into LIVE 2026-03-27 06:56:36 +01:00
Bruno Eckhardt 1f3e8228d1 fix 2026-03-26 08:13:59 +01:00
Bruno Eckhardt dccec7642b Merge branch 'DEV' into LIVE
# Conflicts:
#	WEBROOT/controller/DatabaseConnect.php
2026-03-26 08:13:20 +01:00
Bruno Eckhardt 6f74a11a79 Merge branch 'main' into DEV 2026-03-26 08:11:59 +01:00
Bruno Eckhardt ea51b1808a Merge branch 'main' into DEV 2026-03-25 08:47:16 +01:00
Bruno Eckhardt 2eacb68fd6 Merge branch 'main' into LIVE 2026-03-25 08:47:05 +01:00
Bruno Eckhardt 8c53e850c1 Merge branch 'main' into LIVE 2026-03-25 07:46:45 +01:00
Bruno Eckhardt 0d9b9e7b07 Merge branch 'main' into DEV 2026-03-25 07:46:23 +01:00
Bruno Eckhardt 9b6060d39f Merge branch 'main' into DEV 2026-03-23 15:45:43 +01:00
Bruno Eckhardt 01d6c69b3e Merge branch 'main' into LIVE 2026-03-23 15:45:26 +01:00
Bruno Eckhardt 7c94592b2c Merge branch 'main' into LIVE 2026-03-23 10:48:08 +01:00
Bruno Eckhardt 883a1fd76f Merge branch 'main' into DEV 2026-03-23 10:37:03 +01:00
Bruno Eckhardt dd08ec793a Merge branch 'main' into DEV 2026-03-23 08:58:33 +01:00
Bruno Eckhardt 24799dffbe Merge branch 'main' into LIVE 2026-03-23 08:58:26 +01:00
Bruno Eckhardt 34f464f442 dev db 2026-03-23 08:20:25 +01:00
Bruno Eckhardt d1464d874f Merge branch 'main' into LIVE 2026-03-23 08:19:28 +01:00
Bruno Eckhardt 8f5a616dd8 live db 2026-03-23 08:18:54 +01:00
21 changed files with 1188 additions and 277 deletions

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
} }
], ],
"settings": { "settings": {
"workbench.colorTheme": "Default Dark Modern", "workbench.colorTheme": "Dark Modern",
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"activityBar.background": "#ff000075", "activityBar.background": "#ff000075",
"activityBar.foreground": "#000000", "activityBar.foreground": "#000000",
+2 -2
View File
@@ -1,7 +1,7 @@
<?php <?php
// loginTest.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 // Testfälle
$tests = [ $tests = [
@@ -51,4 +51,4 @@ foreach ($tests as $test) {
} else { } else {
echo "[FAIL] {$test['description']}\n"; echo "[FAIL] {$test['description']}\n";
} }
} }
+32 -4
View File
@@ -20,6 +20,7 @@ $serviceGroups = array (
2 => 'links', 2 => 'links',
3 => 'einkaufsliste', 3 => 'einkaufsliste',
4 => 'termine', 4 => 'termine',
5 => 'ticket_board',
), ),
), ),
'Ausbildung' => 'Ausbildung' =>
@@ -32,12 +33,14 @@ $serviceGroups = array (
1 => 'zeiterfassung', 1 => 'zeiterfassung',
2 => 'berichte_arbeit_gen', 2 => 'berichte_arbeit_gen',
3 => 'berichte', 3 => 'berichte',
4 => 'firmenberichte',
5 => 'berufsschulberichte',
), ),
), ),
'Logs' => 'Logs' =>
array ( array (
'label' => 'Webserver', 'label' => 'Webserver',
'defaultOpen' => true, 'defaultOpen' => false,
'services' => 'services' =>
array ( array (
0 => 'public_request_logs', 0 => 'public_request_logs',
@@ -57,6 +60,7 @@ $serviceGroups = array (
1 => 'services_control', 1 => 'services_control',
2 => 'user_control', 2 => 'user_control',
3 => 'variablen_control', 3 => 'variablen_control',
4 => 'ticket_control',
), ),
), ),
'Test' => 'Test' =>
@@ -206,6 +210,30 @@ $services = array (
'active' => true, 'active' => true,
'adminOnly' => false, 'adminOnly' => false,
), ),
'firmenberichte' =>
array (
'name' => 'Firmenberichte',
'active' => true,
'adminOnly' => false,
),
'berufsschulberichte' =>
array (
'name' => 'Berufsschulberichte',
'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 ( $linkGroups = array (
@@ -239,7 +267,7 @@ $linkButtons = array (
0 => 0 =>
array ( array (
'label' => 'Gitea', 'label' => 'Gitea',
'url' => 'http://gitea.blackpi.ipv64.net', 'url' => 'http://gitea.mrhossa.de',
'newTab' => true, 'newTab' => true,
'adminOnly' => false, 'adminOnly' => false,
'group' => 'admin', 'group' => 'admin',
@@ -247,7 +275,7 @@ $linkButtons = array (
1 => 1 =>
array ( array (
'label' => 'HAProxy', 'label' => 'HAProxy',
'url' => 'http://stats.blackpi.ipv64.net', 'url' => 'http://stats.mrhossa.de',
'newTab' => true, 'newTab' => true,
'adminOnly' => false, 'adminOnly' => false,
'group' => 'admin', 'group' => 'admin',
@@ -255,7 +283,7 @@ $linkButtons = array (
2 => 2 =>
array ( array (
'label' => 'Public', 'label' => 'Public',
'url' => 'https://blackpi.ipv64.net', 'url' => 'https://mrhossa.de',
'newTab' => true, 'newTab' => true,
'adminOnly' => false, 'adminOnly' => false,
'group' => 'info', 'group' => 'info',
+22 -14
View File
@@ -1,21 +1,23 @@
<?php <?php
require(__DIR__ . '/DatabaseController.php'); include_once(__DIR__ . '/DatabaseController.php');
class ApiController
{
class ApiController {
/** /**
* method for pretty jsonsuccess output * method for pretty jsonsuccess output
* *
* @param array $data * @param array $data
* @return string * @return string
*/ */
public function jsonSuccess($data) { public function jsonSuccess($data)
{
return json_encode( return json_encode(
[ [
'status' => 'success', 'status' => 'success',
'data' => $data, 'data' => $data,
], ],
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
); );
} }
@@ -26,13 +28,14 @@ class ApiController {
* @param array $error * @param array $error
* @return string * @return string
*/ */
public function jsonError ($error) { public function jsonError($error)
{
echo json_encode( echo json_encode(
[ [
'status' => 'failed', 'status' => 'failed',
'data' => 'none', 'data' => 'none',
'error' => $error 'error' => $error
], ],
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
); );
} }
@@ -42,7 +45,8 @@ class ApiController {
* *
* @return array * @return array
*/ */
private function getAuthKey () { private function getAuthKey()
{
$validTokens = DatabaseShow( $validTokens = DatabaseShow(
"API_Credentials", "API_Credentials",
"TOKEN" "TOKEN"
@@ -58,7 +62,8 @@ class ApiController {
* @param string $function * @param string $function
* @return void * @return void
*/ */
public function urlAuth ($token, $function = '') { public function urlAuth($token, $function = '')
{
$validTokens = $this->getAuthKey(); $validTokens = $this->getAuthKey();
if (!in_array($token, $validTokens)) { if (!in_array($token, $validTokens)) {
@@ -90,7 +95,8 @@ class ApiController {
return true; return true;
} }
public function requestSave($function = '') { public function requestSave($function = '')
{
DatabaseInsert( DatabaseInsert(
"API_LOGS", "API_LOGS",
"CLIENT_IP, TOKEN, API, FUNKTION, JSON", "CLIENT_IP, TOKEN, API, FUNKTION, JSON",
@@ -106,7 +112,8 @@ class ApiController {
* create new api token * create new api token
* *
*/ */
private function createToken() { private function createToken()
{
return bin2hex(random_bytes(32)); return bin2hex(random_bytes(32));
} }
@@ -115,8 +122,9 @@ class ApiController {
* *
* @return bool * @return bool
*/ */
public function saveToken() { public function saveToken()
try { {
try {
DatabaseInsert( DatabaseInsert(
"API_Credentials", "API_Credentials",
"TOKEN, BENUTZER", "TOKEN, BENUTZER",
@@ -128,4 +136,4 @@ class ApiController {
} }
return true; return true;
} }
} }
+2 -28
View File
@@ -108,13 +108,7 @@ class getSpecificData {
} }
public function getServerIP(): string { public function getServerIP(): string {
$ServerIP = $_SERVER['SERVER_ADDR'] ?? 'Unbekannt'; return $_SERVER['SERVER_ADDR'] ?? 'Unbekannt';
if (in_array($ServerIP, ['Unbekannt', '0.0.0.0', '127.0.0.1'])) {
return "Lokal";
} else {
return $ServerIP;
}
} }
public function getClientIP(): string public function getClientIP(): string
@@ -166,27 +160,7 @@ class getSpecificData {
} }
function getServerNode($ServerIP) { function getServerNode($ServerIP) {
$nodes = [ return $ServerIP;
'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;
}
}
} }
function getClientStatus($ClientIP) { function getClientStatus($ClientIP) {
+9 -29
View File
@@ -4,7 +4,8 @@ include_once __DIR__ . '/../modules/Mail.php';
include_once __DIR__ . '/../controller/RoutesController.php'; include_once __DIR__ . '/../controller/RoutesController.php';
include_once 'DataController.php'; include_once 'DataController.php';
function db_connect() { function db_connect()
{
$servers = [ $servers = [
'local' => [ 'local' => [
'hostaddr' => '127.0.0.1', 'hostaddr' => '127.0.0.1',
@@ -12,39 +13,21 @@ function db_connect() {
'password' => 'bBHofurUJWKzPE8Z', 'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV', 'database' => 'DEV',
], ],
'vpn' => [ 'live' => [
'hostaddr' => '100.123.136.86', 'hostaddr' => '152.53.159.169',
'username' => 'worker', 'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z', 'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV', 'database' => 'LIVE',
],
'backup' => [
'hostaddr' => '10.233.1.241',
'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV',
], ],
'dev' => [ 'dev' => [
'hostaddr' => '10.233.1.243', 'hostaddr' => '152.53.159.169',
'username' => 'worker', 'username' => 'worker',
'password' => 'bBHofurUJWKzPE8Z', 'password' => 'bBHofurUJWKzPE8Z',
'database' => 'DEV', '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 = 'vpn'; $enviroment = 'live';
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
@@ -59,7 +42,6 @@ function db_connect() {
$conn->set_charset("utf8mb4"); $conn->set_charset("utf8mb4");
return $conn; return $conn;
} catch (mysqli_sql_exception $e) { } catch (mysqli_sql_exception $e) {
errorMail( errorMail(
@@ -67,9 +49,7 @@ function db_connect() {
$e->getMessage(), $e->getMessage(),
false, false,
); );
redirectToWebsite("https://blackpi.ipv64.net"); redirectToWebsite("https://mrhossa.de");
throw $e; throw $e;
} }
} }
?>
+26 -25
View File
@@ -52,7 +52,8 @@ if (
$selectedService = $_GET['service']; $selectedService = $_GET['service'];
} }
if (!$selectedService && if (
!$selectedService &&
isset($defaultService) && isset($defaultService) &&
isset($services[$defaultService]) && isset($services[$defaultService]) &&
$services[$defaultService]['active'] $services[$defaultService]['active']
@@ -68,14 +69,14 @@ if (!$selectedService) {
} }
} }
} }
if ($selectedService && !in_array($selectedService, $userRights, true)) { if ($selectedService && !in_array($selectedService, $userRights, true)) {
$selectedService = null; $selectedService = null;
} }
$isAdmin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'] === true; $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"; $title = "DEV Backend";
} else { } else {
$title = "Backend"; $title = "Backend";
@@ -101,7 +102,7 @@ if ((new getSpecificData())->getWebsite() != "backend.blackpi.ipv64.net") {
<div class="main"> <div class="main">
<div class="sidebar"> <div class="sidebar">
<?php foreach ($serviceGroups as $groupKey => $group): ?> <?php foreach ($serviceGroups as $groupKey => $group): ?>
<?php <?php
$visibleServices = []; $visibleServices = [];
foreach ($group['services'] as $serviceKey) { foreach ($group['services'] as $serviceKey) {
@@ -115,34 +116,34 @@ if ((new getSpecificData())->getWebsite() != "backend.blackpi.ipv64.net") {
if (empty($visibleServices)) continue; if (empty($visibleServices)) continue;
$isOpen = !empty($group['defaultOpen']) || in_array($selectedService, $visibleServices, true); $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"> <div class="group-title">
<?= htmlspecialchars($group['label']) ?> <?= htmlspecialchars($group['label']) ?>
<span class="arrow">▸</span> <span class="arrow">▸</span>
</div> </div>
<div class="group-services"> <div class="group-services">
<?php foreach ($visibleServices as $serviceKey): ?> <?php foreach ($visibleServices as $serviceKey): ?>
<a href="?service=<?= $serviceKey ?>"> <a href="?service=<?= $serviceKey ?>">
<button class="<?= $selectedService === $serviceKey ? 'active' : '' ?>"> <button class="<?= $selectedService === $serviceKey ? 'active' : '' ?>">
<?= htmlspecialchars($services[$serviceKey]['name']) ?> <?= htmlspecialchars($services[$serviceKey]['name']) ?>
</button> </button>
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
</div>
</div> </div>
</div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="content"> <div class="content">
<?php <?php
if ($selectedService) { if ($selectedService) {
include "services/$selectedService.php"; include "services/$selectedService.php";
logging(); logging();
} else { } else {
echo "<p>Kein aktiver Service verfügbar.</p>"; echo "<p>Kein aktiver Service verfügbar.</p>";
} }
?> ?>
</div> </div>
</div> </div>
+1 -1
View File
@@ -32,7 +32,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
logging(); logging();
sendMail( sendMail(
"Gast Login erfolgreich", "Gast Login Successful",
"Benutzer: gast", "Benutzer: gast",
(new getSpecificData())->getRequestURL(), (new getSpecificData())->getRequestURL(),
true, true,
+9 -2
View File
@@ -1,10 +1,17 @@
<?php <?php
include_once(__DIR__ . '/modules/Mail.php'); include_once(__DIR__ . '/modules/Mail.php');
include_once(__DIR__ . '/controller/DataController.php'); include_once(__DIR__ . '/controller/DataController.php');
include_once(__DIR__ . '/controller/LogController.php');
try { try {
session_start(); session_start();
logging();
sendMail(
"User Logged Out Successful",
(new getSpecificData())->getUsername(),
(new getSpecificData())->getRequestURL(),
true
);
$_SESSION = array(); $_SESSION = array();
session_destroy(); session_destroy();
@@ -22,4 +29,4 @@ try {
true, true,
); );
exit(); exit();
} }
+7 -4
View File
@@ -3,7 +3,7 @@
include_once __DIR__ . '/../controller/DatabaseController.php'; include_once __DIR__ . '/../controller/DatabaseController.php';
include_once __DIR__ . '/../controller/DataController.php'; include_once __DIR__ . '/../controller/DataController.php';
function sendMail($subject, $message, $url, bool $log, $to = "bruno.eckhardt07 qmail.com") function sendMail($subject, $message, $url, bool $log, $to = "bruno.eckhardt07@gmail.com")
{ {
$headers = "From: bruno.eckhardt07@gmail.com\r\n"; $headers = "From: bruno.eckhardt07@gmail.com\r\n";
mail( mail(
@@ -29,9 +29,12 @@ function sendMail($subject, $message, $url, bool $log, $to = "bruno.eckhardt07 q
function errorMail($title, $error, bool $log) function errorMail($title, $error, bool $log)
{ {
$headers = "From: bruno.eckhardt07@gmail.com\r\n"; $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( mail(
"bruno.eckhardt07@gmail.com", "bruno.eckhardt07@gmail.com",
"ERROR: $title", "[ERROR] $title",
$error, $error,
$headers, $headers,
); );
@@ -40,9 +43,9 @@ function errorMail($title, $error, bool $log)
"Mailing", "Mailing",
"DATUM, SUBJECT, MESSAGE, URL, CLIENT_IP", "DATUM, SUBJECT, MESSAGE, URL, CLIENT_IP",
(new getSpecificData())->getRequestTime(), (new getSpecificData())->getRequestTime(),
"ERROR: $title", "[ERROR] $title",
$error, $error,
(new getSpecificData())->getClientIP(), (new getSpecificData())->getClientIP(),
); );
} }
} }
+58 -58
View File
@@ -1,14 +1,14 @@
<?php <?php
$conn = db_connect(); $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); $result = $conn->query($sql);
$labels = []; $labels = [];
$data = []; $data = [];
if ($result->num_rows > 0) { if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$labels[] = $row['tag']; $labels[] = $row['tag'];
$data[] = (int)$row['anzahl']; $data[] = (int)$row['anzahl'];
} }
@@ -33,71 +33,71 @@ $conn->close();
<canvas id="logChart" width="600" height="400"></canvas> <canvas id="logChart" width="600" height="400"></canvas>
<script> <script>
const ctx = document.getElementById('logChart').getContext('2d'); const ctx = document.getElementById('logChart').getContext('2d');
const logChart = new Chart(ctx, { const logChart = new Chart(ctx, {
type: 'line', type: 'line',
data: { data: {
labels: <?php echo json_encode($labels); ?>, labels: <?php echo json_encode($labels); ?>,
datasets: [{ datasets: [{
label: 'Logs pro Tag', label: 'Logs pro Tag',
data: <?php echo json_encode($data); ?>, data: <?php echo json_encode($data); ?>,
borderColor: 'rgba(75, 192, 192, 1)', borderColor: 'rgba(75, 192, 192, 1)',
backgroundColor: 'rgba(75, 192, 192, 0.2)', backgroundColor: 'rgba(75, 192, 192, 0.2)',
fill: true, fill: true,
tension: 0 tension: 0
}] }]
}, },
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
plugins: { plugins: {
title: { title: {
display: true, display: true,
text: 'Logs pro Tag' text: 'Logs pro Tag'
}, },
legend: { legend: {
display: true, display: true,
position: 'top' position: 'top'
},
zoom: {
pan: {
enabled: true,
mode: 'x',
}, },
zoom: { zoom: {
wheel: { pan: {
enabled: true, enabled: true,
mode: 'x',
}, },
mode: 'x', zoom: {
} wheel: {
} enabled: true,
}, },
interaction: { mode: 'x',
mode: 'index', }
intersect: false
},
scales: {
x: {
title: {
display: true,
text: 'Datum'
} }
}, },
y: { interaction: {
min: 0, mode: 'index',
max: 100, intersect: false
title: { },
display: true, scales: {
text: 'Anzahl Logs' x: {
title: {
display: true,
text: 'Datum'
}
}, },
ticks: { y: {
stepSize: 20 min: 0,
}, max: 100,
beginAtZero: true title: {
display: true,
text: 'Anzahl Logs'
},
ticks: {
stepSize: 20
},
beginAtZero: true
}
} }
} }
} });
});
</script> </script>
</body> </body>
+24 -24
View File
@@ -40,7 +40,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE DATE(FIRST_REQUEST) = CURDATE() WHERE DATE(FIRST_REQUEST) = CURDATE()
AND (WEBSITE = 'backend.blackpi.ipv64.net') AND (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql) AND CLIENT_IP NOT IN ($devips_sql)
ORDER BY FIRST_REQUEST DESC ORDER BY FIRST_REQUEST DESC
"; ";
@@ -50,7 +50,7 @@ if (!$useCustom) {
$sql = " $sql = "
SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter
FROM logs FROM logs
WHERE (WEBSITE = 'backend.blackpi.ipv64.net') WHERE (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql) AND CLIENT_IP NOT IN ($devips_sql)
GROUP BY CLIENT_IP GROUP BY CLIENT_IP
ORDER BY gesamt_counter DESC ORDER BY gesamt_counter DESC
@@ -62,7 +62,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node1' WHERE `SERVER_IP` = 'node1'
AND (WEBSITE = 'backend.blackpi.ipv64.net') AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
@@ -72,7 +72,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node2' WHERE `SERVER_IP` = 'node2'
AND (WEBSITE = 'backend.blackpi.ipv64.net') AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
@@ -82,7 +82,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node3' WHERE `SERVER_IP` = 'node3'
AND (WEBSITE = 'backend.blackpi.ipv64.net') AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
@@ -92,7 +92,7 @@ if (!$useCustom) {
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node4' WHERE `SERVER_IP` = 'node4'
AND (WEBSITE = 'backend.blackpi.ipv64.net') AND (WEBSITE = 'backend.mrhossa.de')
ORDER BY `FIRST_REQUEST` DESC ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
@@ -101,7 +101,7 @@ if (!$useCustom) {
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE (WEBSITE = 'backend.blackpi.ipv64.net') WHERE (WEBSITE = 'backend.mrhossa.de')
AND CLIENT_IP NOT IN ($devips_sql) AND CLIENT_IP NOT IN ($devips_sql)
ORDER BY FIRST_REQUEST DESC ORDER BY FIRST_REQUEST DESC
"; ";
@@ -116,7 +116,7 @@ if (!$useCustom) {
<select name="filter" onchange="this.form.submit()"> <select name="filter" onchange="this.form.submit()">
<?php <?php
$options = ['alle','today','node1','node2','node3','node4','counterperip']; $options = ['alle', 'today', 'node1', 'node2', 'node3', 'node4', 'counterperip'];
foreach ($options as $opt) { foreach ($options as $opt) {
$sel = ($filter === $opt) ? 'selected' : ''; $sel = ($filter === $opt) ? 'selected' : '';
echo "<option value='$opt' $sel>$opt</option>"; echo "<option value='$opt' $sel>$opt</option>";
@@ -150,25 +150,25 @@ if ($erg = $conn->query($sql)) {
?> ?>
<?php if (!$daten): ?> <?php if (!$daten): ?>
<b>Keine Daten gefunden</b> <b>Keine Daten gefunden</b>
<?php else: ?> <?php else: ?>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;"> <table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr> <tr>
<?php foreach ($daten[0] as $key => $_): ?> <?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th> <th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?> <?php endforeach; ?>
</tr> </tr>
<?php foreach ($daten as $row): ?> <?php foreach ($daten as $row): ?>
<tr> <tr>
<?php foreach ($row as $val): ?> <?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td> <td><?= htmlspecialchars($val ?? '') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tr> </table>
<?php endforeach; ?> </div>
</table>
</div>
<?php endif; ?> <?php endif; ?>
+212
View File
@@ -0,0 +1,212 @@
<?php
include_once(__DIR__ . '/../controller/DataController.php');
include_once(__DIR__ . '/../controller/DatabaseController.php');
$alleFaecher = DatabaseShow("Fach", "ID, FACH");
$alleRaeume = DatabaseShow("Raum", "ID, RAUM_NR");
$alleLehrer = DatabaseShow("Lehrer", "ID, NAME");
/*
1 => ["fach_id" => 1, "raum_id" => 5, "lehrer_id" => 8], // LF1
1 => ["fach_id" => 2, "raum_id" => 4, "lehrer_id" => 11], // LF2
1 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
1 => ["fach_id" => 4, "raum_id" => 1, "lehrer_id" => 5], // LF4
6 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
1 => ["fach_id" => 6, "raum_id" => 5, "lehrer_id" => 4], // Sozi
1 => ["fach_id" => 8, "raum_id" => 5, "lehrer_id" => 7], // VWL
1 => ["fach_id" => 9, "raum_id" => 5, "lehrer_id" => 3], // DE
1 => ["fach_id" => 10, "raum_id" => 5, "lehrer_id" => 3], // ENG
*/
$Stundenplan = [
"MO" => [
1 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
2 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
3 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
4 => ["fach_id" => 6, "raum_id" => 5, "lehrer_id" => 4], // Sozi
5 => ["fach_id" => 10, "raum_id" => 5, "lehrer_id" => 3], // Eng
6 => ["fach_id" => 10, "raum_id" => 5, "lehrer_id" => 3], // Eng
7 => ["fach_id" => 2, "raum_id" => 3, "lehrer_id" => 11], // LF2
8 => ["fach_id" => 2, "raum_id" => 3, "lehrer_id" => 11], // LF2
],
"DI" => [
1 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
2 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
3 => ["fach_id" => 5, "raum_id" => 1, "lehrer_id" => 5], // LF5
4 => ["fach_id" => 2, "raum_id" => 3, "lehrer_id" => 6], // LF2
5 => ["fach_id" => 2, "raum_id" => 3, "lehrer_id" => 6], // LF2
],
"MI" => [
1 => ["fach_id" => 8, "raum_id" => 5, "lehrer_id" => 7], // VWL
2 => ["fach_id" => 8, "raum_id" => 5, "lehrer_id" => 7], // VWL
3 => ["fach_id" => 9, "raum_id" => 5, "lehrer_id" => 3], // DE
4 => ["fach_id" => 9, "raum_id" => 5, "lehrer_id" => 3], // DE
5 => ["fach_id" => 2, "raum_id" => 4, "lehrer_id" => 6], // LF2
6 => ["fach_id" => 2, "raum_id" => 4, "lehrer_id" => 6], // LF2
7 => ["fach_id" => 8, "raum_id" => 5, "lehrer_id" => 7], // VWL
],
"DO" => [
1 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
2 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
3 => ["fach_id" => 3, "raum_id" => 1, "lehrer_id" => 2], // LF3
4 => ["fach_id" => 6, "raum_id" => 5, "lehrer_id" => 4], // Sozi
5 => ["fach_id" => 6, "raum_id" => 5, "lehrer_id" => 4], // Sozi
6 => ["fach_id" => 4, "raum_id" => 1, "lehrer_id" => 5], // LF4
7 => ["fach_id" => 4, "raum_id" => 1, "lehrer_id" => 5], // LF4
8 => ["fach_id" => 4, "raum_id" => 1, "lehrer_id" => 5], // LF4
],
"FR" => [
1 => ["fach_id" => 1, "raum_id" => 5, "lehrer_id" => 8], // LF1
2 => ["fach_id" => 1, "raum_id" => 5, "lehrer_id" => 8], // LF1
3 => ["fach_id" => 1, "raum_id" => 5, "lehrer_id" => 8], // LF1
4 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
5 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
6 => ["fach_id" => 5, "raum_id" => 3, "lehrer_id" => 1], // LF5
]
];
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Berufsschulbericht</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="main">
<div class="content" style="max-width: 1100px; margin: 0 auto; padding: 20px;">
<div class="form-container">
<h3 style="margin-top: 0;">Berufsschulbericht erfassen</h3>
<form method="post">
<div class="form-group" style="max-width: 220px; margin-bottom: 25px;">
<label for="datum">Datum auswählen</label>
<input type="date" name="datum" id="datum" required>
</div>
<div class="vergabe-grid"
style="font-weight: bold; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--card-border);">
<div>Stunde</div>
<div>Fach</div>
<div>Raum</div>
<div>Lehrer</div>
<div>Inhalt / Thema</div>
</div>
<?php for ($i = 1; $i <= 8; $i++): ?>
<div class="vergabe-grid" style="margin-bottom: 10px; align-items: center;">
<div>
<span class="badge"
style="display: inline-block; min-width: 90px; text-align: center; padding: 8px 12px; font-weight: bold;">Stunde
<?= $i ?></span>
</div>
<div class="form-group">
<select name="stunden[<?= $i ?>][fach_id]" data-stunde="<?= $i ?>" data-type="fach_id">
<option value="">-- Fach --</option>
<?php foreach ($alleFaecher as $row): ?>
<option value="<?= $row['ID'] ?>"><?= htmlspecialchars($row['FACH']) ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<select name="stunden[<?= $i ?>][raum_id]" data-stunde="<?= $i ?>" data-type="raum_id">
<option value="">-- Raum --</option>
<?php foreach ($alleRaeume as $row): ?>
<option value="<?= $row['ID'] ?>"><?= htmlspecialchars($row['RAUM_NR']) ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<select name="stunden[<?= $i ?>][lehrer_id]" data-stunde="<?= $i ?>" data-type="lehrer_id">
<option value="">-- Lehrer --</option>
<?php foreach ($alleLehrer as $row): ?>
<option value="<?= $row['ID'] ?>"><?= htmlspecialchars($row['NAME']) ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<input type="text" name="stunden[<?= $i ?>][inhalt_text]" placeholder="Inhalt der Stunde..."
style="margin: 0; padding: 10px;">
</div>
</div>
<?php endfor; ?>
<div style="margin-top: 25px; text-align: right;">
<button type="submit" class="btn-submit-vergabe"
style="width: 220px; display: inline-flex; font-weight: bold;">
Bericht speichern
</button>
</div>
</form>
</div>
</div>
</div>
<script>
const stundenplan = <?= json_encode($Stundenplan) ?>;
const wochentage = ["SO", "MO", "DI", "MI", "DO", "FR", "SA"];
document.getElementById('datum').addEventListener('change', function() {
const gewaehltesDatum = new Date(this.value);
if (isNaN(gewaehltesDatum)) return;
let tagKey = wochentage[gewaehltesDatum.getDay()];
if (tagKey === "SO" || tagKey === "SA") {
tagKey = "MO";
}
const tagesPlan = stundenplan[tagKey] || {};
document.querySelectorAll('.vergabe-grid select').forEach(select => {
const stunde = select.getAttribute('data-stunde');
const type = select.getAttribute('data-type');
const vordefinierteId = (tagesPlan[stunde] && tagesPlan[stunde][type]) ? tagesPlan[stunde][
type
] : "";
select.value = vordefinierteId;
});
});
</script>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$datum = $_POST['datum'] ?? null;
$werte = [$datum];
for ($i = 1; $i <= 8; $i++) {
$stunde = $_POST['stunden'][$i] ?? [];
$werte[] = !empty($stunde['fach_id']) ? $stunde['fach_id'] : null;
$werte[] = !empty($stunde['lehrer_id']) ? $stunde['lehrer_id'] : null;
$werte[] = !empty($stunde['raum_id']) ? $stunde['raum_id'] : null;
$werte[] = !empty($stunde['inhalt_text']) ? $stunde['inhalt_text'] : null;
}
DatabaseInsert(
"Berufsschulberichte",
"DATUM, FACH_S1, LEHRER_S1, RAUM_S1, INHALT_S1, FACH_S2, LEHRER_S2, RAUM_S2, INHALT_S2, FACH_S3, LEHRER_S3, RAUM_S3, INHALT_S3, FACH_S4, LEHRER_S4, RAUM_S4, INHALT_S4, FACH_S5, LEHRER_S5, RAUM_S5, INHALT_S5, FACH_S6, LEHRER_S6, RAUM_S6, INHALT_S6, FACH_S7, LEHRER_S7, RAUM_S7, INHALT_S7, FACH_S8, LEHRER_S8, RAUM_S8, INHALT_S8",
...$werte
);
echo "<div class='status-msg' style='position: fixed; bottom: 20px; right: 20px; z-index: 10000;'>Bericht gespeichert!</div>";
}
?>
</body>
</html>
+17 -17
View File
@@ -57,9 +57,9 @@ $domains = DatabaseShow("Domains", "*");
</h2> </h2>
<?php if ($statusMsg): ?> <?php if ($statusMsg): ?>
<div class="status-msg"> <div class="status-msg">
<?= htmlspecialchars($statusMsg) ?> <?= htmlspecialchars($statusMsg) ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@@ -67,27 +67,27 @@ $domains = DatabaseShow("Domains", "*");
<?php foreach ($domains as $domain): ?> <?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"> <button type="submit" name="save_domain" class="btn-save">
Speichern Speichern
</button> </button>
<button type="submit" name="delete_domain" class="btn-delete"> <button type="submit" name="delete_domain" class="btn-delete">
Löschen Löschen
</button> </button>
</div> </div>
</form> </form>
<?php endforeach; ?> <?php endforeach; ?>
@@ -100,7 +100,7 @@ $domains = DatabaseShow("Domains", "*");
<label>Subdomain</label> <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"> <button type="submit" name="add_domain" class="btn-add">
Domain hinzufügen Domain hinzufügen
+97
View File
@@ -0,0 +1,97 @@
<?php
include_once(__DIR__ . '/../controller/DataController.php');
include_once(__DIR__ . '/../controller/DatabaseController.php');
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_bericht'])) {
$prozess1 = $_POST['prozess1'];
$prozess2 = $_POST['prozess2'];
$prozess3 = $_POST['prozess3'];
$prozess4 = $_POST['prozess4'];
$startzeit = $_POST['startzeit'];
$endzeit = $_POST['endzeit'];
$datum = $_POST['datum'];
// IHK konforme zeiten berechnen und Überstunden berechnen
$soll = new DateTime($startzeit);
$soll->modify("+8 hours 30 minutes");
$randomMin = rand(1, 15);
$endePublicDt = clone $soll;
$endePublicDt->modify("+{$randomMin} minutes");
$endePublic = $endePublicDt->format("H:i");
$real = DateTime::createFromFormat("H:i", $endzeit);
$beginnDt = new DateTime($startzeit);
$arbeitsDiff = $beginnDt->diff($real);
$arbeitsMinuten = ($arbeitsDiff->h * 60) + $arbeitsDiff->i;
$sollMinuten = 8 * 60 + 30;
if ($arbeitsMinuten <= $sollMinuten) {
$overtime = 0;
} else {
$diff = $soll->diff($real);
$overtime = ($diff->h * 60) + $diff->i;
}
DatabaseInsert(
"Firmenberichte",
"DATUM, PROZESS_1, PROZESS_2, PROZESS_3, PROZESS_4, BEGINN, ENDE_REAL, ENDE_PUBLIC, OVERTIME",
$datum,
$prozess1,
$prozess2,
$prozess3,
$prozess4,
$startzeit,
$endzeit,
$endePublic,
$overtime
);
redirectToWebsite((new getSpecificData())->getReferer());
exit;
}
?>
<div>
<div class="berichte-container">
<form method="POST" class="berichte-form">
<div class="form-group">
<label>Prozess 1</label>
<input type="text" name="prozess1" required>
</div>
<div class="form-group">
<label>Prozess 2</label>
<input type="text" name="prozess2" required>
</div>
<div class="form-group">
<label>Prozess 3</label>
<input type="text" name="prozess3" required>
</div>
<div class="form-group">
<label>Prozess 4</label>
<input type="text" name="prozess4" required>
</div>
<div class="form-group">
<label>Startzeit</label>
<input type="time" name="startzeit" required>
</div>
<div class="form-group">
<label>Endzeit</label>
<input type="time" name="endzeit" required>
</div>
<div class="form-group">
<label>Datum</label>
<input type="date" name="datum" required>
</div>
<button type="submit" name="add_bericht" class="btn-submit-bericht">
Bericht Speichern
</button>
</form>
</div>
</div>
+45 -45
View File
@@ -35,77 +35,77 @@ if ($customQuery) {
// Standard Queries // Standard Queries
if (!$useCustom) { if (!$useCustom) {
switch ($filter) { switch ($filter) {
case 'today': case 'today':
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql) 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() AND DATE(FIRST_REQUEST) = CURDATE()
ORDER BY FIRST_REQUEST DESC ORDER BY FIRST_REQUEST DESC
"; ";
break; break;
case 'counterperip': case 'counterperip':
$sql = " $sql = "
SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter SELECT CLIENT_IP, LAND, USER_AGENT, SUM(counter) AS gesamt_counter
FROM logs FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql) 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 GROUP BY CLIENT_IP
ORDER BY gesamt_counter DESC ORDER BY gesamt_counter DESC
"; ";
break; break;
case 'node1': case 'node1':
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node1' 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 ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
case 'node2': case 'node2':
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node2' 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 ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
case 'node3': case 'node3':
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node3' 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 ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
case 'node4': case 'node4':
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE `SERVER_IP` = 'node4' 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 ORDER BY `FIRST_REQUEST` DESC
"; ";
break; break;
default: default:
$sql = " $sql = "
SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE` SELECT `CLIENT_IP`, `LAND`, `REQUEST_URL`, `COUNTER`, `FIRST_REQUEST`, `WEBSITE`
FROM logs FROM logs
WHERE CLIENT_IP NOT IN ($devips_sql) 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 ORDER BY FIRST_REQUEST DESC
"; ";
} }
} }
?> ?>
@@ -116,7 +116,7 @@ if (!$useCustom) {
<select name="filter" onchange="this.form.submit()"> <select name="filter" onchange="this.form.submit()">
<?php <?php
$options = ['alle','today','node1','node2','node3','node4','counterperip']; $options = ['alle', 'today', 'node1', 'node2', 'node3', 'node4', 'counterperip'];
foreach ($options as $opt) { foreach ($options as $opt) {
$sel = ($filter === $opt) ? 'selected' : ''; $sel = ($filter === $opt) ? 'selected' : '';
echo "<option value='$opt' $sel>$opt</option>"; echo "<option value='$opt' $sel>$opt</option>";
@@ -150,25 +150,25 @@ if ($erg = $conn->query($sql)) {
?> ?>
<?php if (!$daten): ?> <?php if (!$daten): ?>
<b>Keine Daten gefunden</b> <b>Keine Daten gefunden</b>
<?php else: ?> <?php else: ?>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;"> <table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse;width:100%;">
<tr> <tr>
<?php foreach ($daten[0] as $key => $_): ?> <?php foreach ($daten[0] as $key => $_): ?>
<th><?= htmlspecialchars($key) ?></th> <th><?= htmlspecialchars($key) ?></th>
<?php endforeach; ?> <?php endforeach; ?>
</tr> </tr>
<?php foreach ($daten as $row): ?> <?php foreach ($daten as $row): ?>
<tr> <tr>
<?php foreach ($row as $val): ?> <?php foreach ($row as $val): ?>
<td><?= htmlspecialchars($val ?? '') ?></td> <td><?= htmlspecialchars($val ?? '') ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</tr> </table>
<?php endforeach; ?> </div>
</table>
</div>
<?php endif; ?> <?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>
+205 -17
View File
@@ -1,10 +1,15 @@
<?php <?php
include_once __DIR__ . '/../controller/DatabaseController.php'; include_once __DIR__ . '/../controller/DatabaseController.php';
include_once __DIR__ . '/../controller/RoutesController.php'; include_once __DIR__ . '/../controller/RoutesController.php';
include_once __DIR__ . '/../modules/ConsoleLog.php';
$conn = db_connect(); $conn = db_connect();
$view = $_GET['view'] ?? 'show'; $view = $_GET['view'] ?? 'show';
$selectedService = $_GET['service'] ?? null; $selectedService = $_GET['service'] ?? null;
// --- Suchfilter auslesen ---
$searchWer = $_GET['search_wer'] ?? '';
$searchWas = $_GET['search_was'] ?? '';
// --- LOGIK: Überstunden-Eintrag (Abbau) speichern --- // --- LOGIK: Überstunden-Eintrag (Abbau) speichern ---
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) { if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) {
@@ -14,10 +19,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) {
$rueckgabe = $_POST['rueckgabe']; $rueckgabe = $_POST['rueckgabe'];
DatabaseInsert( DatabaseInsert(
"Vergabe", "Vergabe",
"WAS, WER, WANN, RUECKGABE", "WAS, WER, WANN, RUECKGABE",
$was, $was,
$wer, $wer,
$wann, $wann,
$rueckgabe $rueckgabe
); );
@@ -29,16 +34,47 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) {
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_entry'])) { if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_entry'])) {
$id = $_POST['id']; $id = $_POST['id'];
DatabaseDelete("Vergabe", "ID = ?", $id); ConsoleLog("$id");
DatabaseUpdate(
"Vergabe",
"STATUS = ?",
"ID = ?",
1,
$id
);
redirectToWebsite((new getSpecificData())->getReferer()); redirectToWebsite((new getSpecificData())->getReferer());
exit; exit;
} }
// --- Dynamic Query mit kombiniertem Suchfilter ---
$whereClause = "STATUS IS NULL";
if (!empty($searchWer)) {
$whereClause .= " AND WER LIKE '%" . $conn->real_escape_string($searchWer) . "%'";
}
if (!empty($searchWas)) {
$whereClause .= " AND WAS LIKE '%" . $conn->real_escape_string($searchWas) . "%'";
}
$entries = DatabaseShow( $entries = DatabaseShow(
"Vergabe" "Vergabe",
"ID, WAS, WER, WANN, RUECKGABE",
$whereClause
); );
$searchEntries = DatabaseShow(
"Vergabe",
);
$existingWas = [];
$existingWer = [];
foreach ($searchEntries as $entry) {
if (!empty($entry['WAS'])) $existingWas[$entry['WAS']] = true;
if (!empty($entry['WER'])) $existingWer[$entry['WER']] = true;
}
$existingWas = array_keys($existingWas);
$existingWer = array_keys($existingWer);
?> ?>
<div class="arbeitsberichte-wrapper"> <div class="arbeitsberichte-wrapper">
@@ -55,25 +91,73 @@ $entries = DatabaseShow(
<input type="date" name="rueckgabe" value="<?= date('Y-m-d') ?>" required> <input type="date" name="rueckgabe" value="<?= date('Y-m-d') ?>" required>
</div> </div>
<div class="form-group"> <div class="form-group autocomplete-wrapper">
<label>An wen</label> <label>An wen</label>
<input type="text" name="wer" placeholder="Name eingeben" required> <input type="text" name="wer" id="wer-input" placeholder="Name eingeben" required autocomplete="off">
<div class="autocomplete-suggestions" id="wer-suggestions"></div>
</div> </div>
<div class="form-group"> <div class="form-group autocomplete-wrapper">
<label>Was</label> <label>Was</label>
<input type="text" name="was" placeholder="Gegenstand eingeben" required> <input type="text" name="was" id="was-input" placeholder="Gegenstand eingeben" required autocomplete="off">
<div class="autocomplete-suggestions" id="was-suggestions"></div>
</div> </div>
<button type="submit" name="add_entry" class="btn-submit-vergabe"> <button type="submit" name="add_entry" class="btn-submit-vergabe">
💾 Speichern Speichern
</button> </button>
</form> </form>
</div> </div>
<div class="vergabe-form" style="margin-top: 30px;">
<form method="GET" action="" class="vergabe-grid" id="search-form">
<input type="hidden" name="view" value="<?= htmlspecialchars($view) ?>">
<?php if ($selectedService): ?>
<input type="hidden" name="service" value="<?= htmlspecialchars($selectedService) ?>">
<?php endif; ?>
<div class="form-group autocomplete-wrapper">
<label for="search-wer-input">Nach Person filtern</label>
<input type="text" name="search_wer" id="search-wer-input" value="<?= htmlspecialchars($searchWer) ?>" placeholder="Name eingeben..." autocomplete="off">
<div class="autocomplete-suggestions" id="search-wer-suggestions"></div>
</div>
<div class="form-group autocomplete-wrapper">
<label for="search-was-input">Nach Gegenstand filtern</label>
<input type="text" name="search_was" id="search-was-input" value="<?= htmlspecialchars($searchWas) ?>" placeholder="Gegenstand eingeben..." autocomplete="off">
<div class="autocomplete-suggestions" id="search-was-suggestions"></div>
</div>
<div style="display: flex; gap: 10px; align-items: flex-end;">
<button type="submit" class="btn-submit-vergabe" style="margin: 0; flex-grow: 1;">
Suchen
</button>
<?php if (!empty($searchWer) || !empty($searchWas)): ?>
<a href="?view=<?= urlencode($view) ?><?= $selectedService ? '&service=' . urlencode($selectedService) : '' ?>" class="btn-delete" style="text-decoration: none; padding: 10px; display: inline-block; text-align: center; white-space: nowrap; margin: 0;">
Zurücksetzen
</a>
<?php endif; ?>
</div>
</form>
</div>
<div class="table-container" style="margin-top: 30px;"> <div class="table-container" style="margin-top: 30px;">
<h3>Aktuelle Vergaben</h3> <h3>
<?php
if (!empty($searchWer) && !empty($searchWas)) {
echo "Gefiltert nach: " . htmlspecialchars($searchWer) . " ➔ " . htmlspecialchars($searchWas);
} elseif (!empty($searchWer)) {
echo "Vergaben für: " . htmlspecialchars($searchWer);
} elseif (!empty($searchWas)) {
echo "Ausgeliehene Gegenstände: " . htmlspecialchars($searchWas);
} else {
echo "Aktuelle Vergaben";
}
?>
</h3>
<?php if (!empty($entries)): ?> <?php if (!empty($entries)): ?>
<table class="db-table mobile-responsive-table"> <table class="db-table mobile-responsive-table">
<thead> <thead>
@@ -96,7 +180,7 @@ $entries = DatabaseShow(
<form method="POST" onsubmit="return confirm('Möchtest du diesen Eintrag wirklich löschen?');" style="margin: 0;"> <form method="POST" onsubmit="return confirm('Möchtest du diesen Eintrag wirklich löschen?');" style="margin: 0;">
<input type="hidden" name="id" value="<?= $entry['ID'] ?? '' ?>"> <input type="hidden" name="id" value="<?= $entry['ID'] ?? '' ?>">
<button type="submit" name="delete_entry" class="btn-delete"> <button type="submit" name="delete_entry" class="btn-delete">
🗑️ Löschen Löschen
</button> </button>
</form> </form>
</td> </td>
@@ -108,4 +192,108 @@ $entries = DatabaseShow(
<p>Keine Einträge vorhanden.</p> <p>Keine Einträge vorhanden.</p>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<script>
// Parameter `submitOnSelect` hinzugefügt (Standard: false)
function setupAutocomplete(inputId, suggestionsId, data, submitOnSelect = false) {
const input = document.getElementById(inputId);
const box = document.getElementById(suggestionsId);
if (!input || !box) return;
let items = [];
let activeIndex = -1;
function render(list) {
box.innerHTML = '';
items = list;
activeIndex = -1;
if (list.length === 0) {
box.style.display = 'none';
return;
}
list.forEach((val, i) => {
const div = document.createElement('div');
div.textContent = val;
div.addEventListener('mousedown', (e) => {
e.preventDefault();
selectItem(i);
});
box.appendChild(div);
});
box.style.display = 'block';
}
function updateActive() {
[...box.children].forEach((el, i) => {
el.classList.toggle('active', i === activeIndex);
});
if (activeIndex >= 0) {
box.children[activeIndex].scrollIntoView({
block: 'nearest'
});
}
}
function selectItem(i) {
if (items[i] !== undefined) {
input.value = items[i];
}
box.style.display = 'none';
activeIndex = -1;
// NEU: Wenn gewünscht, schicke das übergeordnete Formular sofort ab
if (submitOnSelect) {
const form = input.closest('form');
if (form) form.submit();
}
}
input.addEventListener('input', () => {
const val = input.value.toLowerCase();
if (val.length === 0) {
box.style.display = 'none';
return;
}
const filtered = data.filter(d => d.toLowerCase().includes(val));
render(filtered);
});
input.addEventListener('keydown', (e) => {
if (box.style.display !== 'block') return;
if (e.key === 'ArrowDown') {
e.preventDefault();
activeIndex = Math.min(activeIndex + 1, items.length - 1);
updateActive();
} else if (e.key === 'ArrowUp') {
e.preventDefault();
activeIndex = Math.max(activeIndex - 1, 0);
updateActive();
} else if (e.key === 'Tab' || e.key === 'Enter') {
if (activeIndex >= 0) {
e.preventDefault();
selectItem(activeIndex);
} else {
box.style.display = 'none';
}
} else if (e.key === 'Escape') {
box.style.display = 'none';
}
});
document.addEventListener('click', (e) => {
if (e.target !== input) {
box.style.display = 'none';
}
});
}
// 1. Normales Autocomplete für das Eintragungs-Formular (schickt nicht automatisch ab)
setupAutocomplete('was-input', 'was-suggestions', <?= json_encode($existingWas) ?>);
setupAutocomplete('wer-input', 'wer-suggestions', <?= json_encode($existingWer) ?>);
// 2. Such-Autocomplete: Hier wird als 4. Parameter `true` übergeben, damit sofort abgesendet wird!
setupAutocomplete('search-wer-input', 'search-wer-suggestions', <?= json_encode($existingWer) ?>, true);
setupAutocomplete('search-was-input', 'search-was-suggestions', <?= json_encode($existingWas) ?>, true);
</script>
+175 -6
View File
@@ -880,6 +880,17 @@ body.dark-mode .user-table .btn-primary:hover {
font-size: 0.8rem; 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 Switch ===== */
.toggle-card { .toggle-card {
@@ -981,8 +992,7 @@ body.dark-mode .info-value {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
margin-top: 20px; margin-top: 20px;
/* table-layout: fixed; */ table-layout: fixed;
/* sorgt für feste Spaltenbreite */
} }
.db-table thead { .db-table thead {
@@ -996,10 +1006,13 @@ body.dark-mode .info-value {
text-align: left; text-align: left;
border-bottom: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border);
/* Wichtig für gleiche Größe */ word-wrap: break-word;
/* overflow: hidden; overflow-wrap: break-word;
text-overflow: ellipsis; white-space: normal;
white-space: nowrap; */ }
.db-table td:nth-child(2) {
max-width: 300px;
} }
.db-table tr:hover { .db-table tr:hover {
@@ -1280,4 +1293,160 @@ body.dark-mode input[type="date"] {
padding: 10px; padding: 10px;
font-size: 1rem; font-size: 1rem;
} }
}
/* ===== Optimiertes Firmenberichte Erfassungsformular ===== */
.berichte-container {
background: var(--card-bg);
border: 1px solid var(--card-border);
border-top: 4px solid #007bff;
/* Eleganter blauer Akzentstreifen oben statt links */
border-radius: 12px;
padding: 30px;
max-width: 500px;
/* Kompakt und perfekt lesbar auf Monitoren */
margin: 40px auto;
/* Schön zentriert mit Luft nach oben/unten */
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
}
/* Tiefenwirkung für den Dark Mode */
body.dark-mode .berichte-container {
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
background: #161616;
/* Passt sich perfekt deiner CSS-Variable an */
}
.berichte-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.berichte-form .form-group {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
.berichte-form .form-group label {
font-size: 0.85rem;
font-weight: 700;
color: var(--text);
text-transform: uppercase;
letter-spacing: 0.8px;
opacity: 0.85;
}
/* Einheitlicher, moderner Look für ALLE Input-Typen */
.berichte-form input[type="text"],
.berichte-form input[type="time"],
.berichte-form input[type="date"] {
width: 100%;
padding: 12px 16px;
background: var(--input-bg);
border: 1px solid var(--input-border);
color: var(--input-text);
border-radius: 8px;
font-size: 0.95rem;
box-sizing: border-box;
transition: border-color 0.2s, box-shadow 0.2s;
}
/* Behebt das Problem mit den grellweißen Zeit/Datumsfeldern im Dark Mode */
body.dark-mode .berichte-form input[type="time"],
body.dark-mode .berichte-form input[type="date"] {
color-scheme: dark;
/* Zwingt den Browser, das native Dropdown dunkel zu machen */
background: #222;
border-color: #444;
color: #fff;
}
/* Fokus-Effekt (weicher blauer Schein) */
.berichte-form input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}
body.dark-mode .berichte-form input:focus {
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
}
/* Vollbreiter, moderner Absende-Button */
.btn-submit-bericht {
width: 100%;
background: #28a745;
/* Kräftiges Success-Grün */
color: white;
border: none;
padding: 14px;
font-size: 1rem;
font-weight: 600;
border-radius: 8px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin-top: 10px;
box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
transition: all 0.2s ease;
}
.btn-submit-bericht:hover {
background: #218838;
transform: translateY(-1px);
box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}
.btn-submit-bericht:active {
transform: scale(0.98);
}
/* Kleine Bildschirme (Smartphones) */
@media (max-width: 600px) {
.berichte-container {
margin: 15px;
padding: 20px;
}
}
.autocomplete-wrapper {
position: relative;
}
.autocomplete-suggestions {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
background: var(--card-bg);
color: var(--text);
border: 1px solid var(--input-border);
border-top: none;
max-height: 180px;
overflow-y: auto;
z-index: 1000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.autocomplete-suggestions div {
padding: 8px 10px;
cursor: pointer;
}
.autocomplete-suggestions div:hover,
.autocomplete-suggestions div.active {
background: rgba(0, 123, 255, 0.15);
}
body.dark-mode .autocomplete-suggestions div:hover,
body.dark-mode .autocomplete-suggestions div.active {
background: rgba(0, 123, 255, 0.25);
} }
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
set -e
echo "Starte automatischen Merge- und Tag-Prozess..."
git config core.filemode false
echo "Aktualisiere lokale Branches vom Remote..."
git fetch --all --quiet
echo "Wechsle zu main..."
git checkout main --quiet
git pull origin main --quiet
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
TAG_NAME="v$(date +'%Y.%m.%d-%H%M')"
echo " Erstelle Tag: $TAG_NAME..."
git tag -a "$TAG_NAME" -m "Automated release tag $TAG_NAME"
git push origin "$TAG_NAME" --quiet
git checkout main --quiet
echo ""
echo "========================================================"
echo "✅ FERTIG! Alles sauber durchgelaufen."
echo "📦 Neuer Release-Tag gepusht: $TAG_NAME"
echo "========================================================"