Semi-stable version with old variable names
@@ -3,13 +3,23 @@ config/.env.db-tables
|
||||
config/.env.db-guest
|
||||
config/.env.redis
|
||||
config/.env.pw-encryption-key
|
||||
config/.env.wk-id
|
||||
config/.env.mail
|
||||
websocket/node_modules
|
||||
websocket/package-lock.json
|
||||
websocket/package.json
|
||||
composer
|
||||
private-files/rechnungen/*
|
||||
private-files/config-uploads/*
|
||||
.php-ini
|
||||
.php-version
|
||||
www/displays/json/*
|
||||
www/intern/scripts/kampfrichter/ajax/neu.php
|
||||
www/intern/scripts/kampfrichter/ajax/neu_copy.php
|
||||
www/externe-geraete/json/*
|
||||
www/files/ranglisten/*
|
||||
www/sponsoren.php
|
||||
www/css/sponsoren.css
|
||||
www/scripts
|
||||
www/files/music/*
|
||||
!www/files/music/piep.mp3
|
||||
www/.well-known
|
||||
www/intern/kampfrichter/ajax/ajax-neu_dynamic-rangliste.php
|
||||
setup/database/*
|
||||
@@ -0,0 +1,310 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ==========================================
|
||||
# WKVS Full Stack Installation Script
|
||||
# Autor: Euria
|
||||
# Datum: 2026-04-20
|
||||
# ==========================================
|
||||
|
||||
set -e # Stoppt das Skript bei jedem Fehler
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo " WKVS Full Stack Installation"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo ""
|
||||
read -p "Dieses Skript funktioniert nur auf einer leeren Linux Instalation. Fohrtfahren? [y/n/c]: " choiceInstall
|
||||
|
||||
case $choiceInstall in
|
||||
[yY]*) ;;
|
||||
[nN]*)
|
||||
echo "Installation abgebrochen."
|
||||
exit 0
|
||||
;;
|
||||
[cC]*)
|
||||
echo "Installation abgebrochen."
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Ungültige Eingabe."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# --- 1. System Update & Basisinstallation ---
|
||||
echo "Schritt 1: System aktualisieren und Basis-Pakete installieren..."
|
||||
sudo apt update
|
||||
sudo apt install -y mariadb-server apache2 nginx curl dig certbot python3-certbot-nginx
|
||||
|
||||
# --- 2. MariaDB Installation & Konfiguration ---
|
||||
echo "Schritt 2: MariaDB Konfiguration..."
|
||||
|
||||
read -p "Willst du die Installation komplett automatisch abschließen? [y/n/c]: " choice
|
||||
|
||||
case $choice in
|
||||
[yY]*)
|
||||
PREFIX=$(openssl rand -hex 3)
|
||||
DB_NAME="${PREFIX}_wkvs_db"
|
||||
DB_USER_NORMAL="${PREFIX}_wkvs_user"
|
||||
DB_USER_GUEST="${PREFIX}_wkvs_guest"
|
||||
DB_PASS_NORMAL=$(openssl rand -base64 24)
|
||||
DB_PASS_GUEST=$(openssl rand -base64 24)
|
||||
DB_PORT="3306"
|
||||
AUTO_INSTALL="true"
|
||||
;;
|
||||
[nN]*)
|
||||
read -p "Name der Datenbank: " DB_NAME
|
||||
read -sp "Passwort für $DB_USER_NORMAL: " DB_PASS_NORMAL
|
||||
echo ""
|
||||
read -p "Name des Gastbenutzers: " DB_USER_GUEST
|
||||
read -sp "Passwort für $DB_USER_GUEST: " DB_PASS_GUEST
|
||||
echo ""
|
||||
read -p "Custom Port (Standard 3306): " DB_PORT
|
||||
DB_PORT=${DB_PORT:-3306}
|
||||
AUTO_INSTALL="false"
|
||||
;;
|
||||
[cC]*)
|
||||
echo "Installation abgebrochen."
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Ungültige Eingabe."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# MariaDB Port umstellen (falls Custom)
|
||||
if [ "$DB_PORT" != "3306" ]; then
|
||||
echo " Stelle MariaDB auf Port $DB_PORT um..."
|
||||
if [ -f /etc/mysql/mariadb.conf.d/50-server.cnf ]; then
|
||||
sudo sed -i "s/.*port\s*=\s*3306/port = $DB_PORT/" /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
sudo systemctl restart mariadb
|
||||
else
|
||||
echo " Fehler: Konfigurationsdatei nicht gefunden."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
sudo systemctl restart mariadb
|
||||
fi
|
||||
|
||||
# --- 3. Datenbank Setup ---
|
||||
echo "Schritt 3: Datenbank und Benutzer erstellen..."
|
||||
sudo mysql -P "$DB_PORT" <<EOF
|
||||
CREATE DATABASE IF NOT EXISTS \`${DB_NAME}\`;
|
||||
|
||||
-- Normaler User
|
||||
CREATE USER IF NOT EXISTS \`$DB_USER_NORMAL\`@'127.0.0.1' IDENTIFIED BY '$DB_PASS_NORMAL';
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON \`${DB_NAME}\`.* TO \`${DB_USER_NORMAL}\`@'127.0.0.1';
|
||||
|
||||
-- Gast User (Nur SELECT)
|
||||
CREATE USER IF NOT EXISTS \`$DB_USER_GUEST\`@'127.0.0.1' IDENTIFIED BY '$DB_PASS_GUEST';
|
||||
GRANT SELECT ON \`${DB_NAME}\`.* TO \`${DB_USER_GUEST}\`@'127.0.0.1';
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
|
||||
# --- 4. Environment Files & SQL Import ---
|
||||
mkdir -p config
|
||||
|
||||
cat <<EOT > config/.env.db
|
||||
DB_USER=$DB_USER_NORMAL
|
||||
DB_PASSWORD=$DB_PASS_NORMAL
|
||||
DB_NAME=$DB_NAME
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=$DB_PORT
|
||||
EOT
|
||||
|
||||
cat <<EOT > config/.env.db-guest
|
||||
DB_GUEST_USER=$DB_USER_GUEST
|
||||
DB_GUEST_PASSWORD=$DB_PASS_GUEST
|
||||
DB_NAME=$DB_NAME
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=$DB_PORT
|
||||
EOT
|
||||
|
||||
# SQL Import (falls vorhanden)
|
||||
if [ -f "setup/database/generate-sql.php" ]; then
|
||||
echo " Generiere SQL-Struktur..."
|
||||
php setup/database/generate-sql.php
|
||||
fi
|
||||
|
||||
if [ -f "setup/database/sql-database.sql" ]; then
|
||||
echo " Importiere Datenbank-Struktur..."
|
||||
sudo mysql -P "$DB_PORT" "$DB_NAME" < setup/database/sql-database.sql
|
||||
echo " Datenbank-Schema erfolgreich importiert."
|
||||
else
|
||||
echo " Warnung: SQL-Datei nicht gefunden. Import übersprungen."
|
||||
fi
|
||||
|
||||
# --- 5. Verschlüsselungsschlüssel ---
|
||||
if [ "$AUTO_INSTALL" = "true" ]; then
|
||||
ENCRYPTION_KEY=$(openssl rand -base64 32)
|
||||
echo " Automatischer Modus: Verschlüsselungsschlüssel generiert."
|
||||
else
|
||||
read -sp "Schlüssel zur symmetrischen Verschlüsselung (durch WK-Leitung): " ENCRYPTION_KEY
|
||||
echo ""
|
||||
fi
|
||||
|
||||
cat <<EOT > config/.env.pw-encryption-key
|
||||
PW_ENCRYPTION_KEY=$ENCRYPTION_KEY
|
||||
EOT
|
||||
|
||||
# --- 6. Composer & PHP Dependencies ---
|
||||
if ! command -v composer &> /dev/null; then
|
||||
echo " Composer wird installiert..."
|
||||
sudo apt install -y composer
|
||||
fi
|
||||
|
||||
echo " Installiere Composer Pakete..."
|
||||
composer require vlucas/phpdotenv
|
||||
composer require phpmailer/phpmailer
|
||||
composer require shuchkin/simplexlsx
|
||||
composer require sprain/swiss-qr-bill
|
||||
composer require james-heinrich/getid3
|
||||
composer require chriskonnertz/string-calc
|
||||
composer require tecnickcom/tcpdf
|
||||
|
||||
# --- 7. Node.js WebSocket ---
|
||||
cd websocket || { echo "Fehler: websocket Ordner nicht gefunden!"; exit 1; }
|
||||
|
||||
npm init -y
|
||||
npm install redis ws dotenv
|
||||
npm install -g pm2
|
||||
cd ..
|
||||
|
||||
echo " WebSocket (Node.js) Installation abgeschlossen."
|
||||
|
||||
# --- 8. Apache & Nginx Konfiguration ---
|
||||
echo "Schritt 8: Webserver konfigurieren..."
|
||||
|
||||
# Apache auf internen Port umstellen
|
||||
APACHE_INTERNAL_PORT=8080
|
||||
if grep -q "Listen 80" /etc/apache2/ports.conf 2>/dev/null; then
|
||||
sudo sed -i "s/^Listen 80$/Listen $APACHE_INTERNAL_PORT/" /etc/apache2/ports.conf
|
||||
# Falls Default VHost auch 80 hat
|
||||
if [ -f /etc/apache2/sites-enabled/000-default.conf ]; then
|
||||
sudo sed -i "s/Listen 80/Listen $APACHE_INTERNAL_PORT/" /etc/apache2/sites-enabled/000-default.conf 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
sudo systemctl restart apache2
|
||||
echo " Apache auf internen Port $APACHE_INTERNAL_PORT umgestellt."
|
||||
|
||||
# --- 9. Nginx Reverse Proxy & SSL ---
|
||||
echo "Schritt 9: Nginx Reverse Proxy & HTTPS einrichten..."
|
||||
|
||||
read -p "Domain der Webseite: (Beispiel: wk.wkvs.ch) " DOMAIN
|
||||
|
||||
if [ -z "$DOMAIN" ]; then
|
||||
echo "❌ FEHLER: Die Domain darf nicht leer sein!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOMAIN=$(echo "$DOMAIN" | xargs)
|
||||
|
||||
# DNS Prüfung
|
||||
echo " DNS-Prüfung für $DOMAIN..."
|
||||
RESOLVED_IP=$(dig +short $DOMAIN 2>/dev/null | head -n1)
|
||||
SERVER_IP=$(curl -s https://api.ipify.org 2>/dev/null)
|
||||
|
||||
if [ -z "$RESOLVED_IP" ]; then
|
||||
echo "❌ FEHLER: Domain '$DOMAIN' kann nicht aufgelöst werden."
|
||||
echo " Bitte warten Sie, bis die DNS-Einträge aktiv sind."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$SERVER_IP" ] && [ "$RESOLVED_IP" != "$SERVER_IP" ]; then
|
||||
echo "⚠️ WARNUNG: Domain zeigt auf $RESOLVED_IP, Server ist $SERVER_IP."
|
||||
echo " Bitte prüfen Sie Ihre DNS-Einträge."
|
||||
read -p "Möchten Sie trotzdem fortfahren? [y/n]: " confirm
|
||||
if [ "$confirm" != "y" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Nginx Konfiguration erstellen
|
||||
NGINX_CONF="/etc/nginx/sites-available/$DOMAIN"
|
||||
NGINX_LINK="/etc/nginx/sites-enabled/$DOMAIN"
|
||||
|
||||
rm -f /etc/nginx/sites-enabled/default 2>/dev/null || true
|
||||
rm -f "$NGINX_CONF" 2>/dev/null || true
|
||||
|
||||
cat > "$NGINX_CONF" <<EOF
|
||||
# HTTP -> HTTPS Weiterleitung
|
||||
server {
|
||||
listen 80;
|
||||
server_name $DOMAIN;
|
||||
return 301 https://\$host\$request_uri;
|
||||
}
|
||||
|
||||
# HTTPS Server
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name $DOMAIN;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# WebSocket Route
|
||||
location /ws/ {
|
||||
proxy_pass http://127.0.0.1:8082;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
proxy_connect_timeout 75s;
|
||||
}
|
||||
|
||||
# Versteckte Dateien
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
}
|
||||
|
||||
# Apache Proxy
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:$APACHE_INTERNAL_PORT;
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
sudo ln -sf "$NGINX_CONF" "$NGINX_LINK"
|
||||
|
||||
# Let's Encrypt Zertifikat
|
||||
echo " Starte Let's Encrypt Zertifikatsanfrage..."
|
||||
read -p "E-Mail für Let's Encrypt: " EMAIL
|
||||
|
||||
sudo certbot --nginx -d $DOMAIN --agree-tos --no-eff-email --redirect --email "$EMAIL" --non-interactive
|
||||
|
||||
# Dienste neu starten
|
||||
sudo systemctl reload nginx
|
||||
sudo systemctl restart apache2
|
||||
|
||||
echo "=========================================="
|
||||
echo "✅ Installation erfolgreich abgeschlossen!"
|
||||
echo "=========================================="
|
||||
echo "Zusammenfassung:"
|
||||
echo "- Datenbank: $DB_NAME (Port: $DB_PORT)"
|
||||
echo "- Apache intern: Port $APACHE_INTERNAL_PORT"
|
||||
echo "- Node.js WS: Port 8082 (unter /ws/)"
|
||||
echo "- HTTPS: https://$DOMAIN/intern/wk-leitung/logindata"
|
||||
echo ""
|
||||
echo "Nächste Schritte:"
|
||||
echo "1. Starten Sie den WebSocket Server: cd websocket && pm2 start app.js"
|
||||
echo "2. Testen Sie die Seite: https://$DOMAIN/intern/wk-leitung/logindata"
|
||||
@@ -3,4 +3,5 @@
|
||||
DB_USER=DB_GUESTUSER_USERNAME
|
||||
DB_PASSWORD=DB_GUESTUSER_PASSWORD
|
||||
DB_NAME=DATABASE_NAME # Same as .env.db
|
||||
DB_HOST=DB_HOST # Same as .env.db, An IP with Port, often 127.0.0.1:3306 or localhost:3306
|
||||
DB_HOST=DB_HOST # Same as .env.db, An IP without Port, often 127.0.0.1 or localhost
|
||||
DB_PORT=3306 # default Port is 3306
|
||||
@@ -1,7 +1,7 @@
|
||||
DB_PREFIX=qxQtE_
|
||||
DB_PREFIX=PREFIX
|
||||
|
||||
# Tabellennamen
|
||||
DB_TABLE_TURNERINNEN=turnerinnen
|
||||
DB_TABLE_TEILNEHMENDE=teilnehmende
|
||||
DB_TABLE_ORDERS=orders
|
||||
DB_TABLE_BASKET_ITEMS=basket_items
|
||||
DB_TABLE_VARIABLES=variables
|
||||
@@ -11,8 +11,14 @@ DB_TABLE_PROGRAMME=programme
|
||||
DB_TABLE_INTERN_USERS=intern_users
|
||||
DB_TABLE_VEREINE=vereine
|
||||
DB_TABLE_ABTEILUNGEN=abteilungen
|
||||
DB_TABLE_TURNERINNEN_ABTEILUNGEN=turnerinnen_abteilungen
|
||||
DB_TABLE_TEILNEHMENDE_ABTEILUNGEN=teilnehmende_abteilungen
|
||||
DB_TABLE_GERAETE=geraete
|
||||
DB_TABLE_AUDIOFILES=audiofiles
|
||||
DB_TABLE_TEILNEHMENDE_AUDIOFILES=teilnehmende_audiofiles
|
||||
DB_TABLE_NOTEN=noten
|
||||
DB_TABLE_NOTEN_CHANGES=noten_changes
|
||||
DB_TABLE_NOTEN_BEZEICHNUNGEN=noten_bezeichnungen
|
||||
DB_TABLE_ORDERS_LOG=orders_log
|
||||
DB_TABLE_ZEITPLAN_TYPES=zeitplan_types
|
||||
DB_TABLE_ABTEILUNGEN_ZEITEN=abteilungen_zeiten
|
||||
DB_TABLE_RANKLIVE_CONFIGS=rankLive_configs
|
||||
@@ -3,4 +3,5 @@
|
||||
DB_USER=DB_USER_USERNAME
|
||||
DB_PASSWORD=DB_USER_PASSWORD
|
||||
DB_NAME=DATABASE_NAME
|
||||
DB_HOST=DB_HOST # An IP with Port, often 127.0.0.1:3306 or localhost:3306
|
||||
DB_HOST=DB_HOST # An IP with Port 127.0.0.1 or localhost
|
||||
DB_PORT=3306 # default Port is 3306
|
||||
@@ -0,0 +1,4 @@
|
||||
# This is a id, that needs to be unique, if you run multiple instances of WKVS on one server (also when using two different domains).
|
||||
# This id is primarly used for WS seperation, so that it is possible to just run one websocket/index.js
|
||||
|
||||
WETTKAMPF_ID=123456
|
||||
@@ -0,0 +1,207 @@
|
||||
wkvs - Copyright (C) 2026 Fabio Herzig
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
===
|
||||
|
||||
Third-party dependencies and their respective licenses are documented in www/licence.txt.
|
||||
|
||||
===
|
||||
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
TERMS AND CONDITIONS
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
function generateIntersectCache($mysqli, $baseDir) {
|
||||
global $tableProgramme;
|
||||
global $tableGeraete;
|
||||
global $tableNotenBezeichnungen;
|
||||
global $tableRankLiveConfigs;
|
||||
global $tableVar;
|
||||
|
||||
// 1. Fetch all unique IDs you need to loop through
|
||||
$all_programms = array_column(db_select($mysqli, $tableProgramme, '`id`', '`aktiv` = ?', [1]) ?? [], 'id');
|
||||
$all_geraete = array_column(db_select($mysqli, $tableGeraete, 'id') ?? [], 'id');
|
||||
|
||||
// 2. Fetch the static DB configs ONCE before starting the massive loop
|
||||
$rang_note_id = db_get_variable($mysqli, $tableVar, ['rangNote']);
|
||||
|
||||
$json_geraet = db_get_var($mysqli, "SELECT `all_noten_json` FROM $tableRankLiveConfigs WHERE `type_slug` = ?", ["rankLive-geraet"]) ?: '';
|
||||
$json_overview = db_get_var($mysqli, "SELECT `all_noten_json` FROM $tableRankLiveConfigs WHERE `type_slug` = ?", ["rankLive-overview"]) ?: '';
|
||||
$noten_rank_live_geraet = json_decode($json_geraet, true) ?? [];
|
||||
$noten_rank_live_overview = json_decode($json_overview, true) ?? [];
|
||||
|
||||
$notenConfig_db = db_select($mysqli, $tableNotenBezeichnungen, '`berechnung_json`, `id`, `type`, `anzahl_laeufe_json`');
|
||||
$noten_config = array_column($notenConfig_db, null, 'id');
|
||||
$following_config_array = array_column($notenConfig_db, 'berechnung_json', 'id');
|
||||
$all_inputs_noten_ids = array_filter(array_column($notenConfig_db, 'type', 'id'), fn($type) => $type === 'input');
|
||||
|
||||
$masterCache = [];
|
||||
|
||||
// 2. Extract ALL possible unique IDs dynamically from your JSON configurations
|
||||
$max_runs = 1; // Default fallback to at least 1 run
|
||||
|
||||
foreach ($noten_config as $n_id => $data) {
|
||||
$config = json_decode($data['anzahl_laeufe_json'], true);
|
||||
foreach ($config as $geraetKey => $value) {
|
||||
if ($geraetKey === 'default') {
|
||||
$max_runs = max($max_runs, (int)$value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $progKey => $runsCount) {
|
||||
$max_runs = max($max_runs, (int)$runsCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure we have array lists instead of associative maps
|
||||
$all_programms = array_values($all_programms);
|
||||
$all_geraete = array_values($all_geraete);
|
||||
|
||||
// Generate standard run sequences (e.g., if max_runs is 2, creates [1, 2])
|
||||
$all_runs = range(1, $max_runs);
|
||||
|
||||
$masterCache = [];
|
||||
|
||||
// 3. The Grand Loop
|
||||
foreach ($all_programms as $programm_id) {
|
||||
|
||||
foreach ($all_geraete as $geraetId) {
|
||||
foreach ($all_runs as $initNoteRun) {
|
||||
|
||||
$all_needed_noten = [];
|
||||
|
||||
foreach ($noten_rank_live_geraet as $ind => $s_note) {
|
||||
|
||||
$n_id = $s_note['n_id'];
|
||||
|
||||
$anzahl_laeufe_json = $noten_config[$n_id]['anzahl_laeufe_json'] ?? '';
|
||||
|
||||
$anzahl_laeufe = json_decode($anzahl_laeufe_json, true);
|
||||
|
||||
$g_id = ($s_note['g_id'] === 'A') ? (int) $geraetId : (int) $s_note['g_id'];
|
||||
|
||||
$run = (int) $s_note['r'];
|
||||
|
||||
$runs = $anzahl_laeufe[$g_id][(int) $programm_id] ?? $anzahl_laeufe[$g_id]['all'] ?? $anzahl_laeufe['default'] ?? 0;
|
||||
|
||||
if (((int) $runs) < $run) {
|
||||
unset($noten_rank_live_geraet[$ind]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = "$n_id|$g_id|$run";
|
||||
|
||||
if (!isset($all_needed_noten[$key])) {
|
||||
$all_needed_noten[$key] = [
|
||||
"r" => $run,
|
||||
"g_id" => $g_id,
|
||||
"n_id" => $n_id
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($noten_rank_live_overview as $s_note) {
|
||||
|
||||
$n_id = $s_note['n_id'];
|
||||
$g_id = $s_note['g_id'];
|
||||
$run = $s_note['r'];
|
||||
|
||||
$key = "$n_id|$g_id|$run";
|
||||
|
||||
if (!isset($all_needed_noten[$key])) {
|
||||
$all_needed_noten[$key] = [
|
||||
"r" => $run,
|
||||
"g_id" => $g_id,
|
||||
"n_id" => $n_id
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$all_updating_noten = [];
|
||||
|
||||
foreach ($following_config_array as $this_note_id => $s_note_abhaenige_rechnungen_json) {
|
||||
$s_note_abhaenige_rechnungen = json_decode($s_note_abhaenige_rechnungen_json ?? '') ?? [];
|
||||
foreach ($s_note_abhaenige_rechnungen as $s_rechnung) {
|
||||
$this_note_geraet_id = $s_rechnung[1];
|
||||
|
||||
if ($this_note_geraet_id !== 'A' && (int) $this_note_geraet_id !== (int) $geraetId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$target_note_id = $s_rechnung[0];
|
||||
$target_run_raw = $s_rechnung[2][0] ?? 'A';
|
||||
$target_geraet_id_raw = $s_rechnung[2][1] ?? 'A';
|
||||
|
||||
$target_run = ($target_run_raw === 'A') ? $initNoteRun : (int) $target_run_raw;
|
||||
$target_geraet_id = ($target_geraet_id_raw === 'A') ? $geraetId : (int) $target_geraet_id_raw;
|
||||
|
||||
$key = "$target_note_id|$target_geraet_id|$target_run";
|
||||
|
||||
if (!isset($all_updating_noten[$key])) {
|
||||
$all_updating_noten[$key] = [
|
||||
"r" => $target_run,
|
||||
"g_id" => $target_geraet_id,
|
||||
"n_id" => $target_note_id
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($all_inputs_noten_ids as $n_id => $_) {
|
||||
|
||||
$anzahl_laeufe_json = $noten_config[$n_id]['anzahl_laeufe_json'] ?? '';
|
||||
|
||||
$anzahl_laeufe = json_decode($anzahl_laeufe_json, true);
|
||||
|
||||
$runs = $anzahl_laeufe[$geraetId][(int) $programm_id] ?? $anzahl_laeufe[$geraetId]['all'] ?? $anzahl_laeufe['default'] ?? 0;
|
||||
|
||||
if ($initNoteRun > $runs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = "$n_id|$geraetId|$initNoteRun";
|
||||
|
||||
if (!isset($all_updating_noten[$key])) {
|
||||
$all_updating_noten[$key] = [
|
||||
"r" => $initNoteRun,
|
||||
"g_id" => $geraetId,
|
||||
"n_id" => $n_id
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$intersect_noten = array_intersect_key($all_updating_noten, $all_needed_noten);
|
||||
|
||||
$key = "$rang_note_id|0|1";
|
||||
|
||||
if (!isset($all_updating_noten[$key])) {
|
||||
$all_updating_noten[$key] = [
|
||||
"r" => 1,
|
||||
"g_id" => 0,
|
||||
"n_id" => $rang_note_id
|
||||
];
|
||||
}
|
||||
|
||||
$sql_where_array = [];
|
||||
$sql_where_values = [];
|
||||
|
||||
$i = 1;
|
||||
|
||||
foreach ($intersect_noten as $s_note) {
|
||||
$sql_where_values[] = $s_note['n_id'];
|
||||
$sql_where_values[] = $s_note['g_id'];
|
||||
$sql_where_values[] = $s_note['r'];
|
||||
|
||||
$sql_where_array[] = '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)';
|
||||
}
|
||||
|
||||
$sql_where_string = '';
|
||||
|
||||
if (!empty($sql_where_values)) {
|
||||
$sql_where_string = implode(' OR ', $sql_where_array);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($intersect_noten)) {
|
||||
$masterCache[$programm_id][$geraetId][$initNoteRun] = ["SQL" => $sql_where_string, "values" => $sql_where_values, "intersect_noten" => $intersect_noten];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Save to file
|
||||
$fileContent = "<?php\nreturn " . var_export($masterCache, true) . ";";
|
||||
file_put_contents($baseDir . '/../scripts/cache/display-dependencies.php', $fileContent);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
function regenerate_noten_cache($mysqli, $tableNotenBezeichnungen, $baseDir) {
|
||||
if (!function_exists('db_select')) require $baseDir . '/../scripts/db/db-functions.php';
|
||||
|
||||
$notenRechnerCache = new NotenRechner();
|
||||
|
||||
$all = db_select($mysqli, $tableNotenBezeichnungen, "id, default_value, pro_geraet, geraete_json, anzahl_laeufe_json, berechnung, nullstellen, zeige_in_rank_live, display_string");
|
||||
|
||||
$ascArrayDefaultValues = array_column($all, 'default_value', 'id');
|
||||
$ascArrayProGeraet = array_column($all, 'pro_geraet', 'id');
|
||||
$ascArrayRechnungen = array_column($all, 'berechnung', 'id');
|
||||
$indexedNullstellen = array_column($all, 'nullstellen', 'id');
|
||||
$ascPrefixDisplay = array_column($all, 'display_string', 'id');
|
||||
|
||||
$ascArrayGeraeteJSON = array_column($all, 'geraete_json', 'id');
|
||||
foreach ($ascArrayGeraeteJSON as $key => $val) {
|
||||
$ascArrayGeraeteJSON[$key] = json_decode((string)$val, true);
|
||||
}
|
||||
|
||||
$ascArrayAnzahlLaeufeJSON = array_column($all, 'anzahl_laeufe_json', 'id');
|
||||
foreach ($ascArrayAnzahlLaeufeJSON as $key => $val) {
|
||||
$ascArrayAnzahlLaeufeJSON[$key] = json_decode((string)$val, true) ?? [];
|
||||
}
|
||||
|
||||
$export = "<?php\n\nreturn [\n";
|
||||
$export .= " 'default_values' => " . var_export($ascArrayDefaultValues, true) . ",\n";
|
||||
$export .= " 'pro_geraet' => " . var_export($ascArrayProGeraet, true) . ",\n";
|
||||
$export .= " 'geraete_json' => " . var_export($ascArrayGeraeteJSON, true) . ",\n";
|
||||
$export .= " 'anzahl_laeufe_json' => " . var_export($ascArrayAnzahlLaeufeJSON, true) . ",\n";
|
||||
$export .= " 'rechnungen' => " . var_export($ascArrayRechnungen, true) . ",\n";
|
||||
$export .= " 'nullstellen' => " . var_export($indexedNullstellen, true) . "\n";
|
||||
$export .= " ];\n";
|
||||
|
||||
file_put_contents($baseDir . '/../scripts/cache/noten-config-calculating-cache.php', $export);
|
||||
|
||||
$ascArrayStoreRuns = [];
|
||||
$ascArrayStoreGeraete = [];
|
||||
|
||||
foreach ($ascArrayRechnungen as $id => $calc) {
|
||||
$res = $notenRechnerCache->getStoreGeraetRun($calc);
|
||||
$ascArrayStoreRuns[$id] = $res['run_num'] ?? 'A';
|
||||
$ascArrayStoreGeraete[$id] = $res['geraet_id'] ?? 'A';
|
||||
}
|
||||
|
||||
$exportDisplay = "<?php\n\nreturn [\n";
|
||||
$exportDisplay .= " 'default_values' => " . var_export($ascArrayDefaultValues, true) . ",\n";
|
||||
$exportDisplay .= " 'pro_geraet' => " . var_export($ascArrayProGeraet, true) . ",\n";
|
||||
$exportDisplay .= " 'geraete_json' => " . var_export($ascArrayGeraeteJSON, true) . ",\n";
|
||||
$exportDisplay .= " 'anzahl_laeufe_json' => " . var_export($ascArrayAnzahlLaeufeJSON, true) . ",\n";
|
||||
$exportDisplay .= " 'nullstellen' => " . var_export($indexedNullstellen, true) . ",\n";
|
||||
$exportDisplay .= " 'display_string' => " . var_export($ascPrefixDisplay, true) . ",\n";
|
||||
$exportDisplay .= " 'store_run' => " . var_export($ascArrayStoreRuns, true) . ",\n";
|
||||
$exportDisplay .= " 'store_geraet' => " . var_export($ascArrayStoreGeraete, true) . "\n";
|
||||
$exportDisplay .= "];\n";
|
||||
|
||||
file_put_contents($baseDir . '/../scripts/cache/noten-config-display-cache.php', $exportDisplay);
|
||||
}
|
||||
@@ -0,0 +1,661 @@
|
||||
<?php
|
||||
return array (
|
||||
4 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 1,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 1,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 1,
|
||||
2 => 2,
|
||||
3 => 70,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 1,
|
||||
11 => 2,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|1|2' =>
|
||||
array (
|
||||
'r' => 2,
|
||||
'g_id' => 1,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|1|2' =>
|
||||
array (
|
||||
'r' => 2,
|
||||
'g_id' => 1,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 2,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 2,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 2,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 2,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 3,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 3,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 3,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 3,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 4,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 4,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 4,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 4,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
13 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 1,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 1,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 1,
|
||||
2 => 2,
|
||||
3 => 70,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 1,
|
||||
11 => 2,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|1|2' =>
|
||||
array (
|
||||
'r' => 2,
|
||||
'g_id' => 1,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|1|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 1,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|1|2' =>
|
||||
array (
|
||||
'r' => 2,
|
||||
'g_id' => 1,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 2,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 2,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 2,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 2,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|2|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 2,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 3,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 3,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 3,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 3,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|3|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 3,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
1 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 60,
|
||||
1 => 4,
|
||||
2 => 1,
|
||||
3 => 70,
|
||||
4 => 4,
|
||||
5 => 1,
|
||||
6 => 80,
|
||||
7 => 0,
|
||||
8 => 1,
|
||||
9 => 40,
|
||||
10 => 4,
|
||||
11 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'60|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 60,
|
||||
),
|
||||
'70|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
'40|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'SQL' => '(`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?) OR (`note_bezeichnung_id` = ? AND `geraet_id` = ? AND `run_number` = ?)',
|
||||
'values' =>
|
||||
array (
|
||||
0 => 70,
|
||||
1 => 4,
|
||||
2 => 1,
|
||||
3 => 80,
|
||||
4 => 0,
|
||||
5 => 1,
|
||||
),
|
||||
'intersect_noten' =>
|
||||
array (
|
||||
'70|4|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 4,
|
||||
'n_id' => 70,
|
||||
),
|
||||
'80|0|1' =>
|
||||
array (
|
||||
'r' => 1,
|
||||
'g_id' => 0,
|
||||
'n_id' => 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default_values' => array (
|
||||
10 => 0.0,
|
||||
11 => 0.0,
|
||||
20 => 0.0,
|
||||
40 => 0.0,
|
||||
50 => 0.0,
|
||||
60 => 0.0,
|
||||
70 => 0.0,
|
||||
80 => 0.0,
|
||||
),
|
||||
'pro_geraet' => array (
|
||||
10 => 1,
|
||||
11 => 1,
|
||||
20 => 1,
|
||||
40 => 1,
|
||||
50 => 1,
|
||||
60 => 1,
|
||||
70 => 1,
|
||||
80 => 0,
|
||||
),
|
||||
'geraete_json' => array (
|
||||
10 =>
|
||||
array (
|
||||
),
|
||||
11 =>
|
||||
array (
|
||||
),
|
||||
20 =>
|
||||
array (
|
||||
),
|
||||
40 =>
|
||||
array (
|
||||
),
|
||||
50 =>
|
||||
array (
|
||||
),
|
||||
60 =>
|
||||
array (
|
||||
),
|
||||
70 =>
|
||||
array (
|
||||
),
|
||||
80 =>
|
||||
array (
|
||||
0 => 0,
|
||||
),
|
||||
),
|
||||
'anzahl_laeufe_json' => array (
|
||||
10 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
11 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
20 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
40 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
50 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
60 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
70 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
),
|
||||
80 =>
|
||||
array (
|
||||
'default' => 0,
|
||||
0 =>
|
||||
array (
|
||||
'all' => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
'rechnungen' => array (
|
||||
10 => '',
|
||||
11 => '',
|
||||
20 => '({10[S]} + {11[S]}) / 2->RSGS',
|
||||
40 => '',
|
||||
50 => '',
|
||||
60 => '10 - {20[S]} + {40[S]} - {50[S]}->RSGS',
|
||||
70 => 'AVGR({60[S]})->R1GS',
|
||||
80 => '{70[1]} + {70[2]} + {70[3]} + {70[4]}->R1G0',
|
||||
),
|
||||
'nullstellen' => array (
|
||||
10 => 3,
|
||||
11 => 3,
|
||||
20 => 3,
|
||||
40 => 2,
|
||||
50 => 2,
|
||||
60 => 2,
|
||||
70 => 2,
|
||||
80 => 2,
|
||||
)
|
||||
];
|
||||
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default_values' => array (
|
||||
10 => 0.0,
|
||||
11 => 0.0,
|
||||
20 => 0.0,
|
||||
40 => 0.0,
|
||||
50 => 0.0,
|
||||
60 => 0.0,
|
||||
70 => 0.0,
|
||||
80 => 0.0,
|
||||
),
|
||||
'pro_geraet' => array (
|
||||
10 => 1,
|
||||
11 => 1,
|
||||
20 => 1,
|
||||
40 => 1,
|
||||
50 => 1,
|
||||
60 => 1,
|
||||
70 => 1,
|
||||
80 => 0,
|
||||
),
|
||||
'geraete_json' => array (
|
||||
10 =>
|
||||
array (
|
||||
),
|
||||
11 =>
|
||||
array (
|
||||
),
|
||||
20 =>
|
||||
array (
|
||||
),
|
||||
40 =>
|
||||
array (
|
||||
),
|
||||
50 =>
|
||||
array (
|
||||
),
|
||||
60 =>
|
||||
array (
|
||||
),
|
||||
70 =>
|
||||
array (
|
||||
),
|
||||
80 =>
|
||||
array (
|
||||
0 => 0,
|
||||
),
|
||||
),
|
||||
'anzahl_laeufe_json' => array (
|
||||
10 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
11 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
20 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
40 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
50 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
60 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
1 =>
|
||||
array (
|
||||
'all' => 2,
|
||||
),
|
||||
),
|
||||
70 =>
|
||||
array (
|
||||
'default' => 1,
|
||||
),
|
||||
80 =>
|
||||
array (
|
||||
'default' => 0,
|
||||
0 =>
|
||||
array (
|
||||
'all' => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
'nullstellen' => array (
|
||||
10 => 3,
|
||||
11 => 3,
|
||||
20 => 3,
|
||||
40 => 2,
|
||||
50 => 2,
|
||||
60 => 2,
|
||||
70 => 2,
|
||||
80 => 2,
|
||||
),
|
||||
'zeige_in_rank_live' => array (
|
||||
10 => 1,
|
||||
11 => 1,
|
||||
20 => 1,
|
||||
40 => 1,
|
||||
50 => 1,
|
||||
60 => 1,
|
||||
70 => 1,
|
||||
80 => 1,
|
||||
),
|
||||
'display_string' => array (
|
||||
10 => '${note}',
|
||||
11 => '${note}',
|
||||
20 => '${note}',
|
||||
40 => 'D ${note}',
|
||||
50 => '${note}',
|
||||
60 => '${note}',
|
||||
70 => '${note}',
|
||||
80 => '${note}',
|
||||
),
|
||||
'store_run' => array (
|
||||
10 => 'A',
|
||||
11 => 'A',
|
||||
20 => 'A',
|
||||
40 => 'A',
|
||||
50 => 'A',
|
||||
60 => 'A',
|
||||
70 => 1,
|
||||
80 => 1,
|
||||
),
|
||||
'store_geraet' => array (
|
||||
10 => 'A',
|
||||
11 => 'A',
|
||||
20 => 'A',
|
||||
40 => 'A',
|
||||
50 => 'A',
|
||||
60 => 'A',
|
||||
70 => 'A',
|
||||
80 => 0,
|
||||
)
|
||||
];
|
||||
@@ -1,170 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
require __DIR__ . '/../../composer/vendor/autoload.php';
|
||||
|
||||
$envFile = realpath(__DIR__ . '/../../config/.env.db');
|
||||
|
||||
if ($envFile === false) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Environment file not found"
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$envDir = dirname($envFile);
|
||||
|
||||
$dotenv = Dotenv::createImmutable($envDir, '.env.db');
|
||||
|
||||
$dotenv->load();
|
||||
} catch (Throwable $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Dotenv error: " . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
|
||||
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_USER']) || !isset($_ENV['DB_PASSWORD'])){
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'corrupt cofig file'
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$mysqli = @new mysqli($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
|
||||
if ($mysqli->connect_error) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "DB connection failed"
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$mysqli->set_charset("utf8");
|
||||
|
||||
require __DIR__ . "/db-tables.php";
|
||||
|
||||
$tables = [$tableTurnerinnen, $tableOrders, $tableBasketItems, $tableKrProtokoll];
|
||||
$cleartablearray = [$tableOrders, $tableBasketItems, $tableKrProtokoll];
|
||||
|
||||
require __DIR__ . "/../../resultate/newjson.php";
|
||||
|
||||
// Columns to set to 0
|
||||
$columns0 = [
|
||||
'd-note balken', 'd-note boden',
|
||||
'd-note sprung', 'd-note barren',
|
||||
'e1 note sprung','e2 note sprung','e note sprung','neutrale abzuege sprung',
|
||||
'e1 note barren','e2 note barren','e note barren','neutrale abzuege barren',
|
||||
'e1 note balken','e2 note balken','e note balken','neutrale abzuege balken',
|
||||
'e1 note boden','e2 note boden','e note boden','neutrale abzuege boden',
|
||||
'bezahlt', 'bezahltoverride', 'rang', 'abteilung', 'startgeraet', 'anzabteilungen', 'startindex', 'bodenmusik'
|
||||
];
|
||||
|
||||
$dir = __DIR__ . '/../../../test-wkvs/dbbackups';
|
||||
|
||||
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir, 0755, true);
|
||||
}
|
||||
|
||||
$newdir = $dir ."/". date('Ymd_His');
|
||||
|
||||
if (!is_dir($newdir)) {
|
||||
mkdir($newdir, 0755, true);
|
||||
}
|
||||
|
||||
foreach ($tables as $t){
|
||||
$backupFile = $t . '_backup' . '.sql';
|
||||
$filename = $newdir . '/' . $backupFile;
|
||||
|
||||
$handle = fopen($filename, 'w');
|
||||
if ($handle === false) {
|
||||
die("Cannot open file: $filename");
|
||||
}
|
||||
|
||||
|
||||
$res = $mysqli->query("SHOW CREATE TABLE `$t`");
|
||||
$row = $res->fetch_assoc();
|
||||
fwrite($handle, $row['Create Table'] . ";\n\n");
|
||||
|
||||
|
||||
$res = $mysqli->query("SELECT * FROM `$t`");
|
||||
while ($row = $res->fetch_assoc()) {
|
||||
$columns = array_map(function($col){ return "`$col`"; }, array_keys($row));
|
||||
$values = array_map(function($val) use ($mysqli) { return "'" . $mysqli->real_escape_string($val) . "'"; }, array_values($row));
|
||||
fwrite($handle, "INSERT INTO `$t` (" . implode(", ", $columns) . ") VALUES (" . implode(", ", $values) . ");\n");
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
// Columns to set to 10
|
||||
$columns10 = [
|
||||
'note balken', 'note boden',
|
||||
'note sprung', 'note barren'
|
||||
];
|
||||
|
||||
$set = [];
|
||||
$params = [];
|
||||
$types = '';
|
||||
|
||||
// Add 0 columns
|
||||
foreach ($columns0 as $col) {
|
||||
$set[] = "`$col` = ?";
|
||||
$params[] = '0';
|
||||
$types .= 's';
|
||||
}
|
||||
|
||||
// Add 10 columns
|
||||
foreach ($columns10 as $col) {
|
||||
$set[] = "`$col` = ?";
|
||||
$params[] = '10';
|
||||
$types .= 's';
|
||||
}
|
||||
|
||||
// Add gesammtpunktzahl column
|
||||
$set[] = "`gesamtpunktzahl` = ?";
|
||||
$params[] = '40';
|
||||
$types .= 's';
|
||||
|
||||
// Build SQL
|
||||
$sql = "UPDATE turnerinnen SET " . implode(", ", $set);
|
||||
|
||||
// Prepare
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
if ($stmt === false) {
|
||||
die("Prepare failed: " . $mysqli->error);
|
||||
}
|
||||
|
||||
// Bind parameters dynamically
|
||||
$bind_names[] = $types;
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$bind_names[] = &$params[$i]; // reference required
|
||||
}
|
||||
call_user_func_array([$stmt, 'bind_param'], $bind_names);
|
||||
|
||||
// Execute
|
||||
if (!$stmt->execute()) {
|
||||
echo "Error: " . $stmt->error;
|
||||
}
|
||||
// Close
|
||||
$stmt->close();
|
||||
|
||||
foreach ($cleartablearray as $t) {
|
||||
$stmt = $mysqli->prepare("DELETE FROM ".$t);
|
||||
if (!$stmt->execute()) {
|
||||
echo "Error: " . $stmt->error;
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
//
|
||||
$mysqli->close();
|
||||
?>
|
||||
@@ -130,3 +130,56 @@ function db_get_var($mysqli, $sql, $params = []) {
|
||||
$stmt->close();
|
||||
return $value;
|
||||
}
|
||||
|
||||
function db_get_variable($mysqli, $tableVar, $params = []) {
|
||||
if (count($params) !== 1) return null;
|
||||
$stmt = $mysqli->prepare("SELECT `value` FROM $tableVar WHERE `name` = ?");
|
||||
$stmt->bind_param("s", ...$params);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($value);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
return $value;
|
||||
}
|
||||
|
||||
function db_update_variable($mysqli, $tableVar, $params = ['name', 'value']) {
|
||||
if (count($params) !== 2) return false;
|
||||
$stmt = $mysqli->prepare("INSERT INTO $tableVar (`name`, `value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`)");
|
||||
$stmt->bind_param("ss", ...$params);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
return true;
|
||||
}
|
||||
|
||||
function db_check_var(mysqli $mysqli, string $table, string $where, array $params = []) : bool {
|
||||
|
||||
$table = preg_replace('/[^a-zA-Z0-9_]/', '', $table);
|
||||
|
||||
$stmt = $mysqli->prepare("SELECT 1 FROM `" . $table . "` WHERE " . $where);
|
||||
if (!$stmt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($params)) {
|
||||
$types = '';
|
||||
foreach ($params as $param) {
|
||||
if (is_int($param)) {
|
||||
$types .= 'i';
|
||||
} elseif (is_float($param)) {
|
||||
$types .= 'd';
|
||||
} else {
|
||||
$types .= 's';
|
||||
}
|
||||
}
|
||||
$stmt->bind_param($types, ...$params);
|
||||
}
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$stmt->store_result();
|
||||
$exists = $stmt->num_rows > 0;
|
||||
|
||||
$stmt->close();
|
||||
|
||||
return $exists;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ $prefix = $_ENV['DB_PREFIX'] ?? '';
|
||||
|
||||
|
||||
$tableDefinitions = [
|
||||
'Turnerinnen' => 'DB_TABLE_TURNERINNEN',
|
||||
'Teilnehmende' => 'DB_TABLE_TEILNEHMENDE',
|
||||
'Orders' => 'DB_TABLE_ORDERS',
|
||||
'BasketItems' => 'DB_TABLE_BASKET_ITEMS',
|
||||
'Var' => 'DB_TABLE_VARIABLES',
|
||||
@@ -44,11 +44,17 @@ $tableDefinitions = [
|
||||
'InternUsers' => 'DB_TABLE_INTERN_USERS',
|
||||
'Vereine' => 'DB_TABLE_VEREINE',
|
||||
'Abt' => 'DB_TABLE_ABTEILUNGEN',
|
||||
'TurnerinnenAbt' => 'DB_TABLE_TURNERINNEN_ABTEILUNGEN',
|
||||
'TeilnehmendeAbt' => 'DB_TABLE_TEILNEHMENDE_ABTEILUNGEN',
|
||||
'Geraete' => 'DB_TABLE_GERAETE',
|
||||
'Audiofiles' => 'DB_TABLE_AUDIOFILES',
|
||||
'TeilnehmendeAudiofiles' => 'DB_TABLE_TEILNEHMENDE_AUDIOFILES',
|
||||
'Noten' => 'DB_TABLE_NOTEN',
|
||||
'NotenBezeichnungen' => 'DB_TABLE_NOTEN_BEZEICHNUNGEN'
|
||||
'NotenChanges' => 'DB_TABLE_NOTEN_CHANGES',
|
||||
'NotenBezeichnungen' => 'DB_TABLE_NOTEN_BEZEICHNUNGEN',
|
||||
'OrdersLog' => 'DB_TABLE_ORDERS_LOG',
|
||||
'ZeitplanTypes' => 'DB_TABLE_ZEITPLAN_TYPES',
|
||||
'AbtZeiten' => 'DB_TABLE_ABTEILUNGEN_ZEITEN',
|
||||
'RankLiveConfigs' => 'DB_TABLE_RANKLIVE_CONFIGS'
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ try {
|
||||
]);
|
||||
}
|
||||
|
||||
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_GUEST_USER']) || !isset($_ENV['DB_GUEST_PASSWORD'])){
|
||||
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_GUEST_USER']) || !isset($_ENV['DB_GUEST_PASSWORD']) || !isset($_ENV['DB_PORT'])){
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'corrupt cofig file'
|
||||
@@ -37,7 +37,7 @@ if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_GUE
|
||||
exit;
|
||||
}
|
||||
|
||||
$guest = @new mysqli($_ENV['DB_HOST'], $_ENV['DB_GUEST_USER'], $_ENV['DB_GUEST_PASSWORD'], $_ENV['DB_NAME']);
|
||||
$guest = @new mysqli($_ENV['DB_HOST'], $_ENV['DB_GUEST_USER'], $_ENV['DB_GUEST_PASSWORD'], $_ENV['DB_NAME'], $_ENV['DB_PORT']);
|
||||
if ($guest->connect_error) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
|
||||
@@ -56,7 +56,7 @@ try {
|
||||
]);
|
||||
}
|
||||
|
||||
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_USER']) || !isset($_ENV['DB_PASSWORD'])){
|
||||
if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_USER']) || !isset($_ENV['DB_PASSWORD']) || !isset($_ENV['DB_PORT'])){
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'corrupt cofig file'
|
||||
@@ -64,7 +64,7 @@ if (!isset($_ENV['DB_HOST']) || !isset($_ENV['DB_NAME']) || !isset($_ENV['DB_USE
|
||||
exit;
|
||||
}
|
||||
|
||||
$mysqli = @new mysqli($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
|
||||
$mysqli = @new mysqli($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME'], $_ENV['DB_PORT']);
|
||||
if ($mysqli->connect_error) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
function parse_input_to_delete() {
|
||||
global $_DELETE;
|
||||
$_DELETE = [];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'DELETE') {
|
||||
http_response_code(405);
|
||||
echo json_encode(['success' => false, 'message' => 'Method not allowed']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$rawInput = file_get_contents('php://input');
|
||||
|
||||
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
|
||||
if (stripos($contentType, 'application/json') !== false) {
|
||||
$_DELETE = json_decode($rawInput, true) ?? [];
|
||||
} else {
|
||||
parse_str($rawInput, $_DELETE);
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ if ($userid > 0) {
|
||||
$result = $stmt->get_result();
|
||||
|
||||
if ($result) {
|
||||
$dbarray = $result->fetch_assoc(); // $programme is an array
|
||||
$dbarray = $result->fetch_assoc();
|
||||
}
|
||||
|
||||
$freigabe_json = $dbarray['freigabe'];
|
||||
$username = $dbarray['username'];
|
||||
$freigabe_json = $dbarray['freigabe'] ?? '';
|
||||
$username = $dbarray['username'] ?? '';
|
||||
|
||||
$stmt->close();
|
||||
|
||||
@@ -24,27 +24,26 @@ if ($userid > 0) {
|
||||
$arrayfreigaben = $arrayfreigaben['freigabenKampfrichter'] ?? [];
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfreigaben)) {
|
||||
|
||||
$key = array_search('admin', $arrayfreigaben, true);
|
||||
if ($key !== false) {
|
||||
unset($arrayfreigaben[$key]);
|
||||
array_unshift($arrayfreigaben, 'admin');
|
||||
$arrayfreigaben = array_values($arrayfreigaben);
|
||||
}
|
||||
|
||||
$selectedfreigabe = $_SESSION['selectedFreigabeKampfrichter'] ?? $arrayfreigaben[0];
|
||||
|
||||
if (!in_array($selectedfreigabe, $arrayfreigaben, true)) {
|
||||
$selectedfreigabe = $arrayfreigaben[0];
|
||||
}
|
||||
|
||||
$_SESSION['selectedFreigabeKampfrichter'] = $selectedfreigabe;
|
||||
} else {
|
||||
if (empty($arrayfreigaben)) {
|
||||
echo 'Keine gültigen Freigaben! Sie wurden abgemeldet.';
|
||||
$_SESSION['access_granted_kampfrichter'] = false;
|
||||
$_SESSION['logoDisplay'] = true;
|
||||
exit;
|
||||
}
|
||||
|
||||
$selecteduser = $selectedfreigabe;
|
||||
$key = array_search("A", $arrayfreigaben, true);
|
||||
if ($key !== false) {
|
||||
unset($arrayfreigaben[$key]);
|
||||
array_unshift($arrayfreigaben, "A");
|
||||
$arrayfreigaben = array_values($arrayfreigaben);
|
||||
}
|
||||
|
||||
$selectedFreigabeId = $_SESSION['selectedFreigabeIdKampfrichter'] ?? $arrayfreigaben[0];
|
||||
|
||||
if (!in_array($selectedFreigabeId, $arrayfreigaben, true)) {
|
||||
$selectedFreigabeId = $arrayfreigaben[0];
|
||||
}
|
||||
|
||||
$_SESSION['selectedFreigabeIdKampfrichter'] = $selectedFreigabeId;
|
||||
|
||||
$isAdmin = $selectedFreigabeId === 'A';
|
||||
|
||||
@@ -4,44 +4,57 @@
|
||||
$form_message = $_SESSION['form_message'] ?? '';
|
||||
unset($_SESSION['form_message']);
|
||||
|
||||
if ((isset($_POST['prev_abt'])) && !empty($_POST['prev_abt_submit'])) {
|
||||
if (isset($_POST['prev_abt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $aktabt;
|
||||
if ($value > 1){
|
||||
$value -= 1;
|
||||
$name = 'wk_panel_current_abt';
|
||||
|
||||
$stmt = $mysqli->prepare("INSERT INTO $tableVar (`name`, `value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `value` = VALUE(`value`)");
|
||||
|
||||
$stmt->bind_param("ss", $name, $value);
|
||||
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
db_update_variable($mysqli, $tableVar, ['wk_panel_current_abt', $value]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ((isset($_POST['next_abt'])) && !empty($_POST['next_abt_submit'])) {
|
||||
if (isset($_POST['next_abt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $aktabt;
|
||||
$maxvalue = db_get_var($mysqli, "SELECT name FROM $tableAbt ORDER BY name DESC LIMIT 1");
|
||||
$maxvalue = (int) (db_get_var($mysqli, "SELECT name FROM $tableAbt ORDER BY name DESC LIMIT 1") ?? 1);
|
||||
|
||||
if ($value < $maxvalue){
|
||||
$value += 1;
|
||||
$name = 'wk_panel_current_abt';
|
||||
|
||||
$stmt = $mysqli->prepare("INSERT INTO $tableVar (`name`, `value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `value` = VALUE(`value`)");
|
||||
|
||||
$stmt->bind_param("ss", $name, $value);
|
||||
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
db_update_variable($mysqli, $tableVar, ['wk_panel_current_abt', $value]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['prev_subabt_admin_submit']) && $isAdmin) {
|
||||
verify_csrf();
|
||||
$value = $akt_subabt_admin;
|
||||
if ($value > 1){
|
||||
$value -= 1;
|
||||
db_update_variable($mysqli, $tableVar, ['wk_panel_current_subabt_admin', $value]);
|
||||
$_SESSION['ws_Message_json'] = json_encode(['type' => 'UPDATE_RANKLIVE_C_SUBABT', 'payload' => []]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['next_subabt_admin_submit']) && $isAdmin) {
|
||||
verify_csrf();
|
||||
$value = $akt_subabt_admin;
|
||||
$max_value_admin_subabt = count($disciplines);
|
||||
|
||||
if ($value < $max_value_admin_subabt){
|
||||
$value += 1;
|
||||
db_update_variable($mysqli, $tableVar, ['wk_panel_current_subabt_admin', $value]);
|
||||
$_SESSION['ws_Message_json'] = json_encode(['type' => 'UPDATE_RANKLIVE_C_SUBABT', 'payload' => []]);
|
||||
}
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($_SESSION['currentsubabt'])){
|
||||
$_SESSION['currentsubabt'] = 1;
|
||||
@@ -56,7 +69,7 @@ if ($_SESSION['last_abt'] !== $aktabt){
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
}
|
||||
|
||||
if ((isset($_POST['prev_subabt'])) && !empty($_POST['prev_subabt_submit'])) {
|
||||
if (isset($_POST['prev_subabt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $_SESSION['currentsubabt'];
|
||||
if ($value > 1){
|
||||
@@ -68,10 +81,10 @@ if ((isset($_POST['prev_subabt'])) && !empty($_POST['prev_subabt_submit'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ((isset($_POST['next_subabt'])) && !empty($_POST['next_subabt_submit'])) {
|
||||
if (isset($_POST['next_subabt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $_SESSION['currentsubabt'];
|
||||
if ($value < $maxsubabt){
|
||||
if ($value < $max_subabt){
|
||||
$_SESSION['currentsubabt']++;
|
||||
$_SESSION['currentEditId'] = false;
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
@@ -80,12 +93,28 @@ if ((isset($_POST['next_subabt'])) && !empty($_POST['next_subabt_submit'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( isset($_POST['togle_advanced_mode_admin']) && !empty($_POST['togle_advanced_mode_admin_submit']) && !empty($_POST['csrf_token'])) {
|
||||
if (isset($_POST['prog_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
$current_value = $focus_view_admin;
|
||||
$new_value = !$current_value;
|
||||
|
||||
$_SESSION['abtViewAdmin'] = $new_value;
|
||||
$_SESSION['view_type_admin'] = 'prog';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['abt_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
|
||||
$_SESSION['view_type_admin'] = 'abt';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['live_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
|
||||
$_SESSION['view_type_admin'] = 'live';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../rate-limiter/rate-limiter.php';
|
||||
|
||||
$limiter = new TokenBucket(
|
||||
redis: $redis,
|
||||
capacity: 30,
|
||||
refillRate: 2,
|
||||
refillInterval: 5.0
|
||||
);
|
||||
|
||||
$result = $limiter->allow('RATE_LIMITER:TYPE:login:IP:'. $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if (!$result['allowed']) {
|
||||
http_response_code(429);
|
||||
include __DIR__ . "/../../www/error-pages/429.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../session_functions.php';
|
||||
|
||||
ini_wkvs_session();
|
||||
@@ -83,24 +100,34 @@ if ($_SESSION['lockout_time_'. $logintype] > time()) {
|
||||
}
|
||||
}
|
||||
|
||||
$array_logintitles = [
|
||||
'wk_leitung' => 'Wettkampfleitung',
|
||||
'trainer' => 'Trainer',
|
||||
'kampfrichter' => 'Kampfrichter'
|
||||
]
|
||||
?>
|
||||
<section class="page-secure-login">
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Login <?= $array_logintitles[$logintype] ?></title>
|
||||
<link rel="icon" type="png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/intern/css/login.css">
|
||||
<link href="/files/fonts/fonts.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/intern/css/user.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="login">
|
||||
<section class="page-secure-login">
|
||||
<div class="bg-picture-secure-login">
|
||||
<img src="/intern/img/login/bg<?= ucfirst($logintype) ?>.webp">
|
||||
</div>
|
||||
<div class="bg-secure-login">
|
||||
<div class="bg-secure-login-form">
|
||||
<?php
|
||||
if (str_contains($logintype, '_')) {
|
||||
$titlelogintype = str_replace('_', '-', $logintype);
|
||||
} else {
|
||||
$titlelogintype = $logintype . 'panel';
|
||||
}
|
||||
?>
|
||||
<h1>Anmeldung<br><?= ucfirst($titlelogintype) ?></h1>
|
||||
<p style="font-weight:400; line-height: 1.5; margin-bottom: 50px;">Bitte verwenden Sie hier Ihren
|
||||
individuellen Zugang
|
||||
</p>
|
||||
<h1>Anmeldung<br><?= $array_logintitles[$logintype] ?? "" ?></h1>
|
||||
|
||||
<form method="post">
|
||||
<label for="access_username">Benutzername eingeben</label><br>
|
||||
@@ -123,147 +150,24 @@ if ($_SESSION['lockout_time_'. $logintype] > time()) {
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<a class="seclog_home_link" href="/"><img src="/intern/img/logo-normal.png" width="64" height="64"></a>
|
||||
<a class="seclog_home_link" href="/"><img src="/intern/img/logo-normal.png"></a>
|
||||
|
||||
<style>
|
||||
body{
|
||||
overflow: hidden;
|
||||
}
|
||||
.page-secure-login{
|
||||
display: flex;
|
||||
}
|
||||
.bg-picture-secure-login{
|
||||
width: calc(100vw - 450px);
|
||||
height: 100vh;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
.bg-picture-secure-login img{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
}
|
||||
.bg-secure-login{
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
max-width: 450px;
|
||||
height: 100vh;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
align-items: center;
|
||||
padding: 30px;
|
||||
}
|
||||
.bg-secure-login-form > h1{
|
||||
color: #000 !important;
|
||||
font-size: 32px;
|
||||
}
|
||||
.bg-secure-login-form input[type=password], .bg-secure-login-form input[type=text]{
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
font-size: 16px;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
#access_username {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
<script>
|
||||
const passwordInput = document.getElementById('access_passcode');
|
||||
const toggleButton = document.getElementById('togglePassword');
|
||||
const eyeIcon = document.getElementById('eyeIcon');
|
||||
|
||||
.bg-secure-login-form input[type=password]:focus, .bg-secure-login-form input[type=text]:focus{
|
||||
outline: none;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=password]::placeholder, .bg-secure-login-form input[type=text]::placeholder {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=submit]{
|
||||
background-color: #fff !important;
|
||||
padding: 10px 20px !important;
|
||||
margin-top: 25px !important;
|
||||
border: 1px solid #000 !important;
|
||||
color: #000 !important;
|
||||
transition: all 0.3s ease-out !important;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
body{
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=submit]:hover{
|
||||
background-color: #000 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.bg-secure-login-form > p{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.seclog_home_link{
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
top: 30px;
|
||||
right: 30px;
|
||||
}
|
||||
#div_showpw, #access_username {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#togglePassword {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
#togglePassword:hover {
|
||||
transform: translateY(-50%) scale(1.15);
|
||||
}
|
||||
|
||||
#div_showpw{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
input:-webkit-autofill,
|
||||
input:-webkit-autofill:hover,
|
||||
input:-webkit-autofill:focus,
|
||||
input:-webkit-autofill:active {
|
||||
-webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
|
||||
box-shadow: 0 0 0 1000px #ffffff inset !important;
|
||||
-webkit-text-fill-color: #000000 !important;
|
||||
transition: background-color 5000s ease-in-out 0s;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const passwordInput = document.getElementById('access_passcode');
|
||||
const toggleButton = document.getElementById('togglePassword');
|
||||
const eyeIcon = document.getElementById('eyeIcon');
|
||||
|
||||
toggleButton.addEventListener('click', () => {
|
||||
toggleButton.addEventListener('click', () => {
|
||||
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
|
||||
passwordInput.setAttribute('type', type);
|
||||
|
||||
// Swap between eye and eye-with-line
|
||||
if (type === 'password') {
|
||||
// Eye (show)
|
||||
eyeIcon.innerHTML = '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
|
||||
} else {
|
||||
// Eye with slash (hide)
|
||||
eyeIcon.innerHTML = '<path d="M17.94 17.94L6.06 6.06"/><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
require __DIR__ . '/../../composer/vendor/autoload.php';
|
||||
|
||||
$envFile = realpath(__DIR__ . '/../../config/.env.mail');
|
||||
|
||||
if ($envFile === false) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Environment file not found"
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$envDir = dirname($envFile);
|
||||
|
||||
$dotenv = Dotenv::createImmutable($envDir, '.env.mail');
|
||||
|
||||
$dotenv->load();
|
||||
} catch (Throwable $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Dotenv error"
|
||||
]);
|
||||
}
|
||||
|
||||
function newMailer() {
|
||||
global $mailer;
|
||||
|
||||
if (isset($mailer) && $mailer instanceof PHPMailer) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$mailer = new PHPMailer(true);
|
||||
|
||||
$mailer->isSMTP();
|
||||
$mailer->CharSet = 'UTF-8';
|
||||
$mailer->Host = $_ENV['MAIL_SERVER'];
|
||||
$mailer->SMTPAuth = true;
|
||||
$mailer->Username = $_ENV['MAIL_USER'];
|
||||
$mailer->Password = $_ENV['MAIL_USER_PASSWORD'];
|
||||
|
||||
$port = (int)$_ENV['MAIL_PORT'];
|
||||
if ($port === 465) {
|
||||
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
||||
} else {
|
||||
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mailer->Port = 587;
|
||||
}
|
||||
|
||||
$mailer->Port = $port;
|
||||
|
||||
$mailer->setFrom($_ENV['MAIL_USER'], 'WKVS');
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Konfigurationsfehler des Automailers: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function sendMail(string $content = '', string $subject = '', array $recipients = []) {
|
||||
global $mailer;
|
||||
|
||||
if (empty($recipients)) {
|
||||
throw new Exception("Keine Empfänger angegeben");
|
||||
}
|
||||
|
||||
if (!isset($mailer) || !($mailer instanceof PHPMailer)) {
|
||||
try {
|
||||
newMailer();
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
foreach ($recipients as $email => $name) {
|
||||
$mailer->addAddress($email, $name);
|
||||
}
|
||||
|
||||
$mailer->isHTML(true);
|
||||
$mailer->Subject = $subject;
|
||||
$mailer->Body = $content;
|
||||
$mailer->AltBody = strip_tags($content);
|
||||
|
||||
if (!$mailer->send()) {
|
||||
throw new Exception("Sendefehler " . $mailer->ErrorInfo);
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
error_log("Kritischer Sendefehler: " . $e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
use Predis\Client as PredisClient;
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
require __DIR__ . '/../../composer/vendor/autoload.php';
|
||||
|
||||
$envFile = realpath(__DIR__ . '/../../config/.env.redis');
|
||||
|
||||
if ($envFile === false) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Environment file not found"
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$envDir = dirname($envFile);
|
||||
|
||||
$dotenv = Dotenv::createImmutable($envDir, '.env.redis');
|
||||
|
||||
$dotenv->load();
|
||||
} catch (Throwable $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Dotenv error"
|
||||
]);
|
||||
}
|
||||
|
||||
// Create a Redis connection
|
||||
$redis = new PredisClient([
|
||||
'scheme' => 'tcp',
|
||||
'host' => $_ENV['REDDIS_HOST'],
|
||||
'port' => $_ENV['REDDIS_PORT'],
|
||||
'password' => $_ENV['REDDIS_PASSWORD']
|
||||
]);
|
||||
|
||||
/**
|
||||
* Token Bucket Rate Limiter
|
||||
*
|
||||
* A Redis-based token bucket rate limiter implementation using Lua scripts
|
||||
* for atomic operations.
|
||||
*
|
||||
* The token bucket algorithm allows requests at a controlled rate by maintaining
|
||||
* a bucket of tokens that refills over time. Each request consumes a token, and
|
||||
* requests are denied when the bucket is empty.
|
||||
*
|
||||
* Requires: predis/predis
|
||||
*/
|
||||
|
||||
/**
|
||||
* Token bucket rate limiter using Redis for distributed rate limiting.
|
||||
*
|
||||
* The token bucket maintains a fixed capacity of tokens that refill at a
|
||||
* constant rate. Each request consumes one token. When the bucket is empty,
|
||||
* requests are denied until tokens refill.
|
||||
*
|
||||
* Example:
|
||||
* $redis = new Predis\Client(['host' => '127.0.0.1', 'port' => 6379]);
|
||||
* $limiter = new TokenBucket(10, 1, 1.0, $redis);
|
||||
* $result = $limiter->allow('user:123');
|
||||
* if ($result['allowed']) {
|
||||
* echo "Request allowed. {$result['remaining']} tokens remaining.";
|
||||
* } else {
|
||||
* echo "Request denied. Rate limit exceeded.";
|
||||
* }
|
||||
*/
|
||||
class TokenBucket
|
||||
{
|
||||
/** @var string Lua script for atomic token bucket operations */
|
||||
private const LUA_SCRIPT = <<<'LUA'
|
||||
local key = KEYS[1]
|
||||
local capacity = tonumber(ARGV[1])
|
||||
local refill_rate = tonumber(ARGV[2])
|
||||
local refill_interval = tonumber(ARGV[3])
|
||||
local now = tonumber(ARGV[4])
|
||||
|
||||
-- Get current state or initialize
|
||||
local bucket = redis.call('HMGET', key, 'tokens', 'last_refill')
|
||||
local tokens = tonumber(bucket[1])
|
||||
local last_refill = tonumber(bucket[2])
|
||||
|
||||
-- Initialize if this is the first request
|
||||
if tokens == nil then
|
||||
tokens = capacity
|
||||
last_refill = now
|
||||
end
|
||||
|
||||
-- Calculate token refill
|
||||
local time_passed = now - last_refill
|
||||
local refills = math.floor(time_passed / refill_interval)
|
||||
|
||||
if refills > 0 then
|
||||
tokens = math.min(capacity, tokens + (refills * refill_rate))
|
||||
last_refill = last_refill + (refills * refill_interval)
|
||||
end
|
||||
|
||||
-- Try to consume a token
|
||||
local allowed = 0
|
||||
if tokens >= 1 then
|
||||
tokens = tokens - 1
|
||||
allowed = 1
|
||||
end
|
||||
|
||||
-- Update state
|
||||
redis.call('HSET', key, 'tokens', tokens, 'last_refill', last_refill)
|
||||
|
||||
-- Delete the key after one hour
|
||||
redis.call('EXPIRE', key, 3600)
|
||||
|
||||
-- Return result: allowed (1 or 0) and remaining tokens
|
||||
return {allowed, tokens}
|
||||
LUA;
|
||||
|
||||
/** @var PredisClient */
|
||||
private $redis;
|
||||
|
||||
/** @var int */
|
||||
private $capacity;
|
||||
|
||||
/** @var float */
|
||||
private $refillRate;
|
||||
|
||||
/** @var float */
|
||||
private $refillInterval;
|
||||
|
||||
/** @var string */
|
||||
private $scriptSha;
|
||||
|
||||
/** @var bool */
|
||||
private $scriptLoaded = false;
|
||||
|
||||
/**
|
||||
* Initialize the token bucket rate limiter.
|
||||
*
|
||||
* @param int $capacity Maximum number of tokens in the bucket (default: 10)
|
||||
* @param float $refillRate Number of tokens added per refill interval (default: 1.0)
|
||||
* @param float $refillInterval Time in seconds between refills (default: 1.0)
|
||||
* @param PredisClient|null $redis Predis client instance. If null, creates a default client.
|
||||
*/
|
||||
public function __construct(
|
||||
int $capacity = 10,
|
||||
float $refillRate = 1.0,
|
||||
float $refillInterval = 1.0,
|
||||
?PredisClient $redis = null
|
||||
) {
|
||||
$this->capacity = $capacity;
|
||||
$this->refillRate = $refillRate;
|
||||
$this->refillInterval = $refillInterval;
|
||||
$this->redis = $redis ?? new PredisClient([
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
]);
|
||||
$this->scriptSha = sha1(self::LUA_SCRIPT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the Lua script is loaded into Redis.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function ensureScriptLoaded(): void
|
||||
{
|
||||
if (!$this->scriptLoaded) {
|
||||
try {
|
||||
$this->scriptSha = $this->redis->script('LOAD', self::LUA_SCRIPT);
|
||||
$this->scriptLoaded = true;
|
||||
} catch (\Exception $e) {
|
||||
// If loading fails, we'll fall back to EVAL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a request should be allowed for the given key.
|
||||
*
|
||||
* @param string $key The rate limit key (e.g., 'user:123', 'api:endpoint:xyz')
|
||||
*
|
||||
* @return array{allowed: bool, remaining: float} An associative array with:
|
||||
* - 'allowed': true if the request is allowed, false otherwise
|
||||
* - 'remaining': number of tokens remaining in the bucket
|
||||
*
|
||||
* Example:
|
||||
* $result = $limiter->allow('user:123');
|
||||
* echo "Allowed: " . ($result['allowed'] ? 'yes' : 'no');
|
||||
* echo "Remaining: {$result['remaining']}";
|
||||
*/
|
||||
public function allow(string $key): array
|
||||
{
|
||||
$this->ensureScriptLoaded();
|
||||
|
||||
$now = microtime(true);
|
||||
$args = [
|
||||
$this->capacity,
|
||||
$this->refillRate,
|
||||
$this->refillInterval,
|
||||
$now,
|
||||
];
|
||||
|
||||
try {
|
||||
// Try EVALSHA first (faster if script is cached)
|
||||
$result = $this->redis->evalsha($this->scriptSha, 1, $key, ...$args);
|
||||
} catch (\Exception $e) {
|
||||
// Script not in cache, use EVAL and reload
|
||||
$result = $this->redis->eval(self::LUA_SCRIPT, 1, $key, ...$args);
|
||||
$this->scriptLoaded = false;
|
||||
}
|
||||
|
||||
return [
|
||||
'allowed' => (bool) $result[0],
|
||||
'remaining' => (float) $result[1],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,24 +48,43 @@ function verify_csrf() {
|
||||
die("Access Denied: Invalid CSRF Token.");
|
||||
}
|
||||
} else {
|
||||
http_response_code(405);
|
||||
die("Access Denied: Invalid Request Type.");
|
||||
}
|
||||
}
|
||||
|
||||
function verify_delete_csrf($_DELETE) {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
|
||||
$token = $_DELETE['csrf_token'] ?? '';
|
||||
if (!hash_equals($_SESSION['csrf_token'], $token)) {
|
||||
http_response_code(403);
|
||||
die("Access Denied: Invalid CSRF Token.");
|
||||
}
|
||||
} else {
|
||||
http_response_code(405);
|
||||
die("Access Denied: Invalid Request Type.");
|
||||
}
|
||||
}
|
||||
|
||||
$allowedUserTypes = ['trainer', 'kampfrichter', 'wk_leitung'];
|
||||
|
||||
function check_user_permission(string $type, bool $return = false) {
|
||||
function check_user_permission(string $type, bool $return = false, bool $display = false) {
|
||||
global $allowedUserTypes;
|
||||
|
||||
if (!in_array($type, $allowedUserTypes, true)) {
|
||||
if ($return) {
|
||||
return false;
|
||||
} else {
|
||||
if ($display) {
|
||||
http_response_code(403);
|
||||
include __DIR__ . "/../www/error-pages/403.html";
|
||||
exit;
|
||||
} else {
|
||||
http_response_code(403);
|
||||
die("Invalid User Type Configuration");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$accessKey = "access_granted_{$type}";
|
||||
$idKey = "user_id_{$type}";
|
||||
@@ -76,11 +95,17 @@ function check_user_permission(string $type, bool $return = false) {
|
||||
if (!$hasAccess || !$hasValidId) {
|
||||
if ($return) {
|
||||
return false;
|
||||
} else {
|
||||
if ($display) {
|
||||
http_response_code(403);
|
||||
include __DIR__ . "/../www/error-pages/403.html";
|
||||
exit;
|
||||
} else {
|
||||
http_response_code(403);
|
||||
die("Access Denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($return) {
|
||||
return true;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Include this file after <body> on any intern page.
|
||||
* Set $currentPage before including, e.g.:
|
||||
* $currentPage = 'trainer';
|
||||
* require $baseDir . '/intern/scripts/sidebar/sidebar.php';
|
||||
* require $baseDir . '/../scripts/sidebar/sidebar.php';
|
||||
*/
|
||||
|
||||
$isWKL = $_SESSION['access_granted_wk_leitung'] ?? false;
|
||||
@@ -33,6 +33,7 @@ $icons = [
|
||||
'logindata' => '<svg viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',
|
||||
'displaycontrol' => '<svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>',
|
||||
'kalender' => '<svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>',
|
||||
'rankLive' => '<svg viewBox="0 0 24 24"><path d="M12 4h6a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6"/><line x1="9" y1="9" x2="15" y2="9"/><line x1="9" y1="13" x2="15" y2="13"/><line x1="9" y1="17" x2="15" y2="17"/></svg>',
|
||||
'riegeneinteilung' => '<svg viewBox="0 0 24 24"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><rect x="8" y="2" width="8" height="4" rx="1" ry="1"/><line x1="9" y1="12" x2="15" y2="12"/><line x1="9" y1="16" x2="15" y2="16"/></svg>',
|
||||
'einstellungen' => '<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>',
|
||||
];
|
||||
@@ -82,6 +83,7 @@ if ($isWKL) {
|
||||
$links[] = ['key' => 'logindata', 'label' => 'Benutzerverwaltung', 'url' => '/intern/wk-leitung/logindata', 'freigaben' => false];
|
||||
$links[] = ['key' => 'displaycontrol', 'label' => 'Displaycontrol', 'url' => '/intern/wk-leitung/displaycontrol', 'freigaben' => false];
|
||||
//$links[] = ['key' => 'kalender', 'label' => 'Kalender', 'url' => '/intern/wk-leitung/kalender'];
|
||||
$links[] = ['key' => 'rankLive', 'label' => 'Rank Live', 'url' => '/intern/wk-leitung/rank-live', 'freigaben' => false];
|
||||
$links[] = ['key' => 'riegeneinteilung', 'label' => 'Riegeneinteilung', 'url' => '/intern/wk-leitung/riegeneinteilung', 'freigaben' => false];
|
||||
$links[] = ['key' => 'einstellungen', 'label' => 'Einstellungen', 'url' => '/intern/wk-leitung/einstellungen', 'freigaben' => false];
|
||||
}
|
||||
@@ -91,8 +93,10 @@ function checkIfUserHasSessionId($type) : bool {
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
// if (!isset($indexedNotenNames)) { $indexedNotenNames = []; }
|
||||
|
||||
function sidebarRender(string $mode) {
|
||||
global $isWKL, $isTrainer, $isKampfrichter, $links, $currentPage, $icons, $renderMenu, $username, $freigabenSidebar;
|
||||
global $isWKL, $isTrainer, $isKampfrichter, $links, $currentPage, $icons, $renderMenu, $username, $freigabenSidebar, $indexedArrayGeraete;
|
||||
|
||||
if (!$renderMenu) { return; }
|
||||
|
||||
@@ -144,20 +148,22 @@ function sidebarRender(string $mode) {
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($isCurrentPage && $link['freigaben'] === true && isset($freigabenSidebar[$freigbenArrayName]) && count($freigabenSidebar[$freigbenArrayName]) > 1) : ?>
|
||||
<?php $selectedFreigabe = $_SESSION['selectedFreigabe' . ucfirst($link['key'])] ?? ''; ?>
|
||||
<?php $selectedFreigabe = ($currentPage === 'kampfrichter') ? $_SESSION['selectedFreigabeIdKampfrichter'] : $_SESSION['selectedFreigabe' . ucfirst($link['key'])] ?? ''; ?>
|
||||
<li class="sidebar-li-freigaben">
|
||||
<label class="sidebar-freigaben-label" for="selectTriggerFreigabe">Freigabe</label>
|
||||
<div class="customSelect" id="selectedOption" data-value="[]">
|
||||
<button type="button" id="selectTriggerFreigabe" class="selectTrigger" aria-expanded="false">
|
||||
<span class="selectLabel"><?= $selectedFreigabe ?></span>
|
||||
<button type="button" id="selectTriggerFreigabe" class="selectTriggerSidebar" aria-expanded="false">
|
||||
<span class="selectLabel">
|
||||
<?= htmlspecialchars(($currentPage === 'kampfrichter') ? (($selectedFreigabe !== 'A') ? $indexedArrayGeraete[$selectedFreigabe] ?? $selectedFreigabe : 'Admin') : $selectedFreigabe) ?>
|
||||
</span>
|
||||
<svg class="selectArrow" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' height="14" width="14">
|
||||
<path d='M6 9L12 15L18 9' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul class="selectOptions">
|
||||
<ul class="selectOptionsSidebar">
|
||||
<?php foreach ($freigabenSidebar[$freigbenArrayName] as $f) :?>
|
||||
<?php $selected = ($f === $selectedFreigabe) ? 'selected' : '' ?>
|
||||
<li data-value="<?= htmlspecialchars($f) ?>" class="<?= $selected ?>"><?= htmlspecialchars($f) ?></li>
|
||||
<li data-value="<?= htmlspecialchars($f) ?>" class="<?= $selected ?>"><?= htmlspecialchars(($currentPage === 'kampfrichter') ? (($f !== 'A') ? $indexedArrayGeraete[$f] ?? $f : 'Admin') : $f) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<input type="hidden" name="type" class="selectValue" id="freigabenSidebarSelect" value="">
|
||||
@@ -33,10 +33,20 @@ class NotenRechner {
|
||||
|
||||
private function santinzeString(string $string) : string
|
||||
{
|
||||
$replacePattern = '/[^a-zA-Z0-9(){}+*\/.\-\[\]]/';
|
||||
$replacePatterns = [
|
||||
'/->R\w+/', // 1. Removes ->R followed by digits
|
||||
'/[^a-zA-Z0-9(){}+*\/.[\]\-]/' // 2. Fixed syntax: Allowed characters list
|
||||
];
|
||||
return preg_replace($replacePatterns,'', $string);
|
||||
}
|
||||
|
||||
private function sanitizeStringWithRun(string $string) : string
|
||||
{
|
||||
$replacePattern = '/[^a-zA-Z0-9(){}+*\/.\-\[\]>]/';
|
||||
return preg_replace($replacePattern, "", $string);
|
||||
}
|
||||
|
||||
|
||||
public function getBenoetigteIds(string $schemaRaw)
|
||||
{
|
||||
$schema = $this->santinzeString($schemaRaw);
|
||||
@@ -78,29 +88,67 @@ class NotenRechner {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function insertValues(string $schemaRaw, array $valuesArray = [])
|
||||
public function getBenoetigteIdsComplexWithRun(string $schemaRaw)
|
||||
{
|
||||
$schema = $this->santinzeString($schemaRaw);
|
||||
$schema = $this->sanitizeStringWithRun($schemaRaw);
|
||||
$indexedMatches = [];
|
||||
|
||||
$idsNeeded = $this->getBenoetigteIds($schemaRaw);
|
||||
$missingIds = array_diff($idsNeeded, array_keys($valuesArray));
|
||||
// Pattern breakdown:
|
||||
// \{(\d+) -> Match { and capture the first number (Note ID)
|
||||
// (?:\[(\w*)\])? -> OPTIONALLY match [ and capture alphanumeric content inside (Apparatus ID)
|
||||
// (?:\[(\d+)\])? -> OPTIONALLY match [ and capture number inside (Run Number)
|
||||
// \} -> Match the closing }
|
||||
if (preg_match_all('/\{(\d+)(?:\[(\w*)\])?(?:\[(\d+)\])?\}/', $schema, $matches, PREG_SET_ORDER)) {
|
||||
|
||||
if (!empty($missingIds)) {
|
||||
return ['success' => false, 'value' => 'Fehlende IDs'];
|
||||
}
|
||||
foreach ($matches as $match) {
|
||||
$noteId = $match[1];
|
||||
|
||||
try {
|
||||
$returnStr = preg_replace_callback('/\{(\d+)\}/', function($m) use ($valuesArray) {
|
||||
return $valuesArray[$m[1]];
|
||||
}, $schema);
|
||||
return ['success' => true, 'value' => $returnStr];
|
||||
} catch (\Exception $e) {
|
||||
return ['success' => false, 'value' => 'Problem beim Einsetzen der Werte'];
|
||||
$rawGeraet = $match[2] ?? 'S';
|
||||
$geraetId = ($rawGeraet === 'S' || $rawGeraet === '') ? 'A' : $rawGeraet;
|
||||
|
||||
$runNumber = isset($match[3]) ? (int)$match[3] : 1;
|
||||
|
||||
$indexedMatches[] = [
|
||||
'noteId' => $noteId,
|
||||
'geraetId' => $geraetId,
|
||||
'run' => $runNumber
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private function insertValuesComplex(string $schemaRaw, array $valuesArray, int $currentId, int $runNumber)
|
||||
$arrayRes = $this->getStoreGeraetRun($schemaRaw);
|
||||
|
||||
$indexedMatches['targetRun'] = $arrayRes['run_num'] ?? 'A';
|
||||
$indexedMatches['targetGeraet'] = $arrayRes['geraet_id'] ?? 'A';
|
||||
|
||||
return $indexedMatches;
|
||||
|
||||
}
|
||||
|
||||
public function getStoreGeraetRun(string $schemaRaw): array
|
||||
{
|
||||
$schema = $this->sanitizeStringWithRun($schemaRaw);
|
||||
|
||||
$pattern = '/->R(?<run_num>\d+|S)(?:G(?<geraet_id>\d+|S))?/';
|
||||
|
||||
if (preg_match($pattern, $schema, $matchesTagetRun)) {
|
||||
|
||||
$run = $matchesTagetRun['run_num'] ?? 'S';
|
||||
$geraet = $matchesTagetRun['geraet_id'] ?? 'S';
|
||||
|
||||
return [
|
||||
'run_num' => $run === 'S' ? 'A' : (int)$run,
|
||||
'geraet_id' => $geraet === 'S' ? 'A' : (int)$geraet,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'run_num' => 'A',
|
||||
'geraet_id' => 'A'
|
||||
];
|
||||
}
|
||||
|
||||
private function insertValuesComplex(string $schemaRaw, array $valuesArray, int $currentId, int $runNumber, bool $avr = false)
|
||||
{
|
||||
$schema = $this->santinzeString($schemaRaw);
|
||||
$idsNeededArray = $this->getBenoetigteIdsComplex($schemaRaw);
|
||||
@@ -110,21 +158,25 @@ class NotenRechner {
|
||||
$noteId = $sina['noteId'];
|
||||
$geraetIdSearch = ($sina['geraetId'] === 'A') ? $currentId : $sina['geraetId'];
|
||||
|
||||
if (!isset($valuesArray[$geraetIdSearch][$noteId][$runNumber])) {
|
||||
if (!isset($valuesArray[$geraetIdSearch][$noteId][$runNumber]["value"])) {
|
||||
return ['success' => false, 'value' => "Fehlende Daten für Gerät $geraetIdSearch, Note $noteId, Lauf $runNumber"];
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$returnStr = preg_replace_callback('/\{(\d+)(?:\[(\w*)\])?(?:\[(\d+)\])?\}/', function($m) use ($valuesArray, $currentId, $runNumber) {
|
||||
$returnStr = preg_replace_callback('/\{(\d+)(?:\[(\w*)\])?(?:\[(\d+)\])?\}/', function($m) use ($valuesArray, $currentId, $runNumber, $avr) {
|
||||
$noteId = $m[1];
|
||||
|
||||
// Get value inside brackets, default to 'S' if none exists
|
||||
$rawGeraet = $m[2] ?? 'S';
|
||||
$geraetId = ($rawGeraet === 'S' || $rawGeraet === '') ? $currentId : $rawGeraet;
|
||||
|
||||
if ($avr && $valuesArray[$geraetId][$noteId][$runNumber]["type"] === 'default_value') {
|
||||
return 'default_value_skip';
|
||||
} else {
|
||||
// Return value from [Device][Note][Run]
|
||||
return $valuesArray[$geraetId][$noteId][$runNumber] ?? 0;
|
||||
return $valuesArray[$geraetId][$noteId][$runNumber]["value"] ?? 0;
|
||||
}
|
||||
|
||||
}, $schema);
|
||||
|
||||
@@ -144,27 +196,15 @@ class NotenRechner {
|
||||
$result = $this->rechner->calculate($rechnung);
|
||||
return ['success' => true, 'value' => floatval($result)];
|
||||
} catch (\ChrisKonnertz\StringCalc\Exceptions\StringCalcException $e) {
|
||||
return ['success' => false, 'value' => 'Problem bei der Berechnung: Ungültige Syntax'];
|
||||
return ['success' => false, 'value' => 'Problem bei der Berechnung: Ungültige Syntax '. $rechnung];
|
||||
} catch (\Exception $e) {
|
||||
return ['success' => false, 'value' => 'Problem bei der Berechnung'];
|
||||
}
|
||||
}
|
||||
|
||||
public function berechneString(string $schemaRaw, array $valuesArray = []) {
|
||||
public function berechneStringComplex(string $schemaRaw, array $valuesArray = [], int $geraetId = -1, int $run_number = 0) {
|
||||
if ($schemaRaw === '') { return ['success' => false, 'value' => 'Leeres Schema']; }
|
||||
|
||||
$rechnungArray = $this->insertValues($schemaRaw, $valuesArray);
|
||||
|
||||
if (!isset($rechnungArray['success']) || !isset($rechnungArray['value']) || !$rechnungArray['success']) {
|
||||
return ['success' => false, 'value' => $rechnungArray['value'] ?? 'Fehler beim Einsetzen der Werte oder Werte fehlen'];
|
||||
}
|
||||
|
||||
return $this->calculate($rechnungArray['value']);
|
||||
}
|
||||
|
||||
public function berechneStringComplex(string $schemaRaw, array $valuesArray = [], int $geraetId = 0, int $run_number = 0) {
|
||||
if ($schemaRaw === '') { return ['success' => false, 'value' => 'Leeres Schema']; }
|
||||
if ($geraetId === 0) { return ['success' => false, 'value' => 'Keine Geraet Id angegeben.']; }
|
||||
if ($geraetId < 0) { return ['success' => false, 'value' => 'Keine Geraet Id angegeben.']; }
|
||||
if ($run_number === 0) { return ['success' => false, 'value' => 'Keine Run_Number angegeben.']; }
|
||||
|
||||
$rechnungArray = $this->insertValuesComplex($schemaRaw, $valuesArray, $geraetId, $run_number);
|
||||
@@ -176,9 +216,9 @@ class NotenRechner {
|
||||
return $this->calculate($rechnungArray['value']);
|
||||
}
|
||||
|
||||
public function berechneStringComplexRun(string $schemaRaw, array $valuesArray = [], int $geraetId = 0, int $programm = 0, array $arrayRuns = []) {
|
||||
public function berechneStringComplexRun(string $schemaRaw, array $valuesArray = [], int $geraetId = -1, int $programm = 0, array $arrayRuns = []) {
|
||||
if ($schemaRaw === '') { return ['success' => false, 'value' => 'Leeres Schema']; }
|
||||
if ($geraetId === 0) { return ['success' => false, 'value' => 'Keine Geraet Id angegeben.']; }
|
||||
if ($geraetId < 0) { return ['success' => false, 'value' => 'Keine Geraet Id angegeben.']; }
|
||||
if ($programm === 0) { return ['success' => false, 'value' => 'Kein Programm angegeben.']; }
|
||||
if ($arrayRuns === []) { return ['success' => false, 'value' => 'Leeres Array Runs Noten.']; }
|
||||
|
||||
@@ -213,9 +253,7 @@ class NotenRechner {
|
||||
|
||||
foreach ($ids as $sid) {
|
||||
$geraetId = ($sid['geraetId'] === 'A') ? $currentId : $sid['geraetId'];
|
||||
$runCountN = $arrayRuns[$sid['noteId']][$geraetId][$programm] ?? $arrayRuns["default"] ?? 1;
|
||||
|
||||
//var_dump($arrayRuns[$sid['noteId']][$geraetId][$programm]);
|
||||
$runCountN = $arrayRuns[$sid['noteId']][$geraetId][$programm] ?? $arrayRuns[$sid['noteId']][$geraetId]["all"] ?? $arrayRuns["default"] ?? 1;
|
||||
|
||||
if ($runCount !== $runCountN && $runCount !== 0) { return; }
|
||||
$runCount = $runCountN;
|
||||
@@ -225,21 +263,26 @@ class NotenRechner {
|
||||
switch ($name) {
|
||||
case "AVGR":
|
||||
case "SUMR":
|
||||
$nulls = 0;
|
||||
|
||||
for ($r = 1; $r <= $runCount; $r++) {
|
||||
|
||||
$res = $this->insertValuesComplex($content, $valuesArray, $currentId, $r);
|
||||
$res = $this->insertValuesComplex($content, $valuesArray, $currentId, $r, true);
|
||||
|
||||
// FIXED: Only bail if success is false
|
||||
if (!$res['success']) {
|
||||
return "0"; // Or handle error as needed
|
||||
}
|
||||
return "0";
|
||||
} elseif ($res['value'] === 'default_value_skip') {
|
||||
$nulls++;
|
||||
} else {
|
||||
$parts[] = "(" . $res['value'] . ")";
|
||||
}
|
||||
}
|
||||
|
||||
$innerMath = implode(" + ", $parts);
|
||||
$string = ($name === "AVGR") ? "(($innerMath) / $runCount)" : "($innerMath)";
|
||||
$div_count = $runCount - $nulls;
|
||||
if ($div_count === 0 || count($parts) < 1) return "0";
|
||||
$string = ($name === "AVGR") ? "(($innerMath) / $div_count)" : "($innerMath)";
|
||||
|
||||
//var_dump($string);
|
||||
break;
|
||||
|
||||
case "MAXR":
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
<?php
|
||||
|
||||
require $baseDir . '/../composer/vendor/autoload.php';
|
||||
|
||||
use Shuchkin\SimpleXLSX;
|
||||
|
||||
if (isset($_POST['apply_bulk_action']) ) {
|
||||
if (isset($_POST['apply_bulk_action'])) {
|
||||
verify_csrf();
|
||||
if ( empty($_POST['turnerin_ids']) || !is_array($_POST['turnerin_ids']) ) {
|
||||
$_SESSION['form_message'] = 'Keine Turnerinnen für die Aktion ausgewählt.';
|
||||
if (empty($_POST['turnerin_ids']) || !is_array($_POST['turnerin_ids'])) {
|
||||
$_SESSION['form_message'] = 'Keine ' . $personMehrzahl . ' für die Aktion ausgewählt.';
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
} elseif (!isset($_POST['bulk_action_programm']) && !isset($_POST['bulk_action_bezahlt'])) {
|
||||
$_SESSION['form_message'] = 'Kein Programm für die Massenänderung ausgewählt.';
|
||||
@@ -36,7 +32,7 @@ if (isset($_POST['apply_bulk_action']) ) {
|
||||
|
||||
if (in_array($bezahlt_update, ['0', '3', '4', '5'], true)) {
|
||||
$set_clauses[] = 'bezahltoverride = ?';
|
||||
$params[] = (int)$bezahlt_update;
|
||||
$params[] = (int) $bezahlt_update;
|
||||
$types .= 'i';
|
||||
}
|
||||
|
||||
@@ -53,7 +49,7 @@ if (isset($_POST['apply_bulk_action']) ) {
|
||||
|
||||
/* WHERE id IN (?, ?, ...) */
|
||||
$placeholders = implode(',', array_fill(0, count($ids_to_update), '?'));
|
||||
$sql = "UPDATE $tableTurnerinnen SET " . implode(', ', $set_clauses) . " WHERE id IN ($placeholders)";
|
||||
$sql = "UPDATE $tableTeilnehmende SET " . implode(', ', $set_clauses) . " WHERE id IN ($placeholders)";
|
||||
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
|
||||
@@ -93,7 +89,7 @@ if (isset($_POST['delete_id'])) {
|
||||
verify_csrf();
|
||||
$delete_id = intval($_POST['delete_id']);
|
||||
|
||||
$stmt = $mysqli->prepare("DELETE FROM $tableTurnerinnen where id = ?");
|
||||
$stmt = $mysqli->prepare("DELETE FROM $tableTeilnehmendee where id = ?");
|
||||
|
||||
$stmt->bind_param('i', $delete_id);
|
||||
|
||||
@@ -105,203 +101,72 @@ if (isset($_POST['delete_id'])) {
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
}
|
||||
|
||||
header("Location: ". $_SERVER['REQUEST_URI']);
|
||||
header("Location: " . $_SERVER['REQUEST_URI']);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['xlsx_file'])) {
|
||||
verify_csrf();
|
||||
|
||||
if ($_FILES['xlsx_file']['error'] === UPLOAD_ERR_OK) {
|
||||
|
||||
$tmpName = $_FILES['xlsx_file']['tmp_name'];
|
||||
|
||||
if (class_exists('Shuchkin\\SimpleXLSX') && $xlsx = SimpleXLSX::parse($tmpName)) {
|
||||
|
||||
$rows = $xlsx->rows();
|
||||
|
||||
$vereine_rows = db_select($mysqli, $tableVereine, 'verein', '', [], 'verein ASC');
|
||||
$vereine = array_column($vereine_rows, 'verein');
|
||||
|
||||
if (count($rows) < 2) {
|
||||
$excelMessage = '❌ Excel must have headers and at least one data row.';
|
||||
} else {
|
||||
$headers = array_map('trim', $rows[0]);
|
||||
unset($rows[0]);
|
||||
|
||||
$columnMap = [
|
||||
'Nachname' => 'name',
|
||||
'Vorname' => 'vorname',
|
||||
'Geburtsdatum' => 'geburtsdatum',
|
||||
'Programm' => 'programm'
|
||||
];
|
||||
|
||||
|
||||
if ($selectedverein === 'admin') {
|
||||
$columnMap['Verein'] = 'verein';
|
||||
}
|
||||
|
||||
|
||||
$columnIndexes = [];
|
||||
foreach ($columnMap as $excelHeader => $dbColumn) {
|
||||
$index = array_search($excelHeader, $headers);
|
||||
if ($index === false) {
|
||||
$excelMessage = "❌ Column '$excelHeader' not found in Excel.";
|
||||
break;
|
||||
}
|
||||
$columnIndexes[$dbColumn] = $index;
|
||||
}
|
||||
|
||||
if (empty($excelMessage)) {
|
||||
$inserted = 0;
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if (!array_filter($row)) continue;
|
||||
|
||||
$data = [];
|
||||
foreach ($columnIndexes as $dbCol => $i) {
|
||||
$data[$dbCol] = isset($row[$i]) ? trim($row[$i]) : null;
|
||||
}
|
||||
|
||||
if ($selectedverein !== 'admin'){
|
||||
$data['verein'] = $selectedverein;
|
||||
} else {
|
||||
|
||||
if (!in_array($data['verein'], $vereine, true)) {
|
||||
$excelMessage = "❌ admin: {$data['verein']} not valid";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$raw = trim($data['geburtsdatum']);
|
||||
|
||||
// Try DD.MM.YYYY first
|
||||
$temp = DateTime::createFromFormat('d.m.Y', $raw);
|
||||
|
||||
if ($temp && $temp->format('d.m.Y') === $raw) {
|
||||
$data['geburtsdatum'] = $temp->format('Y-m-d');
|
||||
} else {
|
||||
// Fallback: if it's already YYYY-MM-DD or YYYY-MM-DD HH:MM:SS
|
||||
$data['geburtsdatum'] = substr($raw, 0, 10); // take first 10 chars
|
||||
}
|
||||
|
||||
|
||||
if (!(in_array($data['programm'], $programmes)) && is_array($programmes)){
|
||||
$_SESSION['form_message'] = "❌ Programm '{$data['programm']}' nicht valide bei Turnerin ".$data['name']." ".$data['vorname'].". Alle Turnereinnen nach ".$data['name']." ".$data['vorname']." wurden nicht geladen.";
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
header('Location: '. $_SERVER['REQUEST_URI']); // Redirect to same page
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($tableTurnerinnen)) {
|
||||
$columns = array_keys($data);
|
||||
|
||||
$set = implode(
|
||||
', ',
|
||||
array_map(fn($col) => "$col = ?", $columns)
|
||||
);
|
||||
|
||||
$sql = "INSERT INTO $tableTurnerinnen SET $set";
|
||||
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
|
||||
$types = str_repeat('s', count($data));
|
||||
$values = array_values($data);
|
||||
|
||||
$stmt->bind_param($types, ...$values);
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
echo 'DB error: ' . $stmt->error;
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
|
||||
$inserted++;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['form_message'] = "✅ Erfolgreich $inserted Turnerinnen via Excel geladen.";
|
||||
$_SESSION['form_message_type'] = 1;
|
||||
header("Location: ". $_SERVER['REQUEST_URI']); // Redirect to same page
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$parseError = SimpleXLSX::parseError();
|
||||
$excelMessage = '❌ Failed to parse Excel file: ' . $parseError;
|
||||
}
|
||||
|
||||
} else {
|
||||
$excelMessage = '❌ File upload error.';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$edit_row = null;
|
||||
if ($access_granted_trainer && isset($_GET['edit_id']) && is_numeric($_GET['edit_id']) && !isset($_POST['submit_turnerinnen_form'])) {
|
||||
$edit_id = intval($_GET['edit_id']);
|
||||
$edit_rows = db_select($mysqli, $tableTurnerinnen, "*", 'id = ?', [$edit_id]);
|
||||
if (!isset($edit_rows) || !is_array($edit_rows) || count($edit_rows) !== 1){http_response_code(422); exit;}
|
||||
$edit_rows = db_select($mysqli, $tableTeilnehmende, "*", 'id = ?', [$edit_id]);
|
||||
if (!isset($edit_rows) || !is_array($edit_rows) || count($edit_rows) !== 1) {
|
||||
http_response_code(422);
|
||||
exit;
|
||||
}
|
||||
$edit_row = $edit_rows[0];
|
||||
if ($edit_row && ($edit_row['verein'] === $selectedverein || $selectedverein === 'admin')) {
|
||||
if ($edit_row && ($edit_row['verein'] === $selectedverein || $isAdmin)) {
|
||||
$_POST['nachname'] = $edit_row['name'] ?? '';
|
||||
$_POST['vorname'] = $edit_row['vorname'] ?? '';
|
||||
$_POST['geburtsdatum'] = $edit_row['geburtsdatum'] ?? '';
|
||||
$_POST['programm'] = $edit_row['programm'] ?? '';
|
||||
$_POST['edit_id'] = $edit_id;
|
||||
if ($selectedverein === 'admin'){
|
||||
if ($isAdmin) {
|
||||
$_POST['verein'] = $edit_row['verein'] ?? '';
|
||||
if (intval($edit_row['bezahltoverride']) !== 0) {
|
||||
$_POST['bezahltoverride'] = $edit_row['bezahltoverride'] ?? '';
|
||||
} else {
|
||||
$_POST['bezahltoverride'] = $edit_row['bezahlt'] ?? '';
|
||||
}
|
||||
$_POST['bezahltOverride'] = $edit_row['bezahltoverride'] ?? 0;
|
||||
}
|
||||
} else {
|
||||
$_SESSION['form_message'] = 'Ungültiger Eintrag zum Bearbeiten.';
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
header('Location: '. $_SERVER['REQUEST_URI']);
|
||||
header('Location: ' . $_SERVER['REQUEST_URI']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// === INSERT/UPDATE Handler ===
|
||||
if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
// Check nonce
|
||||
if ($access_granted_trainer && isset($_POST['submit_turnerinnen_form'])) {
|
||||
|
||||
verify_csrf();
|
||||
$name = htmlspecialchars( $_POST['nachname'] );
|
||||
$vorname = htmlspecialchars( $_POST['vorname'] );
|
||||
$geburtsdatum = trim($_POST['geburtsdatum'] );
|
||||
$programm = htmlspecialchars( $_POST['programm'] );
|
||||
if ($selectedverein !== 'admin'){
|
||||
|
||||
$name = htmlspecialchars($_POST['nachname']);
|
||||
$vorname = htmlspecialchars($_POST['vorname']);
|
||||
$geburtsdatum = trim($_POST['geburtsdatum']);
|
||||
$programm = htmlspecialchars($_POST['programm']);
|
||||
|
||||
if (!$isAdmin) {
|
||||
$verein = $selectedverein;
|
||||
} else {$verein = htmlspecialchars( $_POST['verein'] ); $bezahlt = htmlspecialchars( $_POST['bezahlt'] ); }
|
||||
if ( empty($name) || empty($vorname) || empty($geburtsdatum) || empty($programm)) {
|
||||
} else {
|
||||
$verein = htmlspecialchars($_POST['verein']);
|
||||
$bezahlt = intval($_POST['bezahltOverride']);
|
||||
}
|
||||
|
||||
if (empty($name) || empty($vorname) || empty($geburtsdatum) || empty($programm)) {
|
||||
$_SESSION['form_message'] = 'Bitte füllen Sie alle erforderlichen Felder aus.';
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
} else {
|
||||
|
||||
$data_to_insert = [];
|
||||
|
||||
$data_to_insert = array(
|
||||
$data_to_insert = [
|
||||
'name' => $name,
|
||||
'vorname' => $vorname,
|
||||
'geburtsdatum' => $geburtsdatum,
|
||||
'programm' => $programm,
|
||||
'verein' => $verein,
|
||||
);
|
||||
];
|
||||
|
||||
|
||||
$data_formats = array('%s', '%s', '%s', '%s', '%s');
|
||||
|
||||
if ($selectedverein === 'admin') {
|
||||
if ($isAdmin) {
|
||||
$data_to_insert['bezahltoverride'] = $bezahlt;
|
||||
$data_formats[] = '%d';
|
||||
}
|
||||
|
||||
print_r($data_to_insert);
|
||||
|
||||
|
||||
// Check if we are editing an existing entry
|
||||
$is_editing = isset($_POST['edit_id']) && is_numeric($_POST['edit_id']) && $_POST['edit_id'] > 0;
|
||||
@@ -309,7 +174,7 @@ if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
if ($is_editing) {
|
||||
$edit_id = intval($_POST['edit_id']);
|
||||
|
||||
$entries = db_select($mysqli, $tableTurnerinnen, '*', 'id = ?', [$edit_id], 'rang ASC');
|
||||
$entries = db_select($mysqli, $tableTeilnehmende, '*', 'id = ?', [$edit_id], 'rang ASC');
|
||||
|
||||
$entry = $entries[0]; // since you're fetching by ID, this should return exactly one row
|
||||
|
||||
@@ -320,7 +185,7 @@ if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
array_map(fn($col) => "$col = ?", $columns)
|
||||
);
|
||||
|
||||
$sql = "UPDATE $tableTurnerinnen SET $set WHERE id = ?";
|
||||
$sql = "UPDATE $tableTeilnehmende SET $set WHERE id = ?";
|
||||
|
||||
var_dump($sql);
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
@@ -337,13 +202,13 @@ if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
|
||||
if ($updated === false) {
|
||||
error_log('DB Update Error: ' . $wpdb->last_error);
|
||||
$_SESSION['form_message'] = 'Fehler beim Aktualisieren des Eintrags.';
|
||||
$_SESSION['form_message'] = 'Fehler beim Aktualisieren der Personendaten.';
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
} else if ($updated === 0) {
|
||||
$_SESSION['form_message'] = 'Keine Änderungen vorgenommen.';
|
||||
$_SESSION['form_message_type'] = 0;
|
||||
} else {
|
||||
$_SESSION['form_message'] = 'Eintrag erfolgreich aktualisiert!';
|
||||
$_SESSION['form_message'] = $personEinzahl . ' erfolgreich aktualisiert!';
|
||||
$_SESSION['form_message_type'] = 1;
|
||||
$_POST = [];
|
||||
header('Location: ' . strtok($_SERVER['REQUEST_URI'], '?'));
|
||||
@@ -358,7 +223,7 @@ if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
array_map(fn($col) => "$col = ?", $columns)
|
||||
);
|
||||
|
||||
$sql = "INSERT INTO $tableTurnerinnen SET $set";
|
||||
$sql = "INSERT INTO $tableTeilnehmende SET $set";
|
||||
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
|
||||
@@ -372,7 +237,7 @@ if ( $access_granted_trainer && isset($_POST['submit_turnerinnen_form']) ) {
|
||||
$stmt->close();
|
||||
|
||||
|
||||
if ( $inserted ) {
|
||||
if ($inserted) {
|
||||
$_SESSION['form_message'] = 'Daten erfolgreich gespeichert!';
|
||||
$_SESSION['form_message_type'] = 1;
|
||||
header('Location: ' . strtok($_SERVER['REQUEST_URI'], '?'));
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) session_start();
|
||||
|
||||
if (!isset($baseDir)) {
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
}
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session();
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
$wsPermissions = [
|
||||
'displaycontrol' => ['access_granted_wk_leitung'],
|
||||
@@ -11,16 +20,13 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once __DIR__ . '/../redis/connect-to-redis.php';
|
||||
|
||||
$redisSaveTime = 100;
|
||||
$redis = null;
|
||||
|
||||
connectToRedis();
|
||||
|
||||
function checkWSTokenPermissions($RPerm) {
|
||||
switch ($RPerm) {
|
||||
case 'displaycontrol':
|
||||
return $_SESSION['access_granted_wk_leitung'] ?? false;
|
||||
case 'einstellungen':
|
||||
case 'wk_leitung':
|
||||
return $_SESSION['access_granted_wk_leitung'] ?? false;
|
||||
case 'kampfrichter';
|
||||
return $_SESSION['access_granted_kampfrichter'] ?? false;
|
||||
@@ -29,22 +35,56 @@ function checkWSTokenPermissions($RPerm) {
|
||||
}
|
||||
}
|
||||
|
||||
function generateWSToken($wsRequestedPermission) {
|
||||
$envFile = realpath(__DIR__ . '/../../config/.env.wk-id');
|
||||
|
||||
global $redis;
|
||||
if ($envFile === false) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Environment file not found"
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!checkWSTokenPermissions($wsRequestedPermission)) return null;
|
||||
try {
|
||||
$envDir = dirname($envFile);
|
||||
|
||||
$dotenv = Dotenv::createImmutable($envDir, '.env.wk-id');
|
||||
|
||||
$dotenv->load();
|
||||
} catch (Throwable $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => "Dotenv error"
|
||||
]);
|
||||
}
|
||||
|
||||
$wkId = $_ENV['WETTKAMPF_ID'];
|
||||
|
||||
$allowedWkLeitungAccess = ['displaycontrol', 'einstellungen'];
|
||||
|
||||
function generateWSAdminToken($wsRequestedAcesstype, $wsRequestedAccess) {
|
||||
|
||||
global $redis, $wkId, $allowedWkLeitungAccess;
|
||||
|
||||
if (!checkWSTokenPermissions($wsRequestedAcesstype)) return null;
|
||||
|
||||
$wsGrantedPermission = [];
|
||||
|
||||
if ($wsRequestedPermission === 'kampfrichter') {
|
||||
if (!isset($_SESSION['selectedFreigabeKampfrichter'])) return null;
|
||||
if ($wsRequestedAcesstype === 'kampfrichter' && isset($_SESSION['selectedFreigabeIdKampfrichter'])) {
|
||||
$wsGrantedPermission['type'] = 'kampfrichter';
|
||||
$wsGrantedPermission['access'] = $_SESSION['selectedFreigabeKampfrichter'];
|
||||
$wsGrantedPermission['access'] = $_SESSION['selectedFreigabeIdKampfrichter'];
|
||||
} elseif ($wsRequestedAcesstype === 'wk_leitung' && in_array($wsRequestedAccess, $allowedWkLeitungAccess)) {
|
||||
$wsGrantedPermission['type'] = $wsRequestedAcesstype;
|
||||
$wsGrantedPermission['access'] = $wsRequestedAccess;
|
||||
} else {
|
||||
$wsGrantedPermission['type'] = $wsRequestedPermission;
|
||||
return null;
|
||||
}
|
||||
|
||||
$wsGrantedPermission['wk_id'] = $wkId;
|
||||
$wsGrantedPermission['authenticated'] = true;
|
||||
|
||||
$token = bin2hex(random_bytes(32));
|
||||
$key = "ws:token:" . $token;
|
||||
|
||||
@@ -54,3 +94,30 @@ function generateWSToken($wsRequestedPermission) {
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
$allowedReadTypes = ['display', 'audio', 'rankLive'];
|
||||
|
||||
function generateWSReadToken($wsRequestedAcesstype, $wsRequestedAccess) {
|
||||
|
||||
global $redis, $wkId, $allowedReadTypes;
|
||||
|
||||
$wsGrantedPermission = [];
|
||||
|
||||
if (!in_array($wsRequestedAcesstype, $allowedReadTypes)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$wsGrantedPermission['access'] = $wsRequestedAccess;
|
||||
$wsGrantedPermission['type'] = $wsRequestedAcesstype;
|
||||
$wsGrantedPermission['wk_id'] = $wkId;
|
||||
$wsGrantedPermission['authenticated'] = false;
|
||||
|
||||
$token = bin2hex(random_bytes(16));
|
||||
$key = "ws:token:" . $token;
|
||||
|
||||
$success = $redis->set($key, json_encode($wsGrantedPermission), ['nx', 'ex' => 30]);
|
||||
|
||||
$_SESSION['WS_KEY'] = $key;
|
||||
|
||||
return $key;
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
// --- KONFIGURATION ---
|
||||
$sqlFile = 'wkvs-database-template.sql';
|
||||
$newSqlFile = 'sql-database.sql';
|
||||
$envFile = __DIR__ . '/../../config/.env.db-tables';
|
||||
$oldPrefix = 'prefix-placeholder_';
|
||||
$hashPlaceholder = 'PW_HASH';
|
||||
|
||||
// --- LOGIK ---
|
||||
|
||||
// 1. Generieren eines neuen, zufälligen Prefixes
|
||||
// Format: 8 zufällige Zeichen + "_" (oder wie Sie es mögen)
|
||||
$newPrefix = bin2hex(random_bytes(6)) . '_';
|
||||
|
||||
echo "=== Prefix Update Prozess ===\n";
|
||||
echo "Alter Prefix: $oldPrefix\n";
|
||||
echo "Neuer Prefix: $newPrefix\n";
|
||||
|
||||
|
||||
if (!file_exists($sqlFile) || !file_exists($envFile)) {
|
||||
die("FEHLER: Die Dateien '$sqlFile' oder '$envFile' wurden nicht gefunden.\n");
|
||||
}
|
||||
|
||||
// 3. SQL-Datei verarbeiten (Stream-basiert für Performance)
|
||||
echo "Verarbeite SQL-Datei...\n";
|
||||
$handleIn = fopen($sqlFile, 'r');
|
||||
$handleOut = fopen($newSqlFile, 'w'); // Überschreiben der Originaldatei (oder neue Datei nutzen)
|
||||
|
||||
if (!$handleIn || !$handleOut) {
|
||||
die("FEHLER: Konnte Dateien nicht öffnen.\n");
|
||||
}
|
||||
|
||||
$randPw = bin2hex(random_bytes(12));
|
||||
|
||||
$pwHash = password_hash($randPw, PASSWORD_ARGON2ID);
|
||||
|
||||
$linesProcessed = 0;
|
||||
while (($line = fgets($handleIn)) !== false) {
|
||||
// Ersetze den alten Prefix im SQL-Content
|
||||
$newLine = str_replace($oldPrefix, $newPrefix, $line);
|
||||
$newLine = str_replace($hashPlaceholder, $newPrefix, $newLine);
|
||||
fwrite($handleOut, $newLine);
|
||||
$linesProcessed++;
|
||||
}
|
||||
|
||||
fclose($handleIn);
|
||||
fclose($handleOut);
|
||||
echo "✓ SQL-Datei aktualisiert ($linesProcessed Zeilen bearbeitet).\n";
|
||||
echo "\n ---> WK-Leitungs Benutzer hinzugefügt. Benutzername: admin Passwort: $randPw\n\n";
|
||||
|
||||
// 4. .env-Datei verarbeiten
|
||||
echo "Aktualisiere .env-Datei...\n";
|
||||
$envContent = file_get_contents($envFile);
|
||||
|
||||
// Wir ersetzen die Zeile DB_PREFIX=... durch DB_PREFIX=...
|
||||
// Regex sucht nach "DB_PREFIX=" gefolgt von beliebigen Zeichen bis Zeilenende
|
||||
$pattern = '/^DB_PREFIX=.*/m';
|
||||
$replacement = "DB_PREFIX=$newPrefix";
|
||||
|
||||
$updatedEnv = preg_replace($pattern, $replacement, $envContent);
|
||||
|
||||
if ($updatedEnv === $envContent) {
|
||||
// Falls die Zeile nicht gefunden wurde, hängen wir sie an
|
||||
$updatedEnv .= "\nDB_PREFIX=$newPrefix";
|
||||
echo "⚠️ Hinweis: DB_PREFIX war nicht in der .env, wurde angehängt.\n";
|
||||
}
|
||||
|
||||
file_put_contents($envFile, $updatedEnv);
|
||||
echo "✓ .env-Datei aktualisiert.\n";
|
||||
|
||||
// 5. Abschluss
|
||||
echo "\n✅ Prozess erfolgreich abgeschlossen!\n";
|
||||
echo "Bitte prüfen Sie Ihre Dateien und setzen Sie den neuen Prefix in Ihrer Konfiguration. Dateiname: $newSqlFile\n";
|
||||
@@ -1,501 +0,0 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.3
|
||||
-- https://www.phpmyadmin.net/
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_abteilungen`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_abteilungen` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(100) NOT NULL DEFAULT 'KEIN NAME'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_audiofiles`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_audiofiles` (
|
||||
`id` int(11) NOT NULL,
|
||||
`file_name` varchar(1024) NOT NULL,
|
||||
`file_path` varchar(1024) NOT NULL,
|
||||
`delete_key` binary(16) NOT NULL,
|
||||
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_basket_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_basket_items` (
|
||||
`id` int(11) NOT NULL,
|
||||
`user_id` bigint(20) UNSIGNED NOT NULL,
|
||||
`item_id` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_geraete`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_geraete` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(1024) DEFAULT NULL,
|
||||
`start_index` int(11) DEFAULT NULL,
|
||||
`color_kampfrichter` char(7) NOT NULL DEFAULT '#424242'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_intern_users`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_intern_users` (
|
||||
`id` bigint(20) UNSIGNED NOT NULL,
|
||||
`username` varchar(191) NOT NULL,
|
||||
`password_hash` varchar(255) NOT NULL,
|
||||
`password_cipher` text NOT NULL,
|
||||
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`edited_by` varchar(20) NOT NULL DEFAULT '0',
|
||||
`freigabe` varchar(500) NOT NULL DEFAULT 'keine'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_kampfricherinnen_protokoll`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_kampfricherinnen_protokoll` (
|
||||
`id` int(11) NOT NULL,
|
||||
`abteilung` int(11) NOT NULL DEFAULT 0,
|
||||
`geraet` varchar(10) NOT NULL DEFAULT 'NaN',
|
||||
`name` varchar(255) NOT NULL DEFAULT 'NaN',
|
||||
`aufgabe` int(255) NOT NULL DEFAULT 3
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_noten`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_noten` (
|
||||
`person_id` int(11) NOT NULL,
|
||||
`note_bezeichnung_id` int(11) NOT NULL,
|
||||
`geraet_id` int(11) NOT NULL,
|
||||
`jahr` year(4) NOT NULL,
|
||||
`run_number` TINYINT(3) NOT NULL DEFAULT 1,
|
||||
`value` int(11) DEFAULT NULL,
|
||||
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_noten_bezeichnungen`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_noten_bezeichnungen` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`default_value` float DEFAULT NULL,
|
||||
`type` enum('input','berechnung') NOT NULL DEFAULT 'input',
|
||||
`berechnung` varchar(255) DEFAULT NULL,
|
||||
`berechnung_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`berechnung_json`)),
|
||||
`max_value` float DEFAULT NULL,
|
||||
`min_value` float DEFAULT NULL,
|
||||
`pro_geraet` tinyint(1) NOT NULL DEFAULT 1
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_onetimeloginlinks`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_onetimeloginlinks` (
|
||||
`id` int(11) NOT NULL,
|
||||
`url` varchar(1000) DEFAULT NULL,
|
||||
`user_id` int(11) NOT NULL DEFAULT 0,
|
||||
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
--
|
||||
-- Trigger `prefix-placeholder_onetimeloginlinks`
|
||||
--
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `before_insert_login_tokens` BEFORE INSERT ON `prefix-placeholder_onetimeloginlinks` FOR EACH ROW BEGIN
|
||||
IF NEW.url IS NULL THEN
|
||||
SET NEW.url = HEX(RANDOM_BYTES(32));
|
||||
END IF;
|
||||
END
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_orders`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_orders` (
|
||||
`order_id` int(11) NOT NULL,
|
||||
`order_type` varchar(100) DEFAULT NULL,
|
||||
`preis` float NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`item_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item_ids`)),
|
||||
`order_status` int(11) NOT NULL DEFAULT 0,
|
||||
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
--
|
||||
-- Trigger `prefix-placeholder_orders`
|
||||
--
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `tr_update_turnerinnen_bezahlt` AFTER UPDATE ON `prefix-placeholder_orders` FOR EACH ROW BEGIN
|
||||
-- Only when status changes
|
||||
IF NEW.order_status <> OLD.order_status THEN
|
||||
|
||||
UPDATE prefix-placeholder_turnerinnen AS t
|
||||
SET bezahlt = NEW.order_status
|
||||
WHERE JSON_CONTAINS(NEW.item_ids, JSON_QUOTE(CAST(t.id AS CHAR)));
|
||||
|
||||
END IF;
|
||||
END
|
||||
$$
|
||||
DELIMITER ;
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `trigger02` BEFORE DELETE ON `prefix-placeholder_orders` FOR EACH ROW BEGIN
|
||||
UPDATE prefix-placeholder_turnerinnen AS t
|
||||
SET bezahlt = 0
|
||||
WHERE JSON_CONTAINS(OLD.item_ids, JSON_QUOTE(CAST(t.id AS CHAR)));
|
||||
END
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_programme`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_programme` (
|
||||
`id` int(11) NOT NULL,
|
||||
`programm` text NOT NULL,
|
||||
`preis` decimal(10,2) DEFAULT 0.00,
|
||||
`aktiv` tinyint(1) NOT NULL DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_turnerinnen`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_turnerinnen` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`vorname` text NOT NULL,
|
||||
`geburtsdatum` date NOT NULL,
|
||||
`programm` text NOT NULL,
|
||||
`verein` text NOT NULL,
|
||||
`gesamtpunktzahl` float NOT NULL DEFAULT 40,
|
||||
`rang` int(11) NOT NULL DEFAULT 0,
|
||||
`bezahlt` int(11) NOT NULL DEFAULT 0,
|
||||
`bezahltoverride` int(11) NOT NULL DEFAULT 0,
|
||||
`bodenmusik` int(11) NOT NULL DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_turnerinnen_abteilungen`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_turnerinnen_abteilungen` (
|
||||
`id` int(11) NOT NULL,
|
||||
`turnerin_id` int(11) NOT NULL,
|
||||
`abteilung_id` int(11) NOT NULL,
|
||||
`geraet_id` int(11) NOT NULL,
|
||||
`turnerin_index` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_variables`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_variables` (
|
||||
`name` varchar(255) NOT NULL DEFAULT 'NaN',
|
||||
`value` varchar(255) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_vereine`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_vereine` (
|
||||
`id` int(11) NOT NULL,
|
||||
`verein` text NOT NULL,
|
||||
`email` varchar(100) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_zeitplan`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_zeitplan` (
|
||||
`id` int(11) NOT NULL,
|
||||
`typ_id` int(11) NOT NULL,
|
||||
`start_time_date` datetime NOT NULL,
|
||||
`end_time_date` datetime NOT NULL,
|
||||
`abt_programm` int(11) DEFAULT NULL,
|
||||
`name` varchar(1024) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Tabellenstruktur für Tabelle `prefix-placeholder_zeitplan_types`
|
||||
--
|
||||
|
||||
CREATE TABLE `prefix-placeholder_zeitplan_types` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(2048) NOT NULL,
|
||||
`duration_fixed` time DEFAULT NULL,
|
||||
`duration_per_person` time DEFAULT NULL,
|
||||
`duration_min` time DEFAULT NULL,
|
||||
`duration_max` time DEFAULT NULL,
|
||||
`ort` varchar(1024) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
|
||||
--
|
||||
-- Indizes der exportierten Tabellen
|
||||
--
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_abteilungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_abteilungen`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_audiofiles`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_audiofiles`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_basket_items`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_basket_items`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `prefix-placeholder_basket_items_ibfk_1` (`user_id`),
|
||||
ADD KEY `prefix-placeholder_basket_items_ibfk_2` (`item_id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_geraete`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_geraete`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_intern_users`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_intern_users`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `username_page_unique` (`username`,`password_hash`) USING BTREE,
|
||||
ADD KEY `indexFreigabe` (`freigabe`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_kampfricherinnen_protokoll`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_kampfricherinnen_protokoll`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_noten`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_noten`
|
||||
ADD UNIQUE KEY `uniquePersonNoteJahrGereat` (`person_id`,`note_bezeichnung_id`,`jahr`,`geraet_id`,`run_number`) USING BTREE;
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_noten_bezeichnungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_noten_bezeichnungen`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `uniqueName` (`name`) USING BTREE,
|
||||
ADD KEY `indexMaxValue` (`max_value`),
|
||||
ADD KEY `indexMinValue` (`min_value`),
|
||||
ADD KEY `indexBerechnungJson` (`berechnung_json`(768));
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_onetimeloginlinks`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_onetimeloginlinks`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `url` (`url`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_orders`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_orders`
|
||||
ADD PRIMARY KEY (`order_id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_programme`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_programme`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_turnerinnen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_turnerinnen`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_turnerinnen_abteilungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_turnerinnen_abteilungen`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `unique_turnerin` (`turnerin_id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_variables`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_variables`
|
||||
ADD UNIQUE KEY `uniqueIndex` (`name`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_vereine`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_vereine`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD UNIQUE KEY `indexturnerinnen` (`id`,`verein`(31));
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_zeitplan`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_zeitplan`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indizes für die Tabelle `prefix-placeholder_zeitplan_types`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_zeitplan_types`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für exportierte Tabellen
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_abteilungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_abteilungen`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_audiofiles`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_audiofiles`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_basket_items`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_basket_items`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_geraete`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_geraete`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_intern_users`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_intern_users`
|
||||
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_kampfricherinnen_protokoll`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_kampfricherinnen_protokoll`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_noten_bezeichnungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_noten_bezeichnungen`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_onetimeloginlinks`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_onetimeloginlinks`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_programme`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_programme`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_turnerinnen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_turnerinnen`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_turnerinnen_abteilungen`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_turnerinnen_abteilungen`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_vereine`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_vereine`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_zeitplan`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_zeitplan`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT für Tabelle `prefix-placeholder_zeitplan_types`
|
||||
--
|
||||
ALTER TABLE `prefix-placeholder_zeitplan_types`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
|
||||
--
|
||||
-- Erstellt einen ersten Benutzer
|
||||
--
|
||||
INSERT INTO `prefix-placeholder_intern_users`
|
||||
(`usename`, `pw_hash`, `freigaben`)
|
||||
VALUES ('admin', 'PW_HASH', '{"types":["wk_leitung"]}');
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
@@ -38,43 +38,64 @@ const HEARTBEAT_INTERVAL = 30000;
|
||||
const MAX_MESSAGE_SIZE = 10 * 1024; // 10KB
|
||||
|
||||
|
||||
function addToGroup(ws, access, authenticted = false) {
|
||||
if (authenticted) {
|
||||
if (!authenticatedGroups.has(access)) {
|
||||
authenticatedGroups.set(access, new Set());
|
||||
function addToGroup(ws, wkId, accesstype, access, isAuthenticated = false) {
|
||||
const targetMap = isAuthenticated ? authenticatedGroups : groups;
|
||||
|
||||
if (!targetMap.has(wkId)) {
|
||||
targetMap.set(wkId, new Map());
|
||||
}
|
||||
authenticatedGroups.get(access).add(ws);
|
||||
ws.send("Dieser Benutzer wurde einer Authentifizierten Gruppe hinzugefügt." + access);
|
||||
} else {
|
||||
if (!groups.has(access)) {
|
||||
groups.set(access, new Set());
|
||||
|
||||
const workspaceMap = targetMap.get(wkId);
|
||||
|
||||
if (!workspaceMap.has(accesstype)) {
|
||||
workspaceMap.set(accesstype, new Map());
|
||||
}
|
||||
groups.get(access).add(ws);
|
||||
|
||||
const accesstypeMap = workspaceMap.get(accesstype);
|
||||
|
||||
if (!accesstypeMap.has(access)) {
|
||||
accesstypeMap.set(access, new Set());
|
||||
}
|
||||
|
||||
const accessSet = accesstypeMap.get(access);
|
||||
|
||||
accessSet.add(ws);
|
||||
|
||||
if (isAuthenticated) {
|
||||
ws.send(`Dieser Benutzer wurde einer Gruppe hinzugefügt: Wettkampf-Id: ${wkId}, Zugriffstyp: ${accesstype}, Zugriff: ${access}`);
|
||||
}
|
||||
}
|
||||
|
||||
function removeFromGroup(ws, access, authenticted = false) {
|
||||
function removeFromGroup(ws, wkId, accesstype, access, authenticted = false) {
|
||||
let group;
|
||||
if (authenticted) {
|
||||
group = authenticatedGroups.get(access);
|
||||
} else {
|
||||
group = groups.get(access);
|
||||
|
||||
const targetMap = authenticted ? authenticatedGroups : groups;
|
||||
|
||||
const workspaceMap = targetMap.get(wkId);
|
||||
|
||||
const accesstypeMap = workspaceMap.get(accesstype);
|
||||
|
||||
const accessSet = accesstypeMap.get(access);
|
||||
|
||||
if (accessSet) {
|
||||
accessSet.delete(ws);
|
||||
if (accessSet.size === 0) {
|
||||
accessSet.delete(access);
|
||||
}
|
||||
if (group) {
|
||||
group.delete(ws);
|
||||
if (group.size === 0) {
|
||||
groups.delete(access);
|
||||
if (accesstypeMap.size === 0) {
|
||||
accesstypeMap.delete(accesstype);
|
||||
}
|
||||
if (workspaceMap.size === 0) {
|
||||
workspaceMap.delete(wkId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendToGroup(access, messageObj, authenticted = false, excludeWs = null) {
|
||||
let group;
|
||||
if (authenticted) {
|
||||
group = authenticatedGroups.get(access);
|
||||
} else {
|
||||
group = groups.get(access);
|
||||
}
|
||||
function sendToAccess(wkId, accesstype, access, messageObj, authenticted = false, excludeWs = null) {
|
||||
|
||||
const targetMap = authenticted ? authenticatedGroups : groups;
|
||||
|
||||
const group = targetMap.get(wkId)?.get(accesstype)?.get(access);
|
||||
|
||||
if (!group) return;
|
||||
|
||||
@@ -87,6 +108,23 @@ function sendToGroup(access, messageObj, authenticted = false, excludeWs = null)
|
||||
}
|
||||
}
|
||||
|
||||
function sendToAccessType(wkId, accessType, messageObj, authenticated = false, excludeWs = null) {
|
||||
const targetMap = authenticated ? authenticatedGroups : groups;
|
||||
const accessTypeMap = targetMap.get(wkId)?.get(accessType);
|
||||
|
||||
if (!accessTypeMap) return;
|
||||
|
||||
const message = JSON.stringify(messageObj);
|
||||
|
||||
for (const sAccessTypeMap of accessTypeMap.values()) {
|
||||
for (const ws of sAccessTypeMap) {
|
||||
if (ws.readyState === WebSocket.OPEN && ws !== excludeWs) {
|
||||
ws.send(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendToSelf(ws, messageObj) {
|
||||
|
||||
const message = JSON.stringify(messageObj);
|
||||
@@ -151,23 +189,28 @@ wss.on("connection", async (ws, req) => {
|
||||
const access = typeof params.access === "string" ? params.access : "";
|
||||
let authenticatedFreigaben = null;
|
||||
ws.isAuthenticated = false;
|
||||
ws.access = access;
|
||||
if (access === 'token' && typeof params.token === "string") {
|
||||
|
||||
if (access !== 'token' || typeof params.token !== "string") {
|
||||
ws.send("unauthorized Access");
|
||||
ws.terminate();
|
||||
return;
|
||||
}
|
||||
|
||||
authenticatedFreigaben = await authenticateWithToken(params.token, ws);
|
||||
|
||||
if (!authenticatedFreigaben) return;
|
||||
|
||||
ws.send("Authentifizierung mit Token erfolgreich");
|
||||
ws.isAuthenticated = true;
|
||||
ws.access = authenticatedFreigaben.access ?? authenticatedFreigaben?.type;
|
||||
}
|
||||
ws.isAuthenticated = authenticatedFreigaben.authenticated;
|
||||
ws.access = String(authenticatedFreigaben.access);
|
||||
ws.accesstype = String(authenticatedFreigaben.type); // kampfrichter, wk_leitung
|
||||
ws.wkId = String(authenticatedFreigaben.wk_id);
|
||||
|
||||
ws.authenticatedFreigaben = authenticatedFreigaben;
|
||||
ws.isAlive = true;
|
||||
|
||||
clients.add(ws);
|
||||
|
||||
addToGroup(ws, ws.access, ws.isAuthenticated);
|
||||
addToGroup(ws, ws.wkId, ws.accesstype, ws.access, ws.isAuthenticated);
|
||||
|
||||
ws.on("pong", () => {
|
||||
ws.isAlive = true;
|
||||
@@ -189,21 +232,23 @@ wss.on("connection", async (ws, req) => {
|
||||
|
||||
if (!type) return;
|
||||
|
||||
let geraetId;
|
||||
|
||||
switch (type) {
|
||||
case "DISPLAY_CONTROL":
|
||||
if (ws.authenticatedFreigaben.type === "displaycontrol") {
|
||||
sendToGroupsContaining("_display", {
|
||||
type: "UPDATE_DISPLAYCONTROL",
|
||||
payload
|
||||
});
|
||||
} else {
|
||||
if (ws.accesstype !== 'wk_leitung' || ws.access !== "displaycontrol") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
} else {
|
||||
sendToAccessType(ws.wkId, "display", {
|
||||
type: "UPDATE_DISPLAYCONTROL",
|
||||
payload
|
||||
}, false);
|
||||
}
|
||||
break;
|
||||
|
||||
case "UPDATE_SCORE":
|
||||
if (ws.authenticatedFreigaben.type !== ("kampfrichter")) {
|
||||
if (ws.accesstype !== "kampfrichter") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
@@ -211,17 +256,63 @@ wss.on("connection", async (ws, req) => {
|
||||
if (!payload || typeof payload !== "object") return;
|
||||
|
||||
const geraetScreen = payload.geraet;
|
||||
if (!geraetScreen) return;
|
||||
geraetId = String(payload.geraetId);
|
||||
if (!geraetScreen || !geraetId) return;
|
||||
|
||||
if (ws.authenticatedFreigaben.access !== geraetScreen && ws.authenticatedFreigaben.access !== 'admin') {
|
||||
if (ws.access !== geraetId && ws.access !== 'A') {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
}
|
||||
|
||||
sendToGroup(`${geraetScreen}_display`, {
|
||||
sendToAccess(ws.wkId, "display", geraetId, {
|
||||
type: "UPDATE_SCORE",
|
||||
payload: payload.data
|
||||
});
|
||||
}, false);
|
||||
|
||||
break;
|
||||
|
||||
case "UPDATE_RANKLIVE_SCORE":
|
||||
if (ws.accesstype !== "kampfrichter") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
|
||||
if (!payload || typeof payload !== "object") return;
|
||||
|
||||
geraetId = String(payload.geraetId);
|
||||
if (!geraetId) return;
|
||||
|
||||
if (ws.access !== geraetId && ws.access !== 'A') {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
}
|
||||
|
||||
sendToAccess(ws.wkId, "rankLive", geraetId, {
|
||||
type: "UPDATE",
|
||||
payload: payload
|
||||
}, false);
|
||||
|
||||
sendToAccess(ws.wkId, "rankLive", 'A', {
|
||||
type: "UPDATE",
|
||||
payload: payload
|
||||
}, false);
|
||||
break;
|
||||
|
||||
case "UPDATE_RANKLIVE_C_SUBABT":
|
||||
if (ws.accesstype !== "kampfrichter") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
|
||||
if (ws.access !== 'A') {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
}
|
||||
|
||||
sendToAccessType(ws.wkId, "rankLive", {
|
||||
type: "UPDATE_RANKLIVE_C_SUBABT",
|
||||
payload: {}
|
||||
}, false);
|
||||
break;
|
||||
|
||||
case "SELF":
|
||||
@@ -232,39 +323,49 @@ wss.on("connection", async (ws, req) => {
|
||||
break;
|
||||
|
||||
case "AUDIO":
|
||||
if (ws.authenticatedFreigaben.type !== ("kampfrichter")) {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
|
||||
sendToGroup("audio", {
|
||||
type: "AUDIO",
|
||||
payload
|
||||
});
|
||||
break;
|
||||
|
||||
case "KAMPFRICHTER_UPDATE":
|
||||
if (ws.authenticatedFreigaben.type !== ("kampfrichter")) {
|
||||
if (ws.accesstype !== "kampfrichter") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
|
||||
if (!payload || typeof payload !== "object") return;
|
||||
|
||||
const discipline = payload.discipline;
|
||||
if (!discipline) return;
|
||||
const audioDiscipline = String(payload.audioDiscipline);
|
||||
if (!audioDiscipline) return;
|
||||
|
||||
if (ws.authenticatedFreigaben.access !== discipline && ws.authenticatedFreigaben.access !== 'admin') {
|
||||
if (ws.access !== audioDiscipline && ws.access !== 'A' && audioDiscipline !== 'A') {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
}
|
||||
|
||||
sendToGroup(discipline, {
|
||||
sendToAccess(ws.wkId, "audio", audioDiscipline, {
|
||||
type: "AUDIO",
|
||||
payload: payload
|
||||
}, false);
|
||||
break;
|
||||
|
||||
case "KAMPFRICHTER_UPDATE":
|
||||
if (ws.accesstype !== "kampfrichter") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
|
||||
if (!payload || typeof payload !== "object") return;
|
||||
|
||||
const discipline = String(payload.discipline);
|
||||
if (!discipline) return;
|
||||
|
||||
if (ws.access !== discipline && ws.access !== 'A') {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
}
|
||||
|
||||
sendToAccess(ws.wkId, "kampfrichter", discipline, {
|
||||
type: "UPDATE",
|
||||
payload: payload
|
||||
}, true, ws);
|
||||
|
||||
sendToGroup('admin', {
|
||||
sendToAccess(ws.wkId, "kampfrichter", 'A', {
|
||||
type: "UPDATE",
|
||||
payload: payload
|
||||
}, true, ws);
|
||||
@@ -272,7 +373,7 @@ wss.on("connection", async (ws, req) => {
|
||||
|
||||
|
||||
case "EINSTELLUNGEN_DISPLAY_UPDATE":
|
||||
if (ws.authenticatedFreigaben.type !== ("einstellungen")) {
|
||||
if (ws.accesstype !== 'wk_leitung' || ws.access !== "einstellungen") {
|
||||
ws.send("Unauthorized Request");
|
||||
ws.close(4003, "Unauthorized");
|
||||
};
|
||||
@@ -282,10 +383,15 @@ wss.on("connection", async (ws, req) => {
|
||||
const { key, value } = payload;
|
||||
if (!key) return;
|
||||
|
||||
sendToGroupsContaining("_display", {
|
||||
sendToAccessType(ws.wkId, "display", {
|
||||
type: "EINSTELLUNGEN_DISPLAY_UPDATE",
|
||||
payload: { key, value }
|
||||
});
|
||||
}, false);
|
||||
|
||||
sendToAccess(ws.wkId, 'wk_leitung', "einstellungen", {
|
||||
type: "EINSTELLUNGEN_DISPLAY_UPDATE",
|
||||
payload: { key, value }
|
||||
}, true, true);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -295,12 +401,12 @@ wss.on("connection", async (ws, req) => {
|
||||
|
||||
ws.on("close", () => {
|
||||
clients.delete(ws);
|
||||
removeFromGroup(ws, ws.access, ws.isAuthenticated);
|
||||
removeFromGroup(ws, ws.wkId, ws.accesstype, ws.access, ws.isAuthenticated);
|
||||
});
|
||||
|
||||
ws.on("error", () => {
|
||||
clients.delete(ws);
|
||||
removeFromGroup(ws, ws.access, ws.isAuthenticated);
|
||||
removeFromGroup(ws, ws.wkId, ws.accesstype, ws.access, ws.isAuthenticated);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -313,7 +419,7 @@ setInterval(() => {
|
||||
if (!ws.isAlive) {
|
||||
ws.terminate();
|
||||
clients.delete(ws);
|
||||
removeFromGroup(ws, ws.access, ws.isAuthenticated);
|
||||
removeFromGroup(ws, ws.wkId, ws.accesstype, ws.access, ws.isAuthenticated);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
RewriteEngine On
|
||||
|
||||
ErrorDocument 429 /error-pages/429.html
|
||||
ErrorDocument 403 /error-pages/403.html
|
||||
ErrorDocument 500 /error-pages/500.html
|
||||
ErrorDocument 400 /error-pages/400.html
|
||||
ErrorDocument 404 /error-pages/400.html
|
||||
|
||||
RewriteRule ^(riegeneinteilung)$ $1.php [L]
|
||||
@@ -0,0 +1,30 @@
|
||||
RewriteEngine On
|
||||
|
||||
ErrorDocument 503 /503.html
|
||||
|
||||
RewriteCond %{REQUEST_URI} !^/503\.html$
|
||||
|
||||
RewriteRule ^(index)$ $1.php [L]
|
||||
RewriteRule ^(404|503)$ $1.html [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 1) Root → index.php
|
||||
# ----------------------------------------
|
||||
RewriteRule ^$ router.php [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 2) Allow existing files
|
||||
# ----------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} -f
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 3) Allow existing directories
|
||||
# ----------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 4) Everything else → router.php
|
||||
# ----------------------------------------
|
||||
RewriteRule ^ router.php [QSA,L]
|
||||
@@ -0,0 +1,345 @@
|
||||
const selecteddiscipline = window.FREIGABE;
|
||||
|
||||
const csrf_token = window.CSDR_TOKEN;
|
||||
|
||||
let ws;
|
||||
let firstConnect = true;
|
||||
let wsOpen = false;
|
||||
const RETRY_DELAY = 5000;
|
||||
|
||||
const WSaccesstype = "rankLive";
|
||||
const WSaccess = window.FREIGABE;
|
||||
const WSaccessPermission = "R";
|
||||
|
||||
const urlAjaxNewWSToken = '/intern/scripts/ajax-create-ws-token.php';
|
||||
|
||||
async function fetchNewWSToken(accesstype, access, accessPermission) {
|
||||
try {
|
||||
const response = await fetch(urlAjaxNewWSToken, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
csrf_token,
|
||||
accesstype,
|
||||
access,
|
||||
accessPermission
|
||||
})
|
||||
});
|
||||
|
||||
if (response.status === 403) {
|
||||
console.warn("Please Re-Autenithicate. Reloading page...");
|
||||
location.reload();
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!response.ok) return null;
|
||||
|
||||
const data = await response.json();
|
||||
return data.success ? data.token : null;
|
||||
} catch (error) {
|
||||
console.error("Token fetch failed:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function startWebSocket() {
|
||||
console.log("Attempting WebSocket connection...");
|
||||
|
||||
let token;
|
||||
if (firstConnect) {
|
||||
token = window.WS_ACCESS_TOKEN;
|
||||
} else {
|
||||
token = await fetchNewWSToken(WSaccesstype, WSaccess, WSaccessPermission);
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
console.error("No valid token available. Retrying...");
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ws = new WebSocket(`wss://${window.location.hostname}/ws/?access=token&token=${token}`);
|
||||
} catch (err) {
|
||||
console.error("Malformed WebSocket URL", err);
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connected!");
|
||||
if (!firstConnect) {
|
||||
displayMsg(1, "Live Syncronisation wieder verfügbar");
|
||||
}
|
||||
firstConnect = true;
|
||||
wsOpen = true;
|
||||
};
|
||||
|
||||
ws.onerror = (event) => {
|
||||
console.error("WebSocket error observed." + JSON.stringify(event));
|
||||
};
|
||||
|
||||
ws.onclose = (event) => {
|
||||
|
||||
if (firstConnect) {
|
||||
displayMsg(0, "Live Syncronisation verloren");
|
||||
}
|
||||
firstConnect = false;
|
||||
wsOpen = false;
|
||||
|
||||
scheduleRetry();
|
||||
};
|
||||
}
|
||||
|
||||
function scheduleRetry() {
|
||||
console.log(`Retrying in ${RETRY_DELAY}ms...`);
|
||||
setTimeout(startWebSocket, RETRY_DELAY);
|
||||
}
|
||||
|
||||
// Start the initial connection attempt safely
|
||||
startWebSocket();
|
||||
|
||||
let rangNotenArray = JSON.parse(window.RANG_NOTEN_ARRAY) ?? [];
|
||||
|
||||
const rangNotenId = window.RANG_NOTE_ID ?? 0;
|
||||
|
||||
const rangSort = window.RANG_SORT ?? '';
|
||||
const isLive = parseInt(window.LIVE ?? 0);
|
||||
|
||||
ws.addEventListener("message", async function(event) {
|
||||
let msgOBJ;
|
||||
|
||||
try {
|
||||
msgOBJ = JSON.parse(event.data);
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure it's an UPDATE type (matches your sendToGroup logic)
|
||||
if (msgOBJ?.type === "UPDATE") {
|
||||
const data = msgOBJ.payload;
|
||||
|
||||
// Check access rights
|
||||
if (data.discipline === selecteddiscipline.toLowerCase() || selecteddiscipline === 'A') {
|
||||
const noten = data.rankLive;
|
||||
|
||||
const programmId = $(`tr[data-person-id="${data.personId}"]`).closest('tbody').attr('data-programm-id') ?? null;
|
||||
|
||||
if (!isLive && noten[0][1][rangNotenId] !== undefined && rangNotenArray[programmId][data.personId] !== undefined) {
|
||||
rangNotenArray[programmId][data.personId] = noten[0][1][rangNotenId];
|
||||
applyRanks(rankProgramm(rangNotenArray, programmId, rangSort), true);
|
||||
}
|
||||
|
||||
for (const [keyG, noteGroup] of Object.entries(noten)) {
|
||||
|
||||
for (const [run, runGroup] of Object.entries(noteGroup)) {
|
||||
|
||||
for (const [key, value] of Object.entries(runGroup)) {
|
||||
|
||||
const $elements = $(`.changebleValue[data-field-type-id="${key}"][data-geraet-id="${keyG}"][data-person-id="${data.personId}"][data-run="${run}"]`);
|
||||
$elements.each(function() {
|
||||
const $el = $(this);
|
||||
|
||||
const isNullable = ($el.attr('data-noten-nullable') ?? 'false') === 'true';
|
||||
const floatValZero = parseFloat(value.replace(",", ".").replace("'", "")) === 0.0;
|
||||
|
||||
if (isNullable && floatValZero || value === '') {
|
||||
$el.text('-').addClass('emtyPlaceholder');
|
||||
} else {
|
||||
$el.text(value).removeClass('emtyPlaceholder');
|
||||
}
|
||||
|
||||
$el.removeClass('updated');
|
||||
$el.addClass('updated');
|
||||
|
||||
updateDependentVisibility($el);
|
||||
|
||||
setTimeout(() => {
|
||||
$el.removeClass('updated');
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (msgOBJ?.type === "UPDATE_RANKLIVE_C_SUBABT") {
|
||||
if (!(await displayConfirm('Eine neue Gruppe ist aktiv. Fenster aktualisieren?'))) return;
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
function rankProgramm(dataObj, programmId, order = 'DESC') {
|
||||
if (!dataObj[programmId]) {
|
||||
console.error(`ID ${programmId} not found in data.`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const values = dataObj[programmId];
|
||||
|
||||
// 1. Transform and Sort
|
||||
const sorted = Object.entries(values)
|
||||
.map(([id, val]) => ({ id, val }))
|
||||
.sort((a, b) => {
|
||||
// 1. Handle null values first (Always push them to the bottom)
|
||||
if (a.val === null && b.val === null) return 0;
|
||||
if (a.val === null) return 1; // Move 'a' to a higher index (down)
|
||||
if (b.val === null) return -1; // Move 'b' to a higher index (down)
|
||||
|
||||
// 2. Normal sorting logic for valid numbers
|
||||
return order.toUpperCase() === 'ASC'
|
||||
? a.val - b.val
|
||||
: b.val - a.val;
|
||||
});
|
||||
|
||||
let lastVal = null;
|
||||
let lastRank = 0;
|
||||
|
||||
let sortedMap = [];
|
||||
|
||||
sortedMap[programmId] = sorted.map((item, index) => {
|
||||
if (item.val !== lastVal) {
|
||||
lastRank = index + 1;
|
||||
}
|
||||
|
||||
lastVal = item.val;
|
||||
|
||||
return {
|
||||
rang: lastRank,
|
||||
...item
|
||||
};
|
||||
});
|
||||
|
||||
return sortedMap;
|
||||
}
|
||||
|
||||
function rankAll(dataObj, order = 'DESC') {
|
||||
return Object.fromEntries(
|
||||
Object.entries(dataObj).map(([groupKey, values]) => {
|
||||
const sorted = Object.entries(values)
|
||||
.map(([id, val]) => ({ id, val }))
|
||||
.sort((a, b) => {
|
||||
// 1. Handle null values first (Always push them to the bottom)
|
||||
if (a.val === null && b.val === null) return 0;
|
||||
if (a.val === null) return 1; // Move 'a' to a higher index (down)
|
||||
if (b.val === null) return -1; // Move 'b' to a higher index (down)
|
||||
|
||||
// 2. Normal sorting logic for valid numbers
|
||||
return order.toUpperCase() === 'ASC'
|
||||
? a.val - b.val
|
||||
: b.val - a.val;
|
||||
});
|
||||
|
||||
let lastVal = null;
|
||||
let lastRank = 0;
|
||||
|
||||
const ranked = sorted.map((item, index) => {
|
||||
if (item.val !== lastVal) {
|
||||
lastRank = index + 1;
|
||||
}
|
||||
lastVal = item.val;
|
||||
|
||||
return {
|
||||
rang: lastRank,
|
||||
...item
|
||||
};
|
||||
});
|
||||
|
||||
return [groupKey, ranked];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function applyRanks(array, sort = false) {
|
||||
for (const [key, entries] of Object.entries(array)) {
|
||||
const $tbody = $(`tbody[data-programm-id="${key}"]`);
|
||||
|
||||
if ($tbody.length === 0) continue;
|
||||
|
||||
for (const [skey, entry] of Object.entries(entries)) {
|
||||
const $row = $tbody.find(`tr[data-person-id="${entry.id}"]`);
|
||||
|
||||
if ($row.length === 0) continue;
|
||||
|
||||
$row.attr('data-sort-rank', entry.rang);
|
||||
|
||||
const $cell = $row.find('.rangField');
|
||||
|
||||
const points = parseFloat(rangNotenArray[key][entry.id]);
|
||||
|
||||
const text = !isNaN(points) ? entry.rang : '';
|
||||
|
||||
$cell.text(text);
|
||||
}
|
||||
|
||||
if (sort) {
|
||||
const rows = $tbody.find('tr').get();
|
||||
|
||||
rows.sort((a, b) => {
|
||||
const rankA = parseFloat($(a).attr('data-sort-rank')) || 999;
|
||||
const rankB = parseFloat($(b).attr('data-sort-rank')) || 999;
|
||||
return rankA - rankB;
|
||||
});
|
||||
|
||||
// Re-append the sorted rows back into the tbody
|
||||
$.each(rows, (index, row) => {
|
||||
$tbody.append(row);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
applyRanks(rankAll(rangNotenArray, rangSort), true);
|
||||
|
||||
function updateDependentVisibility($changedEl) {
|
||||
const uid = $changedEl.attr('data-uid');
|
||||
if (uid === undefined || uid === null) return;
|
||||
|
||||
const $row = $changedEl.closest('tr');
|
||||
|
||||
if ($row.length !== 1) return;
|
||||
|
||||
const isVisible = $changedEl.hasClass('emtyPlaceholder');
|
||||
const doesExist = $changedEl.hasClass('nonExistentEl');
|
||||
|
||||
const $linkedEl = $row.find(`.singleValueSpan[data-linked-el-uid="${uid}"]`)
|
||||
|
||||
$linkedEl.toggleClass('emtyPlaceholder', isVisible).toggleClass('nonExistentEl', doesExist);
|
||||
}
|
||||
|
||||
function initConditionalVisibility() {
|
||||
const $table = $('table.customDisplayEditorTable');
|
||||
|
||||
const $rows = $table.find('tr');
|
||||
|
||||
$rows.each((ind, el) => {
|
||||
const $row = $(el);
|
||||
$row.find('.singleValueSpan[data-linked-el-uid]').each(function() {
|
||||
console.log('ja');
|
||||
const linkedUid = $(this).data('linked-el-uid');
|
||||
|
||||
const $linkedEl = $row.find(`.singleValueSpan[data-uid="${linkedUid}"]`);
|
||||
|
||||
if ($linkedEl.length === 1) {
|
||||
updateDependentVisibility($linkedEl);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
initConditionalVisibility();
|
||||
initConditionalVisibility();
|
||||
|
||||
const $parent = $('.allAbtContainer');
|
||||
const $children = $parent.children('.shiftedGeraetTable');
|
||||
|
||||
$children.sort((a, b) => {
|
||||
const idA = parseFloat($(a).data('geraet-index'));
|
||||
const idB = parseFloat($(b).data('geraet-index'));
|
||||
|
||||
return idA - idB;
|
||||
});
|
||||
|
||||
$parent.append($children);
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
$request = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
|
||||
$segments = $request === '' ? [] : explode('/', $request);
|
||||
|
||||
$segments = array_map('urldecode', $segments);
|
||||
|
||||
$type = $segments[1] ?? null;
|
||||
$slug = $segments[2] ?? null;
|
||||
|
||||
$allowed_types = ["programm", "live"];
|
||||
|
||||
if (($type !== null && !in_array($type, $allowed_types)) || count($segments) > 3) {
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
define('APP_ROUTER', true);
|
||||
|
||||
require __DIR__ . "/script.php";
|
||||
@@ -0,0 +1,655 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
if (!isset($segments) || !defined('APP_ROUTER')) {
|
||||
http_response_code(403);
|
||||
include $baseDir . "/error-pages/403.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
$type = $segments[1] ?? null;
|
||||
$slug = $segments[2] ?? null;
|
||||
|
||||
$allowed_types = ["programm", "live"];
|
||||
|
||||
if ($type !== null && !in_array($type, $allowed_types)) {
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require $baseDir . '/../scripts/db/db-verbindung-script-guest.php';
|
||||
|
||||
require $baseDir . "/../scripts/db/db-tables.php";
|
||||
require $baseDir . "/../scripts/db/db-functions.php";
|
||||
|
||||
$rankLive_public = db_get_variable($guest, $tableVar, ['rankLivePublic']) ?? 0;
|
||||
|
||||
require $baseDir . '/../scripts/websocket/ws-create-token.php';
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session(true);
|
||||
|
||||
$csrf_token = $_SESSION['csrf_token'] ?? '';
|
||||
|
||||
if (!$rankLive_public) {
|
||||
check_user_permission('wk_leitung', false, true);
|
||||
}
|
||||
|
||||
$is_live = $type === 'live';
|
||||
|
||||
if ($slug !== null && !$is_live) {
|
||||
|
||||
$alle_programme_db = db_select($guest, $tableProgramme, '`programm`', 'aktiv = ?', ['1']);
|
||||
$raw_programme = array_column($alle_programme_db, 'programm', 'programm');
|
||||
|
||||
$alle_programme = [];
|
||||
foreach ($raw_programme as $prog) {
|
||||
$normalized_key = str_replace(' ', '-', strtolower($prog));
|
||||
$alle_programme[$normalized_key] = $prog;
|
||||
}
|
||||
|
||||
$req_prog = str_replace(' ', '-', strtolower($slug));
|
||||
|
||||
if (!isset($alle_programme[$req_prog])) {
|
||||
http_response_code(400);
|
||||
$message = 'Das gesuchte Programm kann nicht gefunden werden';
|
||||
include $baseDir . "/error-pages/400.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
$validated_programm_name = $alle_programme[$req_prog];
|
||||
}
|
||||
|
||||
$selectedFreigabeId = 'A';
|
||||
|
||||
$json_type = $is_live ? 'rankLive-geraet' : 'rankLive-overview';
|
||||
|
||||
$jsonstr = db_select($guest, $tableRankLiveConfigs, 'json', 'type_slug = ?', [$json_type], '', 1);
|
||||
|
||||
$data = json_decode($jsonstr[0]['json'], true);
|
||||
|
||||
$headers = $data['header'] ?? [];
|
||||
$bodyColumns = $data['body'] ?? [];
|
||||
|
||||
$current_year = date('Y');
|
||||
$monat = date('n');
|
||||
if ($monat > 6) {
|
||||
$current_year = $current_year + 1;
|
||||
}
|
||||
|
||||
$alle_programme_db = db_select($guest, $tableProgramme, '`programm`, `id`', 'aktiv = ?', ['1']);
|
||||
$indexedProgrammes = array_column($alle_programme_db, 'programm', 'id');
|
||||
|
||||
$personData = [
|
||||
'geburtsdatum' => 'Geburtsdatum',
|
||||
'name' => 'Name',
|
||||
'vorname' => 'Vorname',
|
||||
'verein' => 'Verein',
|
||||
'programm' => 'Programm'
|
||||
];
|
||||
|
||||
$disciplines = db_select($guest, $tableGeraete, '*', '', [], 'start_index ASC');
|
||||
|
||||
$indexedArrayGeraete = array_column($disciplines, 'name', 'id');
|
||||
|
||||
if ($is_live) {
|
||||
$indexed_array_geraete_id_index = array_column($disciplines, 'start_index', 'id');
|
||||
|
||||
$indexed_array_geraete_index_id = array_flip($indexed_array_geraete_id_index);
|
||||
|
||||
$abt = (int) (db_get_variable($guest, $tableVar, ['wk_panel_current_abt']) ?? 1);
|
||||
$akt_subabt = (int) (db_get_variable($guest, $tableVar, ['wk_panel_current_subabt_admin']) ?? 1);
|
||||
|
||||
$max_subabt = count($disciplines);
|
||||
|
||||
$stmt = $guest->prepare("SELECT
|
||||
t.id,
|
||||
t.name,
|
||||
t.vorname,
|
||||
t.programm,
|
||||
t.verein,
|
||||
t.geburtsdatum,
|
||||
p.id AS programm_id,
|
||||
tabt.`turnerin_index` AS start_index,
|
||||
tabt.`geraet_id` AS startgeraet,
|
||||
tabt.`abteilung_id` AS abt_id
|
||||
FROM $tableTeilnehmende t
|
||||
LEFT JOIN $tableProgramme p ON p.programm = t.programm
|
||||
INNER JOIN $tableTeilnehmendeAbt tabt ON tabt.`turnerin_id` = t.`id`
|
||||
INNER JOIN $tableAbt abt ON abt.`id` = tabt.`abteilung_id`
|
||||
WHERE (t.bezahlt = 2 OR t.bezahltoverride = 5) AND abt.`order_index` = ?");
|
||||
|
||||
$stmt->bind_param("i", $abt);
|
||||
} elseif ($type === 'programm' && $slug !== null) {
|
||||
$stmt = $guest->prepare("SELECT
|
||||
u.id,
|
||||
u.name,
|
||||
u.vorname,
|
||||
u.programm,
|
||||
u.verein,
|
||||
u.geburtsdatum,
|
||||
p.id AS programm_id
|
||||
FROM $tableTeilnehmende u
|
||||
LEFT JOIN $tableProgramme p ON p.programm = u.programm
|
||||
WHERE (u.bezahlt = 2 OR u.bezahltoverride = 5) AND u.programm = ?");
|
||||
|
||||
$stmt->bind_param("s", $validated_programm_name);
|
||||
} else {
|
||||
$stmt = $guest->prepare("SELECT
|
||||
u.id,
|
||||
u.name,
|
||||
u.vorname,
|
||||
u.programm,
|
||||
u.verein,
|
||||
u.geburtsdatum,
|
||||
p.id AS programm_id
|
||||
FROM $tableTeilnehmende u
|
||||
LEFT JOIN $tableProgramme p ON p.programm = u.programm
|
||||
WHERE (u.bezahlt = 2 OR u.bezahltoverride = 5)");
|
||||
}
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$tures = $result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$stmt->close();
|
||||
|
||||
$indexedTures = [];
|
||||
|
||||
foreach ($tures as $s_tures) {
|
||||
$indexedTures[$s_tures['programm_id']][$s_tures['id']] = $s_tures;
|
||||
}
|
||||
|
||||
$stmt = $guest->prepare("SELECT `note_bezeichnung_id`, `geraet_id`, `person_id`, `run_number`, `public_value`
|
||||
FROM $tableNoten
|
||||
WHERE `is_public` = 1
|
||||
AND `jahr` = ?");
|
||||
|
||||
$stmt->bind_param("i", $current_year);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$noten = $result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$stmt->close();
|
||||
|
||||
$indexedNoten = [];
|
||||
|
||||
$stmt = $guest->prepare("SELECT `id`, `geraete_json`, `pro_geraet`, `anzahl_laeufe_json`, `name`, `default_value` FROM $tableNotenBezeichnungen");
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$notenConfig = $result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$stmt->close();
|
||||
|
||||
$disciplines = db_select($guest, $tableGeraete, '*', '', [], 'start_index ASC');
|
||||
|
||||
$indexedNotenConfig = array_column($notenConfig, null, 'id');
|
||||
|
||||
$rangNote = intval(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['rangNote']));
|
||||
|
||||
$orderBestRang = db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['orderBestRang']);
|
||||
|
||||
$okValuesOrderBestRang = ["ASC", "DESC"];
|
||||
|
||||
$rangOrderOk = in_array($orderBestRang, $okValuesOrderBestRang) && intval($rangNote) > 0;
|
||||
|
||||
$notenIndexed = [];
|
||||
|
||||
foreach ($noten as $sn) {
|
||||
$notenIndexed[$sn['person_id']][$sn['geraet_id']][$sn['note_bezeichnung_id']][$sn['run_number']] = $sn['public_value'];
|
||||
}
|
||||
|
||||
$disciplinesExtended = array_merge(
|
||||
[["id" => 0, "name" => "None"]],
|
||||
$disciplines
|
||||
);
|
||||
|
||||
$arrayIndexedNoten = [];
|
||||
|
||||
|
||||
$wkName = db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['wkName']);
|
||||
|
||||
$grouped = [];
|
||||
|
||||
function groop_by_key($array, $array_key, bool $int = false): array
|
||||
{
|
||||
if ($int) {
|
||||
foreach ($array as $entry) {
|
||||
$key = (int) $entry[$array_key];
|
||||
$grouped[$key][] = $entry;
|
||||
}
|
||||
} else {
|
||||
foreach ($array as $entry) {
|
||||
$key = $entry[$array_key];
|
||||
$grouped[$key][] = $entry;
|
||||
}
|
||||
}
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
if ($is_live) {
|
||||
|
||||
$grouped = groop_by_key($tures, 'startgeraet', true);
|
||||
|
||||
} else {
|
||||
|
||||
$grouped = groop_by_key($tures, 'programm');
|
||||
|
||||
foreach ($grouped as $key => $group) {
|
||||
$orderIndexes[$key] = $indexedProgramme[$key]['order_index'] ?? 10000;
|
||||
}
|
||||
|
||||
if (isset($orderIndexes)) {
|
||||
uksort($grouped, function ($a, $b) use ($orderIndexes) {
|
||||
return $orderIndexes[$a] <=> $orderIndexes[$b];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach ($grouped as $entry_key => $entries_group):
|
||||
|
||||
|
||||
endforeach;
|
||||
|
||||
$timeZone = new \DateTimeZone('Europe/Zurich');
|
||||
|
||||
$formatter = new \IntlDateFormatter(
|
||||
'de_CH',
|
||||
\IntlDateFormatter::FULL,
|
||||
\IntlDateFormatter::NONE,
|
||||
$timeZone
|
||||
);
|
||||
|
||||
$display_over_array = [];
|
||||
|
||||
function constructSingleValueSpanPublic($token, $type, $row, $selected_geraet_id = 0)
|
||||
{
|
||||
global $formatter;
|
||||
global $personData;
|
||||
global $arrayIndexedNoten;
|
||||
global $timeZone;
|
||||
global $display_over_array;
|
||||
global $indexedNotenConfig;
|
||||
global $indexedProgramme;
|
||||
|
||||
$text = '';
|
||||
$classes = 'singleValueSpan';
|
||||
|
||||
$bold = $token['bold'] ?? false;
|
||||
|
||||
$font_size = intval($token['fontSize'] ?? 0);
|
||||
|
||||
$min_display_width = intval($token['minDisplayWidth'] ?? 1) - 1;
|
||||
|
||||
$linked_el_uid = (int) ($token['linkedElUid'] ?? 0);
|
||||
|
||||
$uid = (int) ($token['uid'] ?? 0);
|
||||
|
||||
|
||||
$style = '';
|
||||
|
||||
if ($font_size > 0) {
|
||||
$style = ' style="font-size: ' . $font_size . 'px"';
|
||||
}
|
||||
|
||||
if ($min_display_width > 0) {
|
||||
$classes .= ' displayOver' . $min_display_width . 'px';
|
||||
$display_over_array[] = $min_display_width;
|
||||
}
|
||||
|
||||
$dataAttributes = 'data-bold="' . htmlspecialchars($bold) . '" data-uid="'. $uid .'"';
|
||||
|
||||
if ($linked_el_uid > 0) {
|
||||
$dataAttributes .= ' data-linked-el-uid="' . $linked_el_uid . '"';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'text':
|
||||
$text = $token['text'] ?? '';
|
||||
$classes .= ' staticText';
|
||||
break;
|
||||
|
||||
case 'sortData':
|
||||
$column = $token['column'] ?? '';
|
||||
switch ($column) {
|
||||
case "rang":
|
||||
$classes .= ' rangField';
|
||||
break;
|
||||
case "startindex":
|
||||
$text = $row['calculedstartindex'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'personData':
|
||||
$column = $token['column'] ?? '';
|
||||
|
||||
if ($column === 'jahrgang') {
|
||||
$geburtsdatum = $row['geburtsdatum'] ?? '';
|
||||
$date = new \DateTimeImmutable($geburtsdatum, $timeZone);
|
||||
$formatter->setPattern('yyyy');
|
||||
|
||||
$text = $formatter->format($date);
|
||||
} else {
|
||||
$text = array_key_exists($column, $personData) ? $row[$column] ?? '' : '';
|
||||
|
||||
if ($column === 'geburtsdatum') {
|
||||
$date = new \DateTimeImmutable($text, $timeZone);
|
||||
$formatter->setPattern(($token['phpDateFormat'] ?? '' !== '') ? $token['phpDateFormat'] : 'd. MMMM YYYY');
|
||||
|
||||
$text = $formatter->format($date);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'notenGeraetData':
|
||||
|
||||
$field_type_id = intval($token['field-type-id'] ?? 0);
|
||||
$run = intval($token['run'] ?? 0);
|
||||
$person_id = $row['id'];
|
||||
|
||||
$programm_id = $indexedProgramme[$row['programm']]['id'] ?? 0;
|
||||
|
||||
$runsJSON = json_decode($indexedNotenConfig[$field_type_id]['anzahl_laeufe_json'] ?? '', true) ?? [];
|
||||
|
||||
$max_run = $runsJSON[$selected_geraet_id][$programm_id] ?? $runsJSON[$selected_geraet_id]['all'] ?? $runsJSON['default'] ?? 0;
|
||||
|
||||
if ($run > $max_run) {
|
||||
$classes .= ' nonExistentEl';
|
||||
|
||||
} else {
|
||||
$notenNullable = ($token['notenNullable'] ?? 'false') === 'true';
|
||||
|
||||
$dataAttributes .= ' data-field-type-id="' . $field_type_id . '"';
|
||||
$dataAttributes .= ' data-geraet-id="' . $selected_geraet_id . '"';
|
||||
$dataAttributes .= ' data-person-id="' . $person_id . '"';
|
||||
$dataAttributes .= ' data-run="' . $run . '"';
|
||||
$dataAttributes .= ' data-noten-nullable="' . (($notenNullable) ? "true" : "false") . '"';
|
||||
|
||||
$text = $arrayIndexedNoten[$person_id][$selected_geraet_id][$field_type_id][$run]['value'] ?? null;
|
||||
|
||||
if ($notenNullable && $text !== null && floatval($text) === 0.0) {
|
||||
$text = ' ';
|
||||
}
|
||||
|
||||
if ($text === null) {
|
||||
$classes .= ' emtyPlaceholder';
|
||||
$text = '-';
|
||||
}
|
||||
|
||||
$classes .= ' changebleValue';
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'notenData':
|
||||
$field_type_id = intval($token['field-type-id'] ?? 0);
|
||||
$geraet_id = intval($token['geraet-id'] ?? 0);
|
||||
$run = intval($token['run'] ?? 0);
|
||||
$person_id = $row['id'];
|
||||
$notenNullable = ($token['notenNullable'] ?? 'false') === 'true';
|
||||
|
||||
$dataAttributes .= ' data-field-type-id="' . $field_type_id . '"';
|
||||
$dataAttributes .= ' data-geraet-id="' . $geraet_id . '"';
|
||||
$dataAttributes .= ' data-person-id="' . $person_id . '"';
|
||||
$dataAttributes .= ' data-run="' . $run . '"';
|
||||
$dataAttributes .= ' data-noten-nullable="' . (($notenNullable) ? "true" : "false") . '"';
|
||||
|
||||
$text = $arrayIndexedNoten[$person_id][$geraet_id][$field_type_id][$run]['value'] ?? null;
|
||||
|
||||
if ($notenNullable && $text !== null && floatval($text) === 0.0) {
|
||||
$text = ' ';
|
||||
}
|
||||
|
||||
if ($text === null) {
|
||||
$classes .= ' emtyPlaceholder';
|
||||
$text = '-';
|
||||
}
|
||||
|
||||
$classes .= ' changebleValue';
|
||||
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<span class="<?= $classes ?>" <?= $dataAttributes; ?><?= $style ?>><?= htmlspecialchars($text); ?></span>
|
||||
<?php }
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de-ch">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="png" href="/intern/img/icon.png">
|
||||
<link rel="stylesheet" href="/intern/css/custom-msg-display.css">
|
||||
<link href="/files/fonts/fonts.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/css/custom-display-editor-required-css.css">
|
||||
<script src="/intern/js/jquery/jquery-3.7.1.min.js"></script>
|
||||
<script src="/intern/js/custom-msg-display.js"></script>
|
||||
<title>RankLive - <?= htmlspecialchars($wkName) ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php if (count($indexedTures) < 1) : ?>
|
||||
<h3>Noch keine Daten verfügbar</h3>
|
||||
<?php endif; ?>
|
||||
<div class="allAbtContainer">
|
||||
<?php foreach ($grouped as $entry_key => $entries_group):
|
||||
|
||||
$table_data_geraet_label = '';
|
||||
$extra_table_classes = '';
|
||||
|
||||
if ($is_live) {
|
||||
$entries_with_calculated_index = [];
|
||||
|
||||
// Optional: Vorab-Caching der MAX-Indices, um DB-Abfragen im Loop zu vermeiden
|
||||
// (Nur aktivieren, wenn $entries_group sehr groß ist und Performance-Probleme auftreten)
|
||||
$maxStartIndexCache = [];
|
||||
|
||||
foreach ($entries_group as $row) {
|
||||
$old_geraet_id = $row['startgeraet'];
|
||||
|
||||
$old_geraet_index = $indexed_array_geraete_id_index[$row['startgeraet']];
|
||||
$shifted_geraet_index = $old_geraet_index + $akt_subabt - 1;
|
||||
if ($shifted_geraet_index > $max_subabt) {
|
||||
$shifted_geraet_index -= $max_subabt;
|
||||
}
|
||||
$row['startgeraet'] = $indexed_array_geraete_index_id[$shifted_geraet_index];
|
||||
|
||||
$rohstartindex = intval($row['start_index']);
|
||||
$abtId = intval($row['abt_id']);
|
||||
|
||||
// Hole maxStartIndex (mit Caching-Logik optional)
|
||||
if (!isset($maxStartIndexCache["$abtId-$old_geraet_id "])) {
|
||||
$maxStartIndexCache["$abtId-$old_geraet_id"] = db_get_var($guest, "SELECT COUNT(*) FROM `$tableTeilnehmendeAbt` WHERE abteilung_id = ? AND geraet_id = ?", [$abtId, $old_geraet_id]);
|
||||
}
|
||||
|
||||
$maxstartindex = $maxStartIndexCache["$abtId-$old_geraet_id"];
|
||||
|
||||
// Sicherheit: Vermeiden Sie Division durch Null oder Modulo durch 0
|
||||
if ($maxstartindex < 1) {
|
||||
$maxstartindex = 1;
|
||||
}
|
||||
|
||||
// The order shift depends on the number of rotations the group has made
|
||||
$rotation_shift = $akt_subabt - 1;
|
||||
|
||||
$calculedstartindex = $rohstartindex - $rotation_shift;
|
||||
|
||||
// Sicherstellen, dass das Ergebnis positiv ist (PHP Modulo kann negative Ergebnisse liefern)
|
||||
// Wenn das Ergebnis negativ ist, addieren wir maxstartindex
|
||||
if ($calculedstartindex < 1) {
|
||||
$calculedstartindex += $maxstartindex;
|
||||
}
|
||||
|
||||
// Kopie der Zeile erstellen, um Originaldaten nicht zu verändern
|
||||
$row['calculedstartindex'] = $calculedstartindex;
|
||||
$entries_with_calculated_index[] = $row;
|
||||
}
|
||||
|
||||
// Sortieren nach dem berechneten Startindex
|
||||
usort($entries_with_calculated_index, fn($a, $b) => $a['calculedstartindex'] <=> $b['calculedstartindex']);
|
||||
|
||||
$entries_to_display = $entries_with_calculated_index;
|
||||
|
||||
$shifted_geraet_index = $indexed_array_geraete_id_index[$entry_key] + $akt_subabt - 1;
|
||||
if ($shifted_geraet_index > $max_subabt) {
|
||||
$shifted_geraet_index -= $max_subabt;
|
||||
}
|
||||
$shifted_geraet_id = $indexed_array_geraete_index_id[$shifted_geraet_index];
|
||||
|
||||
$table_data_geraet_label = ' data-geraet-index="' . $shifted_geraet_index . '"';
|
||||
$extra_table_classes = ' shiftedGeraetTable';
|
||||
} else {
|
||||
$entries_to_display = $entries_group;
|
||||
}
|
||||
|
||||
foreach ($entries_to_display as $row):
|
||||
$rangNotenArray[$entry_key][$row['id']] = isset($notenIndexed[$row['id']][0][$rangNote][1]) ? floatval($notenIndexed[$row['id']][0][$rangNote][1]) : null;
|
||||
foreach ($disciplinesExtended as $discipline):
|
||||
foreach ($notenConfig as $snC):
|
||||
|
||||
if (intval($snC['pro_geraet']) === 1 && intval($discipline['id']) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (intval($snC['pro_geraet']) !== 1) {
|
||||
$allowedGeraete = !empty($snC['geraete_json']) ? json_decode($snC['geraete_json'], true) : [];
|
||||
if (!in_array($discipline['id'], $allowedGeraete)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
$runs = $runsJSON[$discipline['id']][$entry_key] ?? $runsJSON[$discipline['id']]['all'] ?? $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++):
|
||||
$note = $notenIndexed[$row['id']][$discipline['id']][$snC['id']][$r] ?? null;
|
||||
$normalizedNote = ($note !== null) ? number_format($note, $snC['nullstellen'] ?? 2) : null;
|
||||
|
||||
$arrayIndexedNoten[intval($row['id'])][intval($discipline['id'])][intval($snC['id'])][intval($r)] = ["value" => $normalizedNote];
|
||||
endfor;
|
||||
endforeach;
|
||||
endforeach;
|
||||
endforeach; ?>
|
||||
<div class="singleAbtDiv<?= $extra_table_classes ?>" <?= $table_data_geraet_label ?>>
|
||||
<?php if ($is_live) : ?>
|
||||
<h3><?= $indexedArrayGeraete[$shifted_geraet_id] ?? '' ?></h3>
|
||||
<?php else: ?>
|
||||
<h3><?= $entry_key ?? '' ?></h3>
|
||||
<?php endif; ?>
|
||||
<?php $geraet_id_for_live_view = $is_live ? $shifted_geraet_id : 0 ?>
|
||||
<div class="scoreboard-container">
|
||||
<table class="customDisplayEditorTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ($headers as $header_data): ?>
|
||||
<?php
|
||||
$min_display_width = ($header_data['minDisplayWidth'] ?? 1) - 1;
|
||||
|
||||
$class = "";
|
||||
|
||||
if ($min_display_width > 0) {
|
||||
$class = 'displayOver' . $min_display_width . 'px';
|
||||
$display_over_array[] = $min_display_width;
|
||||
}
|
||||
?>
|
||||
|
||||
<th class="<?= $class ?>">
|
||||
<?= htmlspecialchars($header_data['title']) ?>
|
||||
</th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody <?= !$is_live ? 'data-programm-id="'. $entry_key .'"' : ''?>>
|
||||
<?php foreach ($entries_to_display as $row): ?>
|
||||
<tr data-person-id="<?= $row['id'] ?>">
|
||||
<?php foreach ($bodyColumns as $ind => $columnTokens): ?>
|
||||
<?php
|
||||
$class = '';
|
||||
|
||||
if (isset($headers[$ind]['minDisplayWidth']) && $headers[$ind]['minDisplayWidth'] > 1) {
|
||||
$min_display_width = ($headers[$ind]['minDisplayWidth'] ?? 1) - 1;
|
||||
|
||||
$class = 'displayOver' . $min_display_width . 'px';
|
||||
$display_over_array[] = $min_display_width;
|
||||
}
|
||||
?>
|
||||
<td class=<?= $class ?>>
|
||||
<span class="tdSpan">
|
||||
|
||||
<?php
|
||||
foreach ($columnTokens as $token):
|
||||
$type = $token['type'] ?? '';
|
||||
if ($type === 'layoutEls') :
|
||||
$column = $token['column'];
|
||||
$content = $token['content'] ?? []; ?>
|
||||
<div class="<?= $column ?>LayoutEl">
|
||||
<?php foreach ($content as $layout_row) : ?>
|
||||
<span class="<?= $column ?>LayoutElRow">
|
||||
<?php foreach ($layout_row as $el) :
|
||||
constructSingleValueSpanPublic($el, $el['type'], $row, $geraet_id_for_live_view);
|
||||
endforeach; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else:
|
||||
constructSingleValueSpanPublic($token, $type, $row, $geraet_id_for_live_view);
|
||||
endif;
|
||||
endforeach; ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<style>
|
||||
<?php
|
||||
$unique_display_over_array = array_unique($display_over_array);
|
||||
|
||||
foreach ($unique_display_over_array as $s_size):
|
||||
$s_size = (int)$s_size;
|
||||
?>
|
||||
@media (max-width: <?= $s_size ?>px) {
|
||||
.displayOver<?= $s_size ?>px {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
<?php endforeach; ?>
|
||||
</style>
|
||||
<script>
|
||||
window.FREIGABE = "<?= $selectedFreigabeId; ?>";
|
||||
window.CSDR_TOKEN = "<?= $csrf_token; ?>";
|
||||
window.WS_ACCESS_TOKEN = "<?= generateWSReadToken('rankLive', $selectedFreigabeId) ?>";
|
||||
window.AKTUELLES_JAHR = "<?= $current_year ?>";
|
||||
window.RANG_NOTEN_ARRAY = '<?= json_encode($rangNotenArray, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>';
|
||||
window.RANG_SORT = "<?= $orderBestRang ?>";
|
||||
window.RANG_NOTE_ID = <?= $rangNote ?>;
|
||||
window.LIVE = <?= (int) $is_live ?>;
|
||||
</script>
|
||||
|
||||
<script src="/RankLive/js/script.js"></script>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,125 @@
|
||||
|
||||
:root {
|
||||
--sb-bg: #f8fafc;
|
||||
--sb-card-bg: #ffffff;
|
||||
--sb-text-main: #36454F;
|
||||
--sb-text-muted: #64748b;
|
||||
--sb-primary: #1e40af; /* Deep athletic blue */
|
||||
--sb-accent: #2563eb; /* Vivid score blue */
|
||||
--sb-border: #e2e8f0;
|
||||
--sb-hover: #f3f3f3;
|
||||
--sb-radius: 12px;
|
||||
--font-numeric: 'Courier New', Courier, monospace; /* Clean alignment for scores */
|
||||
--padding-td: clamp(3px, 2.5vh, 12px) clamp(4px, 2vw, 20px);
|
||||
--padding-th: clamp(2px, 1.5vh, 6px) clamp(4px, 2vw, 20px);
|
||||
}
|
||||
|
||||
|
||||
/* Base Table Styling */
|
||||
.customDisplayEditorTable {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
font-size: 0.95rem;
|
||||
color: var(--sb-text-main);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable th {
|
||||
color: #1e293b;
|
||||
border-bottom: solid 1px #1e293b;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
letter-spacing: 0.05em;
|
||||
padding: var(--padding-th);
|
||||
white-space: nowrap;
|
||||
position: sticky;
|
||||
background-color: #fff;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable th sup {
|
||||
font-size: 0.65rem;
|
||||
margin-left: 2px;
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable td {
|
||||
padding: var(--padding-td);
|
||||
border-bottom: 1px solid var(--sb-border);
|
||||
vertical-align: middle;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tbody > tr:nth-child(even) td {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tbody > tr:hover td {
|
||||
background-color: var(--sb-hover) !important;
|
||||
}
|
||||
|
||||
|
||||
.customDisplayEditorTable td {
|
||||
color: var(--sb-text-main);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
|
||||
.customDisplayEditorTable td.changebleValue {
|
||||
font-family: var(--font-numeric);
|
||||
font-size: 1.05rem;
|
||||
color: var(--sb-text-main);
|
||||
background-color: rgb(37 99 235 / 0.02);
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.changebleValue.updated {
|
||||
animation: flashHighlight 3.5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes flashHighlight {
|
||||
0% { color: #00ff99; }
|
||||
100% { color: var(--sb-text-main); }
|
||||
}
|
||||
|
||||
.singleValueSpan[data-bold="true"] {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.staticText {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.tdSpan {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.verticalLayoutEl {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.verticalLayoutElRow {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
.verticalLayoutEl .changebleValue {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.emtyPlaceholder {
|
||||
color: transparent;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.nonExistentEl {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
:root {
|
||||
--main: #2d2726;
|
||||
--bg-top-raw: 254 63 24;
|
||||
--main-box-shadow: rgb(from var(--main) r g b / 0.05);
|
||||
--accent: #fe3f18;
|
||||
--accent-hover: #c5e300;
|
||||
--paddingSite: 40px;
|
||||
--card-radius: 20px;
|
||||
--card-bg: #ffffff;
|
||||
--bg: #FDFDFD;
|
||||
--card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
|
||||
--border-subtle: #d4d7e1;
|
||||
--text-main: #191919;
|
||||
--text-muted: #5e5e5e;
|
||||
}
|
||||
|
||||
/* --- BASE & TYPOGRAPHY --- */
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
background: var(--bg);
|
||||
color: var(--text-main);
|
||||
overflow-x: hidden;
|
||||
overscroll-behavior: none;
|
||||
font-optical-sizing: auto;
|
||||
}
|
||||
|
||||
.bgSection {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
padding: var(--paddingSite);
|
||||
max-width: 1400px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.headerAbt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.headerAbt h2 {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
color: var(--main);
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.textInputAbtTitel {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--main);
|
||||
font-size: 1.5rem;
|
||||
color: #191919;
|
||||
background: none;
|
||||
width: max-content;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
/* Sidebar Menu Button Styling */
|
||||
.header-text-conatiner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.header-text-conatiner button {
|
||||
cursor: auto;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
padding: 12px 20px;
|
||||
border-radius: 100px;
|
||||
background: var(--accent);
|
||||
border: 1px solid transparent;
|
||||
font-size: 15px;
|
||||
color: #000;
|
||||
width: 100%;
|
||||
box-shadow: 0 4px 6px rgba(207, 239, 0, 0.2);
|
||||
}
|
||||
|
||||
.header-text-conatiner button:hover {
|
||||
background: var(--accent-hover);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(207, 239, 0, 0.3);
|
||||
}
|
||||
|
||||
.header-text-conatiner button:active {
|
||||
transform: scale(0.98) translateY(0);
|
||||
}
|
||||
|
||||
.header-text-conatiner label {
|
||||
font-weight: 400;
|
||||
color: var(--text-main);
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
|
||||
.header-text-conatiner input[type="number"] {
|
||||
padding: 12px 15px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
background: #fff;
|
||||
font-size: 15px;
|
||||
outline: none;
|
||||
transition: all 0.2s ease;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-text-conatiner input[type="number"]:focus {
|
||||
border-color: var(--main);
|
||||
box-shadow: 0 0 0 3px rgba(40, 102, 110, 0.1);
|
||||
}
|
||||
|
||||
.geraet-table {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 16px;
|
||||
box-shadow: var(--card-shadow);
|
||||
min-width: 260px;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.geraet-table thead {
|
||||
background: var(--main);
|
||||
}
|
||||
|
||||
.geraet-table thead th {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #fff;
|
||||
padding: 14px 20px;
|
||||
font-weight: 300;
|
||||
font-size: 1.05rem;
|
||||
text-align: left;
|
||||
letter-spacing: 0.5px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
}
|
||||
|
||||
.geraet-table thead th i span {
|
||||
font-size: 0.9rem;
|
||||
opacity: 0.8;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.geraet-table tbody {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar for tbody */
|
||||
.geraet-table tbody::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.geraet-table tbody::-webkit-scrollbar-track {
|
||||
background: #f1f5f9;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.geraet-table tbody::-webkit-scrollbar-thumb {
|
||||
background: #cbd5e1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.geraet-table tbody::-webkit-scrollbar-thumb:hover {
|
||||
background: #94a3b8;
|
||||
}
|
||||
|
||||
.turnerin-row {
|
||||
cursor: auto;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 8px;
|
||||
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
|
||||
display: block;
|
||||
border: 1px solid transparent;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
.turnerin-row>td {
|
||||
padding: 12px 16px;
|
||||
border: none;
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: var(--text-main);
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
/* Grouping Row Styling */
|
||||
.group-row {
|
||||
background: transparent;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.group-row>td {
|
||||
padding: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.group-header {
|
||||
padding: 12px 16px;
|
||||
cursor: auto;
|
||||
gap: 18px;
|
||||
border-radius: 10px;
|
||||
font-weight: 200;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
||||
margin-bottom: 6px;
|
||||
display: flex;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-webkit-touch-callout: none;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.group-inner {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.group-row .group-inner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.allGeraeteDiv {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
.buttonsDiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 20px;
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.buttonsDiv > button {
|
||||
background: var(--main);
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.buttonsDiv > select {
|
||||
background: #fff;
|
||||
border: 1px solid var(--main);
|
||||
color: var(--main);
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.buttonsDiv > button:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.buttonsDiv > button:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.filtered-out {
|
||||
opacity: 0.5;
|
||||
background: #4d4d4d22 !important;
|
||||
color: #4d4d4d !important;
|
||||
}
|
||||
|
||||
.filtered-out-border {
|
||||
border: 1px solid #4d4d4d !important;
|
||||
}
|
||||
|
||||
.timeSpan {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 8px;
|
||||
background: #f1f5f9;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.stickyDivHeader {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: var(--bg);
|
||||
padding: 10px 0;
|
||||
z-index: 10;
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Remote Audioplayer</title>
|
||||
<meta name="robots" content="noindex">
|
||||
<style>
|
||||
body {
|
||||
background: #000 !important;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family: sans-serif;
|
||||
cursor: pointer;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
const userAccess = "audio";
|
||||
|
||||
let ws;
|
||||
const RETRY_DELAY = 200; // ms
|
||||
|
||||
function startWebSocket() {
|
||||
|
||||
console.log("Attempting WebSocket connection...");
|
||||
|
||||
try {
|
||||
ws = new WebSocket(`wss://` + window.location.hostname + `/ws/?access=${userAccess}`);
|
||||
} catch (err) {
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connected!");
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
|
||||
// SAFE: this executes only on successful connect
|
||||
ws.send(JSON.stringify({
|
||||
type: "SELF",
|
||||
payload: {}
|
||||
}));
|
||||
};
|
||||
|
||||
ws.onerror = () => {
|
||||
document.querySelector('h1').innerText = 'WS ERROR';
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
document.querySelector('h1').innerText = 'WS DISCONECTED';
|
||||
scheduleRetry();
|
||||
};
|
||||
}
|
||||
|
||||
function scheduleRetry() {
|
||||
console.log(`Retrying in ${RETRY_DELAY}ms...`);
|
||||
setTimeout(startWebSocket, RETRY_DELAY);
|
||||
}
|
||||
|
||||
startWebSocket();
|
||||
</script>
|
||||
<h1>Der Audioplayer startet durch das Berühren des Displays</h1>
|
||||
|
||||
<audio id="peep" preload="auto"></audio>
|
||||
<audio id="musicPlayer" preload="auto"></audio>
|
||||
|
||||
<script>
|
||||
const peep = document.getElementById('peep');
|
||||
const music = document.getElementById('musicPlayer');
|
||||
|
||||
let lastMusicUrl = null;
|
||||
let pollingStarted = false; // ensure we start polling only once
|
||||
|
||||
async function fetchAndHandleMusic() {
|
||||
try {
|
||||
const response = await fetch('/displays/json/audio.json?t=' + Date.now(), { cache: 'no-store' });
|
||||
const data = await response.json();
|
||||
|
||||
// Stop everything if musik is "stop"
|
||||
if (!data.musik || data.musik === 'nan' || data.start == false) {
|
||||
if (!music.paused) {
|
||||
music.pause();
|
||||
music.currentTime = 0;
|
||||
}
|
||||
if (!peep.paused) {
|
||||
peep.pause();
|
||||
peep.currentTime = 0;
|
||||
}
|
||||
lastMusicUrl = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Play only if new URL
|
||||
if (data.musik !== lastMusicUrl) {
|
||||
lastMusicUrl = data.musik;
|
||||
|
||||
// Play short peep first
|
||||
peep.src = '/files/music/piep.mp3';
|
||||
peep.play().then(() => {
|
||||
// After 2 seconds, play the main music
|
||||
setTimeout(() => {
|
||||
music.src = data.musik;
|
||||
music.play().catch(err => console.log('Music play error:', err));
|
||||
}, 2000);
|
||||
}).catch(err => console.log('Peep play error:', err));
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching JSON:', err);
|
||||
}
|
||||
}
|
||||
|
||||
document.body.addEventListener('click', () => {
|
||||
if (!pollingStarted) {
|
||||
pollingStarted = true;
|
||||
ws.addEventListener("message", () => {
|
||||
fetchAndHandleMusic();
|
||||
});
|
||||
document.querySelector('h1').innerText = 'Player läuft'; // remove instruction
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,372 +0,0 @@
|
||||
:root {
|
||||
--bg: #111827;
|
||||
--panel: #020617;
|
||||
--panel-soft: #0b1120;
|
||||
--accent: #38bdf8;
|
||||
--accent-soft: rgba(56, 189, 248, 0.15);
|
||||
--text-main: #e5e7eb;
|
||||
--text-muted: #9ca3af;
|
||||
--danger: #ef4444;
|
||||
--success: #22c55e;
|
||||
--radius-lg: 18px;
|
||||
--border-subtle: 1px solid rgba(148, 163, 184, 0.35);
|
||||
--shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.85);
|
||||
--transition-fast: 180ms ease-out;
|
||||
--colorStartDiv: #0b1120;
|
||||
--panelBgLogo: #4a2f96;
|
||||
--font-heading: clamp(1.5rem, 6vh, 4rem);
|
||||
--font-sub: clamp(1rem, 3.5vh, 2.2rem);
|
||||
--logo-size: clamp(150px, 40vh, 500px);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
head > * {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background-color: var(--bg);
|
||||
color: var(--text-main);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* WebSocket error overlay */
|
||||
.errorws {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 5vh 5vw;
|
||||
background: radial-gradient(circle at top, #020617 0, #020617 55%);
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.errorws .logoimg {
|
||||
max-width: var(--logo-size);
|
||||
height: auto;
|
||||
margin-bottom: 2vh;
|
||||
filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
|
||||
}
|
||||
|
||||
.errortext {
|
||||
margin: 0;
|
||||
font-size: clamp(1.8rem, 8vw, 5rem);
|
||||
line-height: 1.1;
|
||||
max-width: 90vw;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-main);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.errortextSmall {
|
||||
margin: 10px;
|
||||
font-size: clamp(1rem, 3vw, 2rem);
|
||||
opacity: 0.8;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--text-main);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Startup logo overlay */
|
||||
.logobg {
|
||||
padding: 4vh;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background-color: var(--panelBgLogo);
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
|
||||
.logoimg {
|
||||
width: auto;
|
||||
max-height: 45vh;
|
||||
max-width: 80vw;
|
||||
object-fit: contain;
|
||||
/* filter: drop-shadow(0 18px 40px rgba(15, 23, 42, 0.4)); */
|
||||
}
|
||||
|
||||
.logotext {
|
||||
margin: 0;
|
||||
font-size: clamp(1.8rem, 7vh, 6rem);
|
||||
text-align: center;
|
||||
width: 90vw;
|
||||
line-height: 1.2;
|
||||
/* Forces single line for names/titles to prevent overflow */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.logotext, .logoctext {
|
||||
color: var(--text-color) !important;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
margin-top: 1vh;
|
||||
}
|
||||
|
||||
.logoctext {
|
||||
margin: 0;
|
||||
font-size: clamp(2rem, 7vw, 12rem);
|
||||
}
|
||||
|
||||
/* 4. Responsive adjustments for different screen ratios */
|
||||
@media (aspect-ratio: 4/3), (aspect-ratio: 10/7) {
|
||||
/* Tablet specific tweaks (iPad/Android Tabs) */
|
||||
:root {
|
||||
--logo-size: 30vh;
|
||||
}
|
||||
.logotext {
|
||||
font-size: 5vh;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1921px) {
|
||||
/* Ultra-large TV/4K tweaks */
|
||||
.logotext {
|
||||
letter-spacing: 0.25em; /* Better legibility at distance */
|
||||
}
|
||||
}
|
||||
|
||||
/* Main scoreboard container – full screen */
|
||||
.pagediv {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2vh;
|
||||
padding: 2.2vh 2.4vw;
|
||||
box-sizing: border-box;
|
||||
background:
|
||||
radial-gradient(circle at top left, var(--bg-soft), transparent 60%),
|
||||
radial-gradient(circle at bottom right, var(--bg-soft), transparent 60%);
|
||||
}
|
||||
|
||||
.pagediv.manuel {
|
||||
padding-right: clamp(60px, 2.4vw, 2.4vw);
|
||||
}
|
||||
|
||||
/* Common row styling */
|
||||
.display-row {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30px;
|
||||
border-radius: var(--radius-lg);
|
||||
background: linear-gradient(135deg, var(--panel-soft), var(--panel));
|
||||
border-bottom: var(--border-subtle);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-soft);
|
||||
}
|
||||
|
||||
.display-row::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at top left, var(--bg-soft), transparent 55%);
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.row1text,
|
||||
.row2text p,
|
||||
.row3 > p,
|
||||
.start_text {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
/* Row 1: athlete name */
|
||||
.row1text {
|
||||
font-size: min(8vh, 4.6vw);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Row 2: club, program, start/stop */
|
||||
.row2 {
|
||||
justify-content: space-between;
|
||||
gap: 2vw;
|
||||
}
|
||||
|
||||
.row2::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at bottom right, var(--colorStartDiv), transparent 55%);
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.row2text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8vh;
|
||||
width: 50vw;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.row2_1text {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.row2_2text {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Start / stop pill */
|
||||
.start_div {
|
||||
width: 35vw;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.start_text {
|
||||
display: flex;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Row 3: D-score and total */
|
||||
.row3 {
|
||||
justify-content: space-between;
|
||||
gap: 2vw;
|
||||
}
|
||||
|
||||
.row3 > p {
|
||||
font-size: min(9vh, 5vw);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.row3_1text {
|
||||
color: var(--color-note-l);
|
||||
}
|
||||
|
||||
.row3_2text {
|
||||
color: var(--color-note-r);
|
||||
}
|
||||
|
||||
/* Existing #score and char/row styles if you use them elsewhere */
|
||||
#score {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.char {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 40vw;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
font-size: 20vw;
|
||||
}
|
||||
|
||||
/* Landscape / portrait logo scaling */
|
||||
@media (orientation: landscape) {
|
||||
.logoimg {
|
||||
max-height: 60vh;
|
||||
}
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
.logoimg {
|
||||
max-width: 60vw;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small screens – keep everything readable */
|
||||
@media (max-width: 768px) {
|
||||
.pagediv {
|
||||
padding: 1.6vh 3vw;
|
||||
gap: 1.4vh;
|
||||
}
|
||||
|
||||
.display-row {
|
||||
padding: 1.4vh 3vw;
|
||||
}
|
||||
|
||||
.row2 {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.start_div {
|
||||
align-self: flex-end;
|
||||
min-width: 40vw;
|
||||
}
|
||||
}
|
||||
|
||||
.noWsConnection {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
|
||||
transform: rotate(270deg);
|
||||
transform-origin: right bottom;
|
||||
}
|
||||
|
||||
.rotator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
.noWsConnection img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.noWsConnection p {
|
||||
font-size: 20px;
|
||||
color: var(--text-muted);
|
||||
margin: 0;
|
||||
letter-spacing: 1.1px;
|
||||
}
|
||||
@@ -1,439 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
|
||||
$fullDomain = $protocol . $_SERVER['HTTP_HOST'];*/
|
||||
|
||||
$lastSegment = strtolower($_GET['geraet']) ?? '';
|
||||
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once $baseDir . '/../scripts/db/db-verbindung-script-guest.php';
|
||||
require_once $baseDir . '/../scripts/db/db-functions.php';
|
||||
require_once $baseDir . '/../scripts/db/db-tables.php';
|
||||
|
||||
$stmt = $guest->prepare("SELECT `name` FROM $tableGeraete ORDER BY start_index ASC");
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
http_response_code(500);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$disciplines = array_map(
|
||||
'strtolower',
|
||||
array_column($result->fetch_all(MYSQLI_ASSOC), 'name')
|
||||
);
|
||||
|
||||
$stmt->close();
|
||||
|
||||
// Define a small helper function to keep the code DRY (Don't Repeat Yourself)
|
||||
function sanitize_hex($color) {
|
||||
return preg_replace('/[^0-9a-fA-F#]/', '', $color);
|
||||
}
|
||||
|
||||
// Fetch and Sanitize Brand Colors
|
||||
$wkName = db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['wkName']);
|
||||
$cleanColor = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColourLogo']));
|
||||
$cleanColorText = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayTextColourLogo']));
|
||||
|
||||
// Fetch and Sanitize Layout Colors
|
||||
$displayColorScoringBg = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringBg']));
|
||||
$displayColorScoringBgSoft = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringBgSoft']));
|
||||
$displayColorScoringPanel = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanel']));
|
||||
$displayColorScoringPanelSoft = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanelSoft']));
|
||||
|
||||
// Fetch and Sanitize Text Colors
|
||||
$displayColorScoringPanelText = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanelText']));
|
||||
$displayColorScoringPanelTextSoft = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanelTextSoft']));
|
||||
|
||||
// Fetch and Sanitize Accent Colors (Note: fixed 'diplay' typo here)
|
||||
$displayColorScoringPanelTextNoteL = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanelTextNoteL']));
|
||||
$displayColorScoringPanelTextNoteR = sanitize_hex(db_get_var($guest, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['displayColorScoringPanelTextNoteR']));
|
||||
|
||||
$guest->close();
|
||||
|
||||
if (!isset($lastSegment) || !in_array($lastSegment, $disciplines)){
|
||||
echo 'kein Gerät';
|
||||
exit;
|
||||
}
|
||||
|
||||
$jsonUrlconfig = '/displays/json/config.json';
|
||||
$jsonUrl = '/displays/json/display_' . $lastSegment . '.json';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?= $wkName ?> Anzeigen</title>
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="stylesheet" href="/displays/css/display.css">
|
||||
<style>
|
||||
:root {
|
||||
/* Brand */
|
||||
--panelBgLogo: <?= $cleanColor ?>;
|
||||
--text-color: <?= $cleanColorText ?>;
|
||||
|
||||
/* Backgrounds */
|
||||
--bg: <?= $displayColorScoringBg ?>;
|
||||
--bg-soft: <?= $displayColorScoringBgSoft ?>26;
|
||||
--panel: <?= $displayColorScoringPanel ?>;
|
||||
--panel-soft: <?= $displayColorScoringPanelSoft ?>;
|
||||
|
||||
/* Typography */
|
||||
--text-main: <?= $displayColorScoringPanelText ?>;
|
||||
--text-muted: <?= $displayColorScoringPanelTextSoft ?>;
|
||||
|
||||
/* Noten */
|
||||
--color-note-l: <?= $displayColorScoringPanelTextNoteL ?>;
|
||||
--color-note-r: <?= $displayColorScoringPanelTextNoteR ?>;
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="errorws">
|
||||
<img class="logoimg" src="https://cdn-icons-png.freepik.com/512/12890/12890341.png?ga=GA1.1.991281105.1761199359">
|
||||
<p class="errortext">Keine WebSocket Verbindung</p>
|
||||
<p class="errortextSmall">Versuche Verbindung... (Versuch <span id="counterTries"></span> / <span id="counterMaxTries"></span>)</p>
|
||||
</div>
|
||||
|
||||
<div class="noWsConnection">
|
||||
<div class="rotator">
|
||||
<img src="https://cdn-icons-png.freepik.com/512/12890/12890341.png?ga=GA1.1.991281105.1761199359">
|
||||
<p>Keine WebSocket Verbindung, Syncronisation via FETCH</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="logobg">
|
||||
<img id="jsImgLogo" class="logoimg" src="/intern/img/logo-normal.png">
|
||||
<p class="logotext"><?= $wkName ?></p>
|
||||
<p class="logoctext"></p>
|
||||
</div>
|
||||
|
||||
<div class="pagediv">
|
||||
<div class="display-row row1">
|
||||
<p class="row1text"></p>
|
||||
</div>
|
||||
<div class="display-row row2">
|
||||
<div class="row2text">
|
||||
<p class="row2_1text sds"></p>
|
||||
<p class="row2_2text"></p>
|
||||
</div>
|
||||
<div class="start_div">
|
||||
<p class="start_text"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-row row3">
|
||||
<p class="row3_1text"></p>
|
||||
<p class="row3_2text"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const userAccess = "<?php echo $lastSegment; ?>_display";
|
||||
const jsonUrl = "<?php echo $jsonUrl; ?>";
|
||||
const jsonUrlconfig = "<?php echo $jsonUrlconfig; ?>";
|
||||
|
||||
// --- State Management ---
|
||||
let ws;
|
||||
let filedConectCount = 1;
|
||||
const fallbackConectCount = 10;
|
||||
const RETRY_DELAY = 1000;
|
||||
const FALLBACK_POLL_INTERVAL = 3000; // Fetch every 3 seconds if WS is dead
|
||||
|
||||
let fallbackTimer = null;
|
||||
|
||||
// Hold our current data in memory
|
||||
let displayConfig = { type: 'logo', ctext: '' };
|
||||
let currentScore = {};
|
||||
let lastUniqueId = null;
|
||||
|
||||
// UI Elements
|
||||
const counterTriesEl = document.getElementById('counterTries');
|
||||
const counterMaxTriesEl = document.getElementById('counterMaxTries');
|
||||
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
if(counterMaxTriesEl) counterMaxTriesEl.innerHTML = fallbackConectCount;
|
||||
|
||||
// --- Fullscreen Listener ---
|
||||
const fs = document.documentElement;
|
||||
document.body.addEventListener('click', () => {
|
||||
if (fs.requestFullscreen) fs.requestFullscreen();
|
||||
else if (fs.webkitRequestFullscreen) fs.webkitRequestFullscreen();
|
||||
else if (fs.mozRequestFullScreen) fs.mozRequestFullScreen();
|
||||
else if (fs.msRequestFullscreen) fs.msRequestFullscreen();
|
||||
});
|
||||
|
||||
// --- WebSocket Logic ---
|
||||
function startWebSocket() {
|
||||
console.log("Attempting WebSocket connection...");
|
||||
|
||||
try {
|
||||
ws = new WebSocket(`wss://${window.location.hostname}/ws/?access=${userAccess}`);
|
||||
} catch (err) {
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connected!");
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
document.querySelector('.noWsConnection').style.display = 'none';
|
||||
document.querySelector('.pagediv').classList.remove("manuel");
|
||||
|
||||
filedConectCount = 1;
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
|
||||
// Stop fallback polling since WS is alive
|
||||
stopFallbackPolling();
|
||||
|
||||
// Do ONE initial fetch to sync current state
|
||||
fetchFullState();
|
||||
};
|
||||
|
||||
ws.onerror = () => {
|
||||
document.querySelector('.errorws').style.display = 'flex';
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
document.querySelector('.errorws').style.display = 'flex';
|
||||
scheduleRetry();
|
||||
};
|
||||
|
||||
ws.addEventListener("message", msg => {
|
||||
let msgJSON;
|
||||
try {
|
||||
msgJSON = JSON.parse(msg.data);
|
||||
} catch (error) {
|
||||
return; // Ignore malformed messages
|
||||
}
|
||||
|
||||
// Route the incoming push data
|
||||
switch (msgJSON.type) {
|
||||
case "EINSTELLUNGEN_DISPLAY_UPDATE":
|
||||
updateSettings(msgJSON.payload.key, msgJSON.payload.value);
|
||||
break;
|
||||
case "UPDATE_DISPLAYCONTROL":
|
||||
// Expecting payload: { type: 'logo'|'ctext'|'scoring', ctext: '...' }
|
||||
displayConfig = msgJSON.payload;
|
||||
renderDOM();
|
||||
break;
|
||||
case "UPDATE_SCORE":
|
||||
// Expecting payload: the exact same structure as your jsonUrl outputs
|
||||
currentScore = msgJSON.payload;
|
||||
renderDOM();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function scheduleRetry() {
|
||||
console.log(`Retrying in ${RETRY_DELAY}ms...`);
|
||||
|
||||
if (filedConectCount >= fallbackConectCount) {
|
||||
// MAX RETRIES REACHED -> Enter Fallback Mode
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
document.querySelector('.noWsConnection').style.display = 'flex';
|
||||
document.querySelector('.pagediv').classList.add("manuel");
|
||||
startFallbackPolling();
|
||||
} else {
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
setTimeout(startWebSocket, RETRY_DELAY);
|
||||
filedConectCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Fallback Polling Logic ---
|
||||
function startFallbackPolling() {
|
||||
if (fallbackTimer === null) {
|
||||
console.warn("Starting JSON fallback polling...");
|
||||
fetchFullState(); // Fetch immediately once
|
||||
fallbackTimer = setInterval(fetchFullState, FALLBACK_POLL_INTERVAL);
|
||||
|
||||
// Optionally, keep trying to reconnect the WS slowly in the background
|
||||
setTimeout(startWebSocket, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
function stopFallbackPolling() {
|
||||
if (fallbackTimer !== null) {
|
||||
clearInterval(fallbackTimer);
|
||||
fallbackTimer = null;
|
||||
console.log("Stopped JSON fallback polling.");
|
||||
}
|
||||
}
|
||||
|
||||
// --- Data Fetching (Initial Sync & Fallback) ---
|
||||
async function fetchFullState() {
|
||||
try {
|
||||
// Fetch both config and score simultaneously
|
||||
const [resConfig, resScore] = await Promise.all([
|
||||
fetch(jsonUrlconfig + '?t=' + Date.now(), { cache: "no-store" }),
|
||||
fetch(jsonUrl + '?t=' + Date.now(), { cache: "no-store" })
|
||||
]);
|
||||
|
||||
if (resConfig.ok) displayConfig = await resConfig.json();
|
||||
if (resScore.ok) currentScore = await resScore.json();
|
||||
|
||||
renderDOM();
|
||||
} catch (err) {
|
||||
console.error("Error fetching JSON:", err);
|
||||
const container = document.getElementById('score');
|
||||
if(container) {
|
||||
container.innerHTML = "";
|
||||
container.style.backgroundColor = "black";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- The Master Renderer ---
|
||||
function renderDOM() {
|
||||
const logobg = document.querySelector('.logobg');
|
||||
const ctext = document.querySelector('.logoctext');
|
||||
|
||||
if (displayConfig.type === 'logo' || displayConfig.type === 'ctext') {
|
||||
// LOGO OR CUSTOM TEXT MODE
|
||||
if (logobg) logobg.style.opacity = "1";
|
||||
if (ctext) ctext.innerText = (displayConfig.type === 'ctext') ? (displayConfig.ctext || '') : '';
|
||||
|
||||
} else if (displayConfig.type === 'scoring') {
|
||||
// SCORING MODE
|
||||
if (logobg) logobg.style.opacity = "0";
|
||||
|
||||
if (currentScore.uniqueid !== lastUniqueId) {
|
||||
lastUniqueId = currentScore.uniqueid;
|
||||
// Reset any animation/repeat logic here if needed
|
||||
}
|
||||
|
||||
const safeText = (selector, text) => {
|
||||
const el = document.querySelector(selector);
|
||||
if (el) el.innerText = text !== undefined ? text : '';
|
||||
};
|
||||
|
||||
safeText('.row1text', `${currentScore.vorname || ''} ${currentScore.name || ''}`);
|
||||
safeText('.row2_1text', currentScore.verein ? `${currentScore.verein}, ` : '');
|
||||
safeText('.row2_2text', currentScore.programm || '');
|
||||
|
||||
const starttext = document.querySelector('.start_text');
|
||||
const row2El = document.querySelector('.row2');
|
||||
if (starttext && row2El) {
|
||||
const rootStyles = getComputedStyle(document.documentElement);
|
||||
const dangerColor = rootStyles.getPropertyValue('--danger').trim();
|
||||
const successColor = rootStyles.getPropertyValue('--success').trim();
|
||||
|
||||
if (currentScore.start === true) {
|
||||
row2El.style.setProperty('--colorStartDiv', successColor);
|
||||
starttext.innerHTML = 'Start';
|
||||
} else {
|
||||
row2El.style.setProperty('--colorStartDiv', dangerColor);
|
||||
starttext.innerHTML = 'Stop';
|
||||
}
|
||||
}
|
||||
|
||||
safeText('.row3_1text', currentScore.noteLinks);
|
||||
safeText('.row3_2text', currentScore.noteRechts);
|
||||
}
|
||||
|
||||
fitTextAll();
|
||||
}
|
||||
|
||||
// --- Settings & UI Handlers ---
|
||||
function updateSettings(type, value) {
|
||||
|
||||
const sanitizeHex = (val) => val.replace(/[^0-9a-fA-F#]/g, '');
|
||||
|
||||
switch (type) {
|
||||
case 'wkName':
|
||||
const logotext = document.querySelector('.logotext');
|
||||
if (logotext) logotext.innerHTML = value;
|
||||
break;
|
||||
case 'displayColourLogo':
|
||||
document.documentElement.style.setProperty('--panelBgLogo', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayTextColourLogo':
|
||||
document.documentElement.style.setProperty('--text-color', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringBg':
|
||||
document.documentElement.style.setProperty('--bg', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringBgSoft':
|
||||
document.documentElement.style.setProperty('--bg-soft', sanitizeHex(value) + "26");
|
||||
break;
|
||||
case 'displayColorScoringPanel':
|
||||
document.documentElement.style.setProperty('--panel', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelSoft':
|
||||
document.documentElement.style.setProperty('--panel-soft', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelText':
|
||||
document.documentElement.style.setProperty('--text-main', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextSoft':
|
||||
document.documentElement.style.setProperty('--text-muted', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextNoteL': // Matching your PHP typo
|
||||
document.documentElement.style.setProperty('--color-note-l', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextNoteR': // Matching your PHP typo
|
||||
document.documentElement.style.setProperty('--color-note-r', sanitizeHex(value));
|
||||
break;
|
||||
case 'logo-normal':
|
||||
const jsImgLogo = document.getElementById('jsImgLogo');
|
||||
if(jsImgLogo) jsImgLogo.src = '/intern/img/logo-normal.png?' + Date.now();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Text Resizing Engine ---
|
||||
function isOverflown(parent, elem, heightscale, widthscale, paddingtext) {
|
||||
return (
|
||||
(elem.scrollWidth + paddingtext) > (parent.clientWidth / widthscale) ||
|
||||
(elem.scrollHeight + paddingtext) > (parent.clientHeight / heightscale)
|
||||
);
|
||||
}
|
||||
|
||||
function fitTextElement(elem, { minSize = 10, maxSize = 1000, step = 1, unit = 'px' } = {}) {
|
||||
if (!elem) return;
|
||||
const parent = elem.parentElement;
|
||||
if (!parent) return;
|
||||
|
||||
// FIXED: Declare variables properly so they don't leak into the global scope
|
||||
let heightscale = 1;
|
||||
let widthscale = 1;
|
||||
let paddingtext = 60;
|
||||
|
||||
if (parent.classList.contains('row2text')) {
|
||||
heightscale = 2;
|
||||
paddingtext = 0;
|
||||
}
|
||||
if (parent.classList.contains('row3')) {
|
||||
widthscale = 2;
|
||||
}
|
||||
|
||||
let size = minSize;
|
||||
elem.style.whiteSpace = 'nowrap';
|
||||
elem.style.fontSize = size + unit;
|
||||
|
||||
while (size < maxSize && !isOverflown(parent, elem, heightscale, widthscale, paddingtext)) {
|
||||
size += step;
|
||||
elem.style.fontSize = size + unit;
|
||||
}
|
||||
|
||||
elem.style.fontSize = (size - step) + unit;
|
||||
}
|
||||
|
||||
function fitTextAll() {
|
||||
const paragraphs = document.querySelectorAll('.pagediv p');
|
||||
paragraphs.forEach(p => fitTextElement(p));
|
||||
}
|
||||
|
||||
window.addEventListener('resize', fitTextAll);
|
||||
|
||||
// --- Initialize ---
|
||||
startWebSocket();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>400 - Bad Request</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 400;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Ungültige Anfrage</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 400</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihre Anfrage ist fehlerhaft und das gesuchtes Ziel kann nicht gefunden werden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>400 - Bad Request</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 400;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Ungültige Anfrage</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 400</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="phpContent" id="phpMessage">
|
||||
<?= htmlspecialchars($message ?? '') ?>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihre Anfrage ist fehlerhaft und das gesuchtes Ziel kann nicht gefunden werden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>403 - Forbidden</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 403;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Anfrage verboten</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 403</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Sie haben keine Berechtigung diesen Inhalt anzuzeigen.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>429 - Too many Requests</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 429;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Zu viele Anfragen</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 429</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihr Netzwerk sendet aktuell zu viele Anfragen an diese Webseite, weshalb diese IP-Adresse temporär blockiert wurde. Versuchen Sie die Seite in wenigen Sekunden neu zu laden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>500 - Internal Server Error</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 500;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Kritischer Fehler beim Laden der Seite</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 500</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Diese Seite konnte aufgrund von Problemen auf dem Server nicht geladen werden. Bitte versuchen Sie es später erneut. Die Behebung dieses Fehlers kann einige Zeit in Anspruch nehmen.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,104 @@
|
||||
/* Modern reset and centering */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
color: #1f2937;
|
||||
min-height: 100vh;
|
||||
padding: 20vh 60px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 40px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
body {
|
||||
padding: 15vh 10px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 32px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Header section with warning color */
|
||||
.header h1 {
|
||||
font-size: 48px;
|
||||
letter-spacing: 2px;
|
||||
color: #36454F;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.05em;
|
||||
color: #6b7280;
|
||||
font-weight: 600;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
/* Sleek Language Dropdown Container */
|
||||
.lang-switcher {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
color: #4b5563;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
padding: 6px 32px 6px 12px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
appearance: none;
|
||||
/* Removes native browser arrow */
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 8px center;
|
||||
background-size: 16px;
|
||||
transition: border-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.lang-select:hover,
|
||||
.lang-select:focus {
|
||||
border-color: #01CB8E;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
/* Divider line */
|
||||
.header::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: min(120px, 50vw);
|
||||
height: 3px;
|
||||
background-color: #01CB8E;
|
||||
margin: 0 0 24px 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* PHP Text */
|
||||
.phpContent {
|
||||
font-size: 24px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563;
|
||||
}
|
||||
|
||||
/* Main text */
|
||||
.content {
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563a2;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
const translations = {
|
||||
429: {
|
||||
de: {
|
||||
title: "Zu viele Anfragen",
|
||||
subtitle: "HTTP Fehlercode 429",
|
||||
message: "Ihr Netzwerk sendet aktuell zu viele Anfragen an diese Webseite, weshalb diese IP-Adresse temporär blockiert wurde. Versuchen Sie die Seite in wenigen Sekunden neu zu laden."
|
||||
},
|
||||
en: {
|
||||
title: "Too Many Requests",
|
||||
subtitle: "HTTP Error Code 429",
|
||||
message: "Your network is currently sending too many requests to this website, which is why this IP address has been temporarily blocked. Please try reloading the page in a few seconds."
|
||||
},
|
||||
fr: {
|
||||
title: "Trop de requêtes",
|
||||
subtitle: "Code d'erreur HTTP 429",
|
||||
message: "Votre réseau envoie actuellement trop de requêtes à ce site web, c'est pourquoi cette adresse IP a été temporairement bloquée. Veuillez réessayer de charger la page dans quelques secondes."
|
||||
},
|
||||
it: {
|
||||
title: "Troppe richieste",
|
||||
subtitle: "Codice di errore HTTP 429",
|
||||
message: "La tua rete sta attualmente inviando troppe richieste a questo sito web, motivo per cui questo indirizzo IP è stato temporaneamente bloccato. Prova a ricaricare la pagina tra pochi secondi."
|
||||
}
|
||||
},
|
||||
403: {
|
||||
de: {
|
||||
title: "Anfrage verboten",
|
||||
subtitle: "HTTP Fehlercode 403",
|
||||
message: "Sie haben keine Berechtigung diesen Inhalt anzuzeigen."
|
||||
},
|
||||
en: {
|
||||
title: "Forbidden",
|
||||
subtitle: "HTTP Error Code 403",
|
||||
message: "You do not have permission to view this content."
|
||||
},
|
||||
fr: {
|
||||
title: "Accès interdit",
|
||||
subtitle: "Code d'erreur HTTP 403",
|
||||
message: "Vous n'avez pas l'autorisation d'afficher ce contenu."
|
||||
},
|
||||
it: {
|
||||
title: "Accesso vietato",
|
||||
subtitle: "Codice di errore HTTP 403",
|
||||
message: "Non hai il permesso di visualizzare questo contenuto."
|
||||
}
|
||||
},
|
||||
400: {
|
||||
de: {
|
||||
title: "Ungültige Anfrage",
|
||||
subtitle: "HTTP Fehlercode 400",
|
||||
message: "Ihre Anfrage ist fehlerhaft und das gesuchte Ziel kann nicht gefunden werden."
|
||||
},
|
||||
en: {
|
||||
title: "Bad Request",
|
||||
subtitle: "HTTP Error Code 400",
|
||||
message: "Your request is malformed and the destination you are looking for cannot be found."
|
||||
},
|
||||
fr: {
|
||||
title: "Requête incorrecte",
|
||||
subtitle: "Code d'erreur HTTP 400",
|
||||
message: "Votre requête est incorrecte et la destination recherchée est introuvable."
|
||||
},
|
||||
it: {
|
||||
title: "Richiesta errata",
|
||||
subtitle: "Codice di errore HTTP 400",
|
||||
message: "La tua richiesta è errata e la destinazione cercata non è rintracciabile."
|
||||
}
|
||||
},
|
||||
500: {
|
||||
de: {
|
||||
title: "Kritischer Fehler beim Laden der Seite",
|
||||
subtitle: "HTTP Fehlercode 500",
|
||||
message: "Diese Seite konnte aufgrund von Problemen auf dem Server nicht geladen werden. Bitte versuchen Sie es später erneut. Die Behebung dieses Fehlers kann einige Zeit in Anspruch nehmen."
|
||||
},
|
||||
en: {
|
||||
title: "Critical Error Loading Page",
|
||||
subtitle: "HTTP Error Code 500",
|
||||
message: "This page could not be loaded due to problems on the server. Please try again later. Resolving this error may take some time."
|
||||
},
|
||||
fr: {
|
||||
title: "Erreur critique lors du chargement de la page",
|
||||
subtitle: "Code d'erreur HTTP 500",
|
||||
message: "Cette page n'a pas pu être chargée en raison de problèmes sur le serveur. Veuillez réessayer plus tard. La résolution de cette erreur peut prendre un certain temps."
|
||||
},
|
||||
it: {
|
||||
title: "Errore critico durante il caricamento della pagina",
|
||||
subtitle: "Codice di errore HTTP 500",
|
||||
message: "Impossibile caricare la pagina a causa di problemi sul server. Si prega di riprovare più tardi. La risoluzione di questo errore potrebbe richiedere del tempo."
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const errortype = window.ERROR_CODE;
|
||||
|
||||
function translatePage(lang) {
|
||||
document.documentElement.lang = lang;
|
||||
|
||||
document.getElementById('title').textContent = translations[errortype][lang].title;
|
||||
document.getElementById('subtitle').textContent = translations[errortype][lang].subtitle;
|
||||
document.getElementById('message').textContent = translations[errortype][lang].message;
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const browserLang = navigator.language || navigator.userLanguage;
|
||||
|
||||
const shortLang = browserLang.toLowerCase().split('-')[0];
|
||||
|
||||
const supportedLangs = ['de', 'en', 'fr', 'it'];
|
||||
|
||||
if (supportedLangs.includes(shortLang)) {
|
||||
const selectEl = document.getElementById('langSelect');
|
||||
selectEl.value = shortLang; // Changes the dropdown visual state
|
||||
translatePage(shortLang); // Runs your translation function
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
RewriteEngine On
|
||||
|
||||
# ----------------------------------------
|
||||
# 1) Root → router.php
|
||||
# ----------------------------------------
|
||||
RewriteRule ^$ router.php [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 2) Allow existing files
|
||||
# ----------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} -f
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 3) Allow existing directories
|
||||
# ----------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# ----------------------------------------
|
||||
# 4) Everything else → router.php
|
||||
# ----------------------------------------
|
||||
RewriteRule ^ router.php [QSA,L]
|
||||
@@ -0,0 +1,322 @@
|
||||
<?php
|
||||
|
||||
if (!isset($segments) || !defined('APP_ROUTER')) {
|
||||
http_response_code(403);
|
||||
include $baseDir . "/error-pages/403.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
$type = $segments[1] ?? null;
|
||||
$requested_geraet = htmlspecialchars($segments[2] ?? '');
|
||||
|
||||
$allowed_types = ["audioplayer"];
|
||||
|
||||
if (!in_array($type, $allowed_types)) {
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session(true);
|
||||
|
||||
$csrf_token = $_SESSION['csrf_token'] ?? '';
|
||||
|
||||
require $baseDir . '/../scripts/websocket/ws-create-token.php';
|
||||
|
||||
$WSaccesstype = "audio";
|
||||
$WSaccessPermission = "R";
|
||||
|
||||
require_once $baseDir . '/../scripts/db/db-verbindung-script-guest.php';
|
||||
require_once $baseDir . '/../scripts/db/db-functions.php';
|
||||
require_once $baseDir . '/../scripts/db/db-tables.php';
|
||||
|
||||
$stmt = $guest->prepare("SELECT `name`, `id` FROM $tableGeraete WHERE `audiofile` = '1' ORDER BY start_index ASC");
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
http_response_code(500);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$disciplines = $result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$lowerDisciplines = array_change_key_case(
|
||||
array_column($disciplines, 'id', 'name'),
|
||||
CASE_LOWER
|
||||
);
|
||||
|
||||
$disciplines_indexed = array_column($disciplines, 'name', 'id');
|
||||
|
||||
|
||||
if (!array_key_exists($requested_geraet, $lowerDisciplines)) {
|
||||
http_response_code(400);
|
||||
$message = 'Das gesuchte Gerät kann nicht gefunden werden';
|
||||
include $baseDir . "/error-pages/400.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($lowerDisciplines[$requested_geraet])) {
|
||||
http_response_code(500);
|
||||
include $baseDir . "/error-pages/500.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$geraetId = $lowerDisciplines[$requested_geraet];
|
||||
|
||||
$WSaccess = (string) $geraetId;
|
||||
|
||||
$jsonUrl = '/externe-geraete/json/audio-id-' . $geraetId . '.json';
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Remote Audioplayer</title>
|
||||
<meta name="robots" content="noindex">
|
||||
<script src="/intern/js/jquery/jquery-3.7.1.min.js"></script>
|
||||
<script src="/intern/js/custom-msg-display.js"></script>
|
||||
<link rel="stylesheet" href="/intern/css/custom-msg-display.css">
|
||||
<link rel="stylesheet" href="/externe-geraete/css/audio.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Audioplayer</h1>
|
||||
<p id="subtitle"><?= $disciplines_indexed[$geraetId] ?></p>
|
||||
</div>
|
||||
|
||||
<button class="startButton">
|
||||
Audioplayer starten
|
||||
</button>
|
||||
|
||||
<div class="currentyPlaying hidden">
|
||||
Aktuell laufendes Audio:
|
||||
<div class="subDivCurrentyPlaying">
|
||||
<span>Dateiname: <span class="spanFilename"></span></span>
|
||||
<span class="spanPersonname">Name der Person:
|
||||
<span class="spanPersonnameName"></span>,
|
||||
<span class="spanPersonnameVorname"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="progressDiv">
|
||||
<div id="progressContainer">
|
||||
<div id="progressBar"></div>
|
||||
</div>
|
||||
|
||||
<span class="progressText"><span id="currentText">0:00</span> / <span id="durationText">0:00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Dies ist der Live Audioplayer. Audio kann über die Kampfrichteransicht gestartet werden.
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<audio id="peep" preload="auto"></audio>
|
||||
<audio id="musicPlayer" preload="auto"></audio>
|
||||
<script>
|
||||
const WSaccesstype = "<?= $WSaccesstype ?>";
|
||||
const WSaccess = "<?= $WSaccess ?>";
|
||||
const csrf_token = "<?= $csrf_token ?>";
|
||||
const WSaccessPermission = "<?= $WSaccessPermission ?>"
|
||||
|
||||
const jsonUrl = "<?php echo $jsonUrl; ?>";
|
||||
|
||||
let ws;
|
||||
|
||||
let firstConnect = true;
|
||||
const RETRY_DELAY = 2000;
|
||||
|
||||
const urlAjaxNewWSToken = '/intern/scripts/ajax-create-ws-token.php';
|
||||
|
||||
async function fetchNewWSToken(accesstype, access, accessPermission) {
|
||||
try {
|
||||
const response = await fetch(urlAjaxNewWSToken, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
csrf_token,
|
||||
accesstype,
|
||||
access,
|
||||
accessPermission
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) return null;
|
||||
|
||||
const data = await response.json();
|
||||
return data.success ? data.token : null;
|
||||
} catch (error) {
|
||||
console.error("Token fetch failed:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function startWebSocket() {
|
||||
console.log("Attempting WebSocket connection...");
|
||||
|
||||
let token;
|
||||
if (firstConnect) {
|
||||
token = '<?= generateWSReadToken($WSaccesstype, $WSaccess) ?>';
|
||||
} else {
|
||||
token = await fetchNewWSToken(WSaccesstype, WSaccess, WSaccessPermission);
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
console.error("No valid token available. Retrying...");
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ws = new WebSocket(`wss://${window.location.hostname}/ws/?access=token&token=${token}`);
|
||||
} catch (err) {
|
||||
console.error("Malformed WebSocket URL", err);
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connected!");
|
||||
if (!firstConnect) {
|
||||
displayMsg(1, "Live Syncronisation wieder verfügbar");
|
||||
}
|
||||
firstConnect = true;
|
||||
};
|
||||
|
||||
ws.onerror = (event) => {
|
||||
console.error("WebSocket error observed.");
|
||||
};
|
||||
|
||||
ws.onclose = (event) => {
|
||||
displayMsg(0, "Live Syncronisation verloren");
|
||||
firstConnect = false;
|
||||
|
||||
scheduleRetry();
|
||||
};
|
||||
}
|
||||
|
||||
function scheduleRetry() {
|
||||
console.log(`Retrying in ${RETRY_DELAY}ms...`);
|
||||
setTimeout(startWebSocket, RETRY_DELAY);
|
||||
}
|
||||
|
||||
startWebSocket();
|
||||
|
||||
const spanFilename = $('.spanFilename');
|
||||
const spanPersonname = $('.spanPersonname');
|
||||
const spanPersonnameName = $('.spanPersonnameName');
|
||||
const spanPersonnameVorname = $('.spanPersonnameVorname');
|
||||
|
||||
const currentyPlaying = $('.currentyPlaying');
|
||||
|
||||
const $progressBar = $('#progressBar');
|
||||
const $progressContainer = $('#progressContainer');
|
||||
|
||||
const peep = document.getElementById('peep');
|
||||
const music = document.getElementById('musicPlayer');
|
||||
const $audio = $('#musicPlayer');
|
||||
|
||||
let lastMusicUrl = null;
|
||||
let pollingStarted = false; // ensure we start polling only once
|
||||
|
||||
async function fetchAndHandleMusic() {
|
||||
try {
|
||||
const response = await fetch(jsonUrl + '?t=' + Date.now(), { cache: 'no-store' });
|
||||
const data = await response.json();
|
||||
|
||||
if (!data.audio_path || data.audio_path === 'nan' || data.start == false) {
|
||||
if (!music.paused) {
|
||||
music.pause();
|
||||
music.currentTime = 0;
|
||||
}
|
||||
if (!peep.paused) {
|
||||
peep.pause();
|
||||
peep.currentTime = 0;
|
||||
}
|
||||
lastMusicUrl = null;
|
||||
return;
|
||||
}
|
||||
|
||||
peep.src = '/files/music/piep.mp3';
|
||||
music.src = data.audio_path;
|
||||
music.currentTime = 0;
|
||||
peep.play().then(() => {
|
||||
setTimeout(() => {
|
||||
music.play().catch(err => console.log('Music play error:', err));
|
||||
}, 2000);
|
||||
}).catch(err => console.log('Peep play error:', err));
|
||||
|
||||
spanFilename.text(data.audio_name ?? '');
|
||||
spanPersonnameName.text(data.person.name ?? '');
|
||||
spanPersonnameVorname.text(data.person.vorname ?? '');
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching JSON:', err);
|
||||
}
|
||||
}
|
||||
|
||||
function formatTime(seconds) {
|
||||
if (isNaN(seconds)) return "0:00";
|
||||
const mins = Math.floor(seconds / 60);
|
||||
const secs = Math.floor(seconds % 60);
|
||||
return mins + ":" + (secs < 10 ? '0' : '') + secs;
|
||||
}
|
||||
|
||||
const audioDOM = $audio[0];
|
||||
|
||||
$audio.on('timeupdate', function() {
|
||||
if (audioDOM.duration) {
|
||||
const percentage = (audioDOM.currentTime / audioDOM.duration) * 100;
|
||||
$progressBar.css('width', percentage + '%');
|
||||
$('#currentText').text(formatTime(audioDOM.currentTime));
|
||||
}
|
||||
});
|
||||
|
||||
$audio.on('loadedmetadata', function() {
|
||||
$('#durationText').text(formatTime(audioDOM.duration));
|
||||
});
|
||||
|
||||
let isActive = false;
|
||||
|
||||
$('.startButton').on('click', function() {
|
||||
isActive = !isActive;
|
||||
if (isActive) {
|
||||
$(this).text('Audioplayer stoppen');
|
||||
} else {
|
||||
$(this).text('Audioplayer starten');
|
||||
currentyPlaying.addClass('hidden');
|
||||
if (!music.paused) {
|
||||
music.pause();
|
||||
music.currentTime = 0;
|
||||
}
|
||||
if (!peep.paused) {
|
||||
peep.pause();
|
||||
peep.currentTime = 0;
|
||||
}
|
||||
}
|
||||
$('section').toggleClass('playerActive', isActive);
|
||||
|
||||
|
||||
if (!pollingStarted) {
|
||||
pollingStarted = true;
|
||||
ws.addEventListener("message", () => {
|
||||
if (isActive) {
|
||||
fetchAndHandleMusic();
|
||||
currentyPlaying.removeClass('hidden');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,154 @@
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
color: #1f2937;
|
||||
min-height: 100vh;
|
||||
padding: 20vh 60px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 40px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
body {
|
||||
padding: 15vh 10px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 32px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 48px;
|
||||
letter-spacing: 2px;
|
||||
color: #36454F;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.05em;
|
||||
color: #6b7280;
|
||||
font-weight: 600;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
|
||||
.startButton {
|
||||
font-family: inherit;
|
||||
font-size: 28px;
|
||||
color: #4b5563;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
padding: 6px 12px 6px 12px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
appearance: none;
|
||||
transition: border-color 0.15s ease, color 0.15s ease;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.startButton:hover,
|
||||
.startButton:focus {
|
||||
border-color: #01CB8E;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
section.playerActive .startButton:hover,
|
||||
section.playerActive .startButton:focus {
|
||||
border-color: #cb0198;
|
||||
}
|
||||
|
||||
.header::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: min(240px, 50vw);
|
||||
height: 8px;
|
||||
background-color: #cb0198;
|
||||
margin: 0 0 24px 0;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
section.playerActive .header::after {
|
||||
background-color: #01CB8E;
|
||||
}
|
||||
|
||||
.currentyPlaying {
|
||||
font-size: 20px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.subDivCurrentyPlaying {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.spanPersonnameName {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.subDivCurrentyPlaying {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563a2;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#progressContainer {
|
||||
width: 100%;
|
||||
background: #e0e0e0;
|
||||
height: 10px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#progressBar {
|
||||
width: 0%;
|
||||
background: #2196F3;
|
||||
height: 100%;
|
||||
transition: width 0.1s linear;
|
||||
}
|
||||
|
||||
.progressDiv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
width: min(100%, 300px);
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
border: 1px solid #a3a8af;
|
||||
border-radius: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.progressText {
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -0,0 +1,402 @@
|
||||
:root {
|
||||
--display-bg: #111827;
|
||||
--display-panel: #020617;
|
||||
--display-panel-soft: #0b1120;
|
||||
--display-accent: #38bdf8;
|
||||
--display-accent-soft: rgba(56, 189, 248, 0.15);
|
||||
--display-text-main: #e5e7eb;
|
||||
--display-text-muted: #9ca3af;
|
||||
--display-danger: #ef4444;
|
||||
--display-success: #22c55e;
|
||||
--display-shadow: #0f172ad9;
|
||||
--display-radius-lg: 18px;
|
||||
--display-border: #94a3b859;
|
||||
--display-transition-fast: 180ms ease-out;
|
||||
--display-colorStartDiv: #0b1120;
|
||||
--display-panelBgLogo: #4a2f96;
|
||||
--display-font-heading: clamp(1.5rem, 6vh, 4rem);
|
||||
--display-font-sub: clamp(1rem, 3.5vh, 2.2rem);
|
||||
--display-logo-size: clamp(150px, 40vh, 500px);
|
||||
--display-error-WS-text: #a7e1fa;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
head>* {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.displayDiv {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.displayDiv {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background-color: var(--display-bg);
|
||||
color: var(--display-text-main);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* WebSocket error overlay */
|
||||
.displayDiv.errorws {
|
||||
position: relative;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 0;
|
||||
background: radial-gradient(circle at top, #020617 0, #020617 55%);
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.displayDiv.errorws svg {
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
position: absolute;
|
||||
top: 20vh;
|
||||
}
|
||||
|
||||
.displayDiv.errorws .logoimg {
|
||||
max-width: var(--display-logo-size);
|
||||
height: auto;
|
||||
margin-bottom: 2vh;
|
||||
filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
|
||||
}
|
||||
|
||||
.divErrorTextWs {
|
||||
position: absolute;
|
||||
bottom: 5vh;
|
||||
}
|
||||
|
||||
.errortext {
|
||||
margin: 0;
|
||||
font-size: clamp(1.8rem, 8vw, 5rem);
|
||||
line-height: 1.1;
|
||||
max-width: 90vw;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: var(--display-error-WS-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.errortextSmall {
|
||||
margin: 10px;
|
||||
font-size: clamp(0.5rem, 3vw, 2rem);
|
||||
opacity: 0.8;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--display-error-WS-text);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Startup logo overlay */
|
||||
.logobg {
|
||||
padding: 4vh;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
background-color: var(--display-panelBgLogo);
|
||||
z-index: 1000;
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
|
||||
.logoimg {
|
||||
width: auto;
|
||||
max-height: min(45vh, 100%);
|
||||
max-width: min(80vw, 100%);
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.logotext {
|
||||
margin: 0;
|
||||
font-size: clamp(1.8rem, 7vh, 6rem);
|
||||
text-align: center;
|
||||
width: 90vw;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.logotext,
|
||||
.logoctext {
|
||||
color: var(--display-text-color) !important;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
margin-top: 1vh;
|
||||
}
|
||||
|
||||
.logoctext {
|
||||
margin: calc(clamp(2rem, 7vw, 12rem) / calc(100% / 10)) 0;
|
||||
font-size: clamp(2rem, 7vw, 12rem);
|
||||
}
|
||||
|
||||
/* 4. Responsive adjustments for different screen ratios */
|
||||
@media (aspect-ratio: 4/3),
|
||||
(aspect-ratio: 10/7) {
|
||||
|
||||
/* Tablet specific tweaks (iPad/Android Tabs) */
|
||||
:root {
|
||||
--display-logo-size: 30vh;
|
||||
}
|
||||
|
||||
.logotext {
|
||||
font-size: 5vh;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1921px) {
|
||||
|
||||
/* Ultra-large TV/4K tweaks */
|
||||
.logotext {
|
||||
letter-spacing: 0.25em;
|
||||
/* Better legibility at distance */
|
||||
}
|
||||
}
|
||||
|
||||
/* Main scoreboard container – full screen */
|
||||
.pagediv {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2vh;
|
||||
padding: 2.2vh 2.4vw;
|
||||
box-sizing: border-box;
|
||||
background:
|
||||
radial-gradient(circle at top left, var(--display-bg-soft), transparent 60%),
|
||||
radial-gradient(circle at bottom right, var(--display-bg-soft), transparent 60%);
|
||||
}
|
||||
|
||||
.pagediv.manuel {
|
||||
padding-right: clamp(60px, 2.4vw, 2.4vw);
|
||||
}
|
||||
|
||||
/* Common row styling */
|
||||
.display-row {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30px;
|
||||
border-radius: var(--display-radius-lg);
|
||||
background: linear-gradient(135deg, var(--display-panel-soft), var(--display-panel));
|
||||
border-bottom: 1px solid var(--display-border);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 20px 45px var(--display-shadow);
|
||||
}
|
||||
|
||||
.display-row::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at top left, var(--display-bg-soft), transparent 55%);
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.row1text,
|
||||
.row2text p,
|
||||
.row3>p,
|
||||
.start_text {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.1;
|
||||
align-self: start;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/* Row 1: athlete name */
|
||||
.row1text {
|
||||
font-size: min(8vh, 4.6vw);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Row 2: club, program, start/stop */
|
||||
.row2 {
|
||||
justify-content: space-between;
|
||||
gap: 2vw;
|
||||
}
|
||||
|
||||
.row2::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at bottom right, var(--display-colorStartDiv), transparent 55%);
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.row2text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8vh;
|
||||
width: 50vw;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.row2_1text {
|
||||
color: var(--display-text-muted);
|
||||
}
|
||||
|
||||
.row2_2text {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Start / stop pill */
|
||||
.start_div {
|
||||
width: 35vw;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.start_text {
|
||||
display: flex;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
/* Row 3: D-score and total */
|
||||
.row3 {
|
||||
justify-content: space-between;
|
||||
gap: 2vw;
|
||||
}
|
||||
|
||||
.row3>p {
|
||||
font-size: min(9vh, 5vw);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.row3_1text {
|
||||
color: var(--display-color-note-l);
|
||||
}
|
||||
|
||||
.row3_2text {
|
||||
color: var(--display-color-note-r);
|
||||
}
|
||||
|
||||
/* Existing #score and char/row styles if you use them elsewhere */
|
||||
#score {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.char {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 40vw;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
font-size: 20vw;
|
||||
}
|
||||
|
||||
/* Landscape / portrait logo scaling */
|
||||
@media (orientation: landscape) {
|
||||
.logoimg {
|
||||
max-height: min(60vh, 100%);
|
||||
}
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
.logoimg {
|
||||
max-width: min(60vw, 100%);
|
||||
}
|
||||
}
|
||||
|
||||
/* Small screens – keep everything readable */
|
||||
@media (max-width: 768px) {
|
||||
.pagediv {
|
||||
padding: 1.6vh 3vw;
|
||||
gap: 1.4vh;
|
||||
}
|
||||
|
||||
.display-row {
|
||||
padding: 1.4vh 3vw;
|
||||
}
|
||||
|
||||
.row2 {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.start_div {
|
||||
align-self: flex-end;
|
||||
min-width: 40vw;
|
||||
}
|
||||
}
|
||||
|
||||
.noWsConnection {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
|
||||
transform: rotate(270deg);
|
||||
transform-origin: right bottom;
|
||||
}
|
||||
|
||||
.rotator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
.noWsConnection img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.noWsConnection p {
|
||||
font-size: 20px;
|
||||
color: var(--display-text-muted);
|
||||
margin: 0;
|
||||
letter-spacing: 1.1px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ctext .cTextHidden {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -0,0 +1,814 @@
|
||||
<?php
|
||||
|
||||
if (!isset($segments) || !defined('APP_ROUTER')) {
|
||||
http_response_code(403);
|
||||
include $baseDir . "/error-pages/403.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
$type = $segments[1] ?? null;
|
||||
$requested_geraet = htmlspecialchars($segments[2] ?? '');
|
||||
|
||||
$allowed_types = ["display"];
|
||||
|
||||
if (!in_array($type, $allowed_types)) {
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session(true);
|
||||
|
||||
$csrf_token = $_SESSION['csrf_token'] ?? '';
|
||||
|
||||
require $baseDir . '/../scripts/websocket/ws-create-token.php';
|
||||
|
||||
$WSaccesstype = "display";
|
||||
$WSaccessPermission = "R";
|
||||
|
||||
require_once $baseDir . '/../scripts/db/db-verbindung-script-guest.php';
|
||||
require_once $baseDir . '/../scripts/db/db-functions.php';
|
||||
require_once $baseDir . '/../scripts/db/db-tables.php';
|
||||
|
||||
$stmt = $guest->prepare("SELECT `name`, `id` FROM $tableGeraete ORDER BY start_index ASC");
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
http_response_code(500);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = $stmt->get_result();
|
||||
$disciplines = $result->fetch_all(MYSQLI_ASSOC);
|
||||
$lowerDisciplines = array_change_key_case(
|
||||
array_column($disciplines, 'id', 'name'),
|
||||
CASE_LOWER
|
||||
);
|
||||
|
||||
|
||||
if (!array_key_exists($requested_geraet, $lowerDisciplines)) {
|
||||
http_response_code(400);
|
||||
$message = 'Das gesuchte Gerät kann nicht gefunden werden';
|
||||
include $baseDir . "/error-pages/400.php";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($lowerDisciplines[$requested_geraet])) {
|
||||
http_response_code(500);
|
||||
include $baseDir . "/error-pages/500.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
$geraetId = $lowerDisciplines[$requested_geraet];
|
||||
|
||||
$WSaccess = (string) $geraetId;
|
||||
|
||||
|
||||
$stmt->close();
|
||||
|
||||
// Define a small helper function to keep the code DRY (Don't Repeat Yourself)
|
||||
function sanitize_hex($color) {
|
||||
return preg_replace('/[^0-9a-fA-F#]/', '', $color);
|
||||
}
|
||||
|
||||
$keysNeeded = [
|
||||
'wkName', 'displayColourLogo', 'displayTextColourLogo', 'displayColorScoringBg',
|
||||
'displayColorScoringBgSoft', 'displayColorScoringPanel', 'displayColorScoringPanelSoft', 'displayColorScoringBorderColor',
|
||||
'displayColorScoringShadowColor', 'displayColorScoringPanelText', 'displayColorScoringPanelTextSoft',
|
||||
'displayColorScoringPanelTextNoteL', 'displayColorScoringPanelTextNoteR', 'displayIdNoteL',
|
||||
'displayIdNoteR', 'displayCTextLogo', 'displayCTextWKName'
|
||||
];
|
||||
|
||||
$placeholders = implode(',', array_fill(0, count($keysNeeded), '?'));
|
||||
|
||||
$query = "SELECT `name`, `value` FROM $tableVar WHERE `name` IN ($placeholders)";
|
||||
|
||||
$stmt = $guest->prepare($query);
|
||||
$params = str_repeat("s", count($keysNeeded));
|
||||
$stmt->bind_param($params, ...$keysNeeded);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
$config = [];
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$config[$row['name']] = $row['value'];
|
||||
}
|
||||
|
||||
$wkName = $config['wkName'] ?? null;
|
||||
$displayCTextDisplayLogo = $config['displayCTextLogo'] ?? null;
|
||||
$displayCTextDisplayWKName = $config['displayCTextWKName'] ?? null;
|
||||
$cleanColor = $config['displayColourLogo'] ?? null;
|
||||
$cleanColorText = $config['displayTextColourLogo'] ?? null;
|
||||
$displayColorScoringBg = $config['displayColorScoringBg'] ?? null;
|
||||
$displayColorScoringBgSoft = $config['displayColorScoringBgSoft'] ?? null;
|
||||
$displayColorScoringPanel = $config['displayColorScoringPanel'] ?? null;
|
||||
$displayColorScoringPanelSoft = $config['displayColorScoringPanelSoft'] ?? null;
|
||||
$displayColorScoringShadowColor = $config['displayColorScoringShadowColor'] ?? null;
|
||||
$displayColorScoringBorderColor = $config['displayColorScoringBorderColor'] ?? null;
|
||||
$displayColorScoringPanelText = $config['displayColorScoringPanelText'] ?? null;
|
||||
$displayColorScoringPanelTextSoft = $config['displayColorScoringPanelTextSoft'] ?? null;
|
||||
$displayColorScoringPanelTextNoteL = $config['displayColorScoringPanelTextNoteL'] ?? null;
|
||||
$displayColorScoringPanelTextNoteR = $config['displayColorScoringPanelTextNoteR'] ?? null;
|
||||
|
||||
$stmt->close();
|
||||
|
||||
$guest->close();
|
||||
|
||||
$jsonUrlconfig = '/externe-geraete/json/config.json';
|
||||
$jsonUrl = '/externe-geraete/json/display-id-' . $geraetId . '.json';
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?= $wkName ?> Anzeigen</title>
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="stylesheet" href="/externe-geraete/css/display.css">
|
||||
<script src="/intern/js/gsap/gsap.min.js"></script>
|
||||
<script src="/intern/js/gsap/MorphSVGPlugin.min.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
|
||||
/* Brand */
|
||||
--display-panelBgLogo: <?= $cleanColor ?>;
|
||||
--display-text-color: <?= $cleanColorText ?>;
|
||||
|
||||
/* Backgrounds */
|
||||
--display-bg: <?= $displayColorScoringBg ?>;
|
||||
--display-bg-soft: <?= $displayColorScoringBgSoft ?>;
|
||||
--display-panel: <?= $displayColorScoringPanel ?>;
|
||||
--display-panel-soft: <?= $displayColorScoringPanelSoft ?>;
|
||||
|
||||
/* Shadow */
|
||||
--display-shadow: <?= $displayColorScoringShadowColor ?>;
|
||||
|
||||
/* Border */
|
||||
--display-border: <?= $displayColorScoringBorderColor ?>;
|
||||
|
||||
/* Typography */
|
||||
--display-text-main: <?= $displayColorScoringPanelText ?>;
|
||||
--display-text-muted: <?= $displayColorScoringPanelTextSoft ?>;
|
||||
|
||||
/* Noten */
|
||||
--display-color-note-l: <?= $displayColorScoringPanelTextNoteL ?>;
|
||||
--display-color-note-r: <?= $displayColorScoringPanelTextNoteR ?>;
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="displayDiv">
|
||||
<div class="errorws">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="errorSvg" viewBox="0 0 800 200">
|
||||
<defs>
|
||||
<filter id="a" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feGaussianBlur stdDeviation="8" result="blur"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="blur"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
<linearGradient id="myLinearGradient" x1="0%" y1="5%" x2="100%" y2="0%">
|
||||
<stop offset="0%" stop-color="#22c55e00" />
|
||||
<stop offset="100%" stop-color="#22c55e90" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path d="M150 100h200m100 0h200" id="errorLine" opacity=".3" stroke="#3b82f6" stroke-width="4" stroke-dasharray="10,15" stroke-linecap="round"/>
|
||||
<g transform="translate(150 100)">
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
|
||||
<rect x="-30" y="-19" width="60" height="38" rx="2" fill="#334155"/>
|
||||
<rect x="-28" y="-17" width="56" height="10" rx="2" fill="#555"/>
|
||||
<rect x="-28" y="-5" width="56" height="10" rx="2" fill="#555"/>
|
||||
<rect x="-28" y="7" width="56" height="10" rx="2" fill="#555"/>
|
||||
<text x="-26" y="-11" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">Test WKVS</text>
|
||||
|
||||
<text x="-26" y="-1" fill="#94a3b8" font-size="2.5" font-family="monospace" letter-spacing="0">WKVS,</text>
|
||||
<text x="-26" y="2.5" fill="#94a3b8" font-size="2" font-family="monospace" letter-spacing="0">EP</text>
|
||||
<rect x="0" y="-5" width="28" rx="2" height="10" fill="url(#myLinearGradient)" />
|
||||
|
||||
<text x="10" y="1" fill="#22c55e" font-size="4" font-family="monospace" letter-spacing="0.5">START</text>
|
||||
|
||||
<text x="-26" y="13" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">D 1.40</text>
|
||||
<text x="15" y="13" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">9.40</text>
|
||||
|
||||
|
||||
|
||||
<text y="70" text-anchor="middle" fill="#94a3b8" font-size="12" font-family="monospace" letter-spacing="1.5">Anzeige</text>
|
||||
</g>
|
||||
<g transform="translate(650 100)">
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
<rect x="-18" y="-15" width="36" height="10" rx="2" fill="#334155"/>
|
||||
<rect x="-18" y="2" width="36" height="10" rx="2" fill="#334155"/>
|
||||
<circle cx="10" cy="-10" r="2" fill="#10b981"/>
|
||||
<circle cx="10" cy="7" r="2" fill="#10b981"/>
|
||||
<text y="70" text-anchor="middle" fill="#94a3b8" font-size="12" font-family="monospace" letter-spacing="1.5">WKVS Server</text>
|
||||
</g>
|
||||
<path fill="#f43f5e" class="opacity0gsap" opacity=".4" d="m-14.142-70.71 5.657 5.656-5.657 5.657-5.657-5.657z" transform="translate(400 100)"/>
|
||||
<path fill="#f43f5e" class="opacity0gsap" opacity=".4" d="m42.67 39.74 5.869 1.247-1.248 5.87-5.868-1.248z" transform="translate(400 100)"/>
|
||||
<path fill="#3b82f6" class="opacity0gsap" opacity=".4" d="m-50.98 28.301 8.66 5-5 8.66-8.66-5z" transform="translate(400 100)"/>
|
||||
<g filter="url(#a)" transform="translate(400 100)">
|
||||
<path id="cross"
|
||||
d="M-30,-30 L30,30 M30,-30 L-30,30"
|
||||
stroke="#f43f5e"
|
||||
stroke-width="8"
|
||||
stroke-linecap="round"
|
||||
fill="none"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="okSvg" viewBox="0 0 800 200" style="display: none">
|
||||
<defs>
|
||||
<filter id="a" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feGaussianBlur stdDeviation="8" result="blur"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="blur"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
<linearGradient id="myLinearGradient" x1="0%" y1="5%" x2="100%" y2="0%">
|
||||
<stop offset="0%" stop-color="#22c55e00" />
|
||||
<stop offset="100%" stop-color="#22c55e90" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path d="M150 100 h500" opacity=".3" stroke="#3b82f6" stroke-width="4" stroke-dasharray="10, 15" stroke-linecap="round"/>
|
||||
<g transform="translate(150 100)">
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
|
||||
<rect x="-30" y="-19" width="60" height="38" rx="2" fill="#334155"/>
|
||||
<rect x="-28" y="-17" width="56" height="10" rx="2" fill="#555"/>
|
||||
<rect x="-28" y="-5" width="56" height="10" rx="2" fill="#555"/>
|
||||
<rect x="-28" y="7" width="56" height="10" rx="2" fill="#555"/>
|
||||
<text x="-26" y="-11" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">Test WKVS</text>
|
||||
|
||||
<text x="-26" y="-1" fill="#94a3b8" font-size="2.5" font-family="monospace" letter-spacing="0">WKVS,</text>
|
||||
<text x="-26" y="2.5" fill="#94a3b8" font-size="2" font-family="monospace" letter-spacing="0">EP</text>
|
||||
<rect x="0" y="-5" width="28" rx="2" height="10" fill="url(#myLinearGradient)" />
|
||||
|
||||
<text x="10" y="1" fill="#22c55e" font-size="4" font-family="monospace" letter-spacing="0.5">START</text>
|
||||
|
||||
<text x="-26" y="13" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">D 1.40</text>
|
||||
<text x="15" y="13" fill="#94a3b8" font-size="4" font-family="monospace" letter-spacing="0.5">9.40</text>
|
||||
|
||||
|
||||
|
||||
<text y="70" text-anchor="middle" fill="#94a3b8" font-size="12" font-family="monospace" letter-spacing="1.5">Anzeige</text>
|
||||
</g>
|
||||
<g transform="translate(650 100)">
|
||||
<circle r="45" fill="#1e293b" stroke="#3b82f6" stroke-width="3"/>
|
||||
<rect x="-18" y="-15" width="36" height="10" rx="2" fill="#334155"/>
|
||||
<rect x="-18" y="2" width="36" height="10" rx="2" fill="#334155"/>
|
||||
<circle cx="10" cy="-10" r="2" fill="#10b981"/>
|
||||
<circle cx="10" cy="7" r="2" fill="#10b981"/>
|
||||
<text y="70" text-anchor="middle" fill="#94a3b8" font-size="12" font-family="monospace" letter-spacing="1.5">WKVS Server</text>
|
||||
</g>
|
||||
|
||||
<g filter="url(#a)" transform="translate(400 100)">
|
||||
<path d="m-15-60 15 30 m30-60 -30 60" stroke="#0e0" stroke-width="8" stroke-linecap="round"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
||||
<div class="divErrorTextWs">
|
||||
<p class="errortext">Keine WebSocket Verbindung</p>
|
||||
<p class="errortextSmall">Versuche Verbindung... (Versuch <span id="counterTries"></span> / <span id="counterMaxTries"></span>)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="noWsConnection">
|
||||
<div class="rotator">
|
||||
<p>Keine WebSocket Verbindung, Syncronisation via FETCH</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="logobg">
|
||||
<img id="jsImgLogo" class="logoimg <?= (!$displayCTextDisplayLogo) ? 'cTextHidden' : '' ?>" src="/intern/img/logo-normal.png">
|
||||
<p class="logotext <?= (!$displayCTextDisplayWKName) ? 'cTextHidden' : '' ?>"><?= $wkName ?></p>
|
||||
<p class="logoctext"></p>
|
||||
</div>
|
||||
|
||||
<div class="pagediv">
|
||||
<div class="display-row row1">
|
||||
<p class="row1text"></p>
|
||||
</div>
|
||||
<div class="display-row row2">
|
||||
<div class="row2text">
|
||||
<p class="row2_1text sds"></p>
|
||||
<p class="row2_2text"></p>
|
||||
</div>
|
||||
<div class="start_div">
|
||||
<p class="start_text"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-row row3">
|
||||
<p class="row3_1text"></p>
|
||||
<p class="row3_2text"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const userAccess = "<?php echo $lastSegment; ?>_display";
|
||||
const jsonUrl = "<?php echo $jsonUrl; ?>";
|
||||
const jsonUrlconfig = "<?php echo $jsonUrlconfig; ?>";
|
||||
|
||||
// --- State Management ---
|
||||
let ws;
|
||||
let filedConectCount = 1;
|
||||
const fallbackConectCount = 5;
|
||||
const RETRY_DELAY = 3000;
|
||||
const FALLBACK_POLL_INTERVAL = 3000; // Fetch every 3 seconds if WS is dead
|
||||
const LONG_TERM_RETRY_DELAY_MULTIPLIER = 5;
|
||||
|
||||
let morphOnConnect = false;
|
||||
let morphOk = true;
|
||||
|
||||
const WSaccesstype = "<?= $WSaccesstype ?>";
|
||||
const WSaccess = "<?= $WSaccess ?>";
|
||||
const csrf_token = "<?= $csrf_token ?>";
|
||||
const WSaccessPermission = "<?= $WSaccessPermission ?>";
|
||||
let firstConnect = true;
|
||||
let longTermConnection = false;
|
||||
const urlAjaxNewWSToken = '/intern/scripts/ajax-create-ws-token.php';
|
||||
|
||||
let fallbackTimer = null;
|
||||
|
||||
// Hold our current data in memory
|
||||
let displayConfig = { type: 'logo', ctext: '' };
|
||||
let currentScore = {};
|
||||
let lastUniqueId = null;
|
||||
|
||||
const logobg = document.querySelector('.logobg');
|
||||
const ctext = document.querySelector('.logoctext');
|
||||
|
||||
// UI Elements
|
||||
let counterTriesEl = document.getElementById('counterTries');
|
||||
let counterMaxTriesEl = document.getElementById('counterMaxTries');
|
||||
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
if(counterMaxTriesEl) counterMaxTriesEl.innerHTML = fallbackConectCount;
|
||||
|
||||
// --- Fullscreen Listener ---
|
||||
const fs = document.documentElement;
|
||||
document.body.addEventListener('click', () => {
|
||||
if (fs.requestFullscreen) fs.requestFullscreen();
|
||||
else if (fs.webkitRequestFullscreen) fs.webkitRequestFullscreen();
|
||||
else if (fs.mozRequestFullScreen) fs.mozRequestFullScreen();
|
||||
else if (fs.msRequestFullscreen) fs.msRequestFullscreen();
|
||||
});
|
||||
|
||||
async function fetchNewWSToken(accesstype, access, accessPermission) {
|
||||
try {
|
||||
const response = await fetch(urlAjaxNewWSToken, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
csrf_token,
|
||||
accesstype,
|
||||
access,
|
||||
accessPermission
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) return null;
|
||||
|
||||
const data = await response.json();
|
||||
return data.success ? data.token : null;
|
||||
} catch (error) {
|
||||
console.error("Token fetch failed:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// --- WebSocket Logic ---
|
||||
async function startWebSocket() {
|
||||
console.log("Attempting WebSocket connection...");
|
||||
|
||||
let token;
|
||||
if (firstConnect) {
|
||||
token = '<?= generateWSReadToken($WSaccesstype, $WSaccess) ?>';
|
||||
} else {
|
||||
token = await fetchNewWSToken(WSaccesstype, WSaccess, WSaccessPermission);
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
console.error("No valid token available. Retrying...");
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ws = new WebSocket(`wss://${window.location.hostname}/ws/?access=token&token=${token}`);
|
||||
} catch (err) {
|
||||
console.error("Malformed WebSocket URL", err);
|
||||
scheduleRetry();
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log("WebSocket connected!");
|
||||
|
||||
if (morphOnConnect) {
|
||||
morph();
|
||||
} else {
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
document.querySelector('.noWsConnection').style.display = 'none';
|
||||
document.querySelector('.pagediv').classList.remove("manuel");
|
||||
}
|
||||
|
||||
filedConectCount = 1;
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
|
||||
firstConnect = false;
|
||||
longTermConnection = false;
|
||||
morphOnConnect = false;
|
||||
morphOk = true;
|
||||
|
||||
// Stop fallback polling since WS is alive
|
||||
stopFallbackPolling();
|
||||
|
||||
// Do ONE initial fetch to sync current state
|
||||
fetchFullState();
|
||||
};
|
||||
|
||||
ws.onerror = () => {
|
||||
if (!longTermConnection) {
|
||||
document.querySelector('.errorws').style.display = 'flex';
|
||||
document.querySelector('.errorws').style.opacity = '1';
|
||||
}
|
||||
morphOk = false;
|
||||
restore();
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
if (!longTermConnection) {
|
||||
document.querySelector('.errorws').style.display = 'flex';
|
||||
document.querySelector('.errorws').style.opacity = '1';
|
||||
}
|
||||
morphOnConnect = true;
|
||||
morphOk = false;
|
||||
restore();
|
||||
scheduleRetry();
|
||||
};
|
||||
|
||||
ws.addEventListener("message", msg => {
|
||||
let msgJSON;
|
||||
try {
|
||||
msgJSON = JSON.parse(msg.data);
|
||||
} catch (error) {
|
||||
return; // Ignore malformed messages
|
||||
}
|
||||
|
||||
// Route the incoming push data
|
||||
switch (msgJSON.type) {
|
||||
case "EINSTELLUNGEN_DISPLAY_UPDATE":
|
||||
updateSettings(msgJSON.payload.key, msgJSON.payload.value);
|
||||
break;
|
||||
case "UPDATE_DISPLAYCONTROL":
|
||||
// Expecting payload: { type: 'logo'|'ctext'|'scoring', ctext: '...' }
|
||||
displayConfig = msgJSON.payload;
|
||||
renderDOM();
|
||||
break;
|
||||
case "UPDATE_SCORE":
|
||||
// Expecting payload: the exact same structure as your jsonUrl outputs
|
||||
currentScore = msgJSON.payload;
|
||||
renderDOM();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function scheduleRetry() {
|
||||
|
||||
if (longTermConnection) {
|
||||
setTimeout(startWebSocket, RETRY_DELAY * LONG_TERM_RETRY_DELAY_MULTIPLIER);
|
||||
} else {
|
||||
console.log(`Retrying in ${RETRY_DELAY}ms...`);
|
||||
|
||||
if (filedConectCount >= fallbackConectCount) {
|
||||
// MAX RETRIES REACHED -> Enter Fallback Mode
|
||||
longTermConnection = true;
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
document.querySelector('.noWsConnection').style.display = 'flex';
|
||||
document.querySelector('.pagediv').classList.add("manuel");
|
||||
startFallbackPolling();
|
||||
} else {
|
||||
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
setTimeout(startWebSocket, RETRY_DELAY);
|
||||
filedConectCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Fallback Polling Logic ---
|
||||
function startFallbackPolling() {
|
||||
if (fallbackTimer === null) {
|
||||
console.warn("Starting JSON fallback polling...");
|
||||
fetchFullState(); // Fetch immediately once
|
||||
fallbackTimer = setInterval(fetchFullState, FALLBACK_POLL_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
function stopFallbackPolling() {
|
||||
if (fallbackTimer !== null) {
|
||||
clearInterval(fallbackTimer);
|
||||
fallbackTimer = null;
|
||||
console.log("Stopped JSON fallback polling.");
|
||||
}
|
||||
}
|
||||
|
||||
// --- Data Fetching (Initial Sync & Fallback) ---
|
||||
async function fetchFullState() {
|
||||
try {
|
||||
// Fetch both config and score simultaneously
|
||||
const [resConfig, resScore] = await Promise.all([
|
||||
fetch(jsonUrlconfig + '?t=' + Date.now(), { cache: "no-store" }),
|
||||
fetch(jsonUrl + '?t=' + Date.now(), { cache: "no-store" })
|
||||
]);
|
||||
|
||||
if (resConfig.ok) displayConfig = await resConfig.json();
|
||||
if (resScore.ok) currentScore = await resScore.json();
|
||||
|
||||
renderDOM();
|
||||
} catch (err) {
|
||||
console.error("Error fetching JSON:", err);
|
||||
const container = document.getElementById('score');
|
||||
if(container) {
|
||||
container.innerHTML = "";
|
||||
container.style.backgroundColor = "black";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- The Master Renderer ---
|
||||
function renderDOM() {
|
||||
|
||||
if (displayConfig.type === 'logo' || displayConfig.type === 'ctext') {
|
||||
// LOGO OR CUSTOM TEXT MODE
|
||||
if (logobg) {
|
||||
logobg.style.opacity = "1";
|
||||
|
||||
if (displayConfig.type === 'logo') logobg.classList.remove('ctext');
|
||||
if (displayConfig.type === 'ctext') logobg.classList.add('ctext');
|
||||
}
|
||||
if (ctext) {
|
||||
ctext.innerText = (displayConfig.type === 'ctext') ? (displayConfig.ctext || '') : '';
|
||||
resizeCText();
|
||||
}
|
||||
|
||||
} else if (displayConfig.type === 'scoring') {
|
||||
// SCORING MODE
|
||||
if (logobg) logobg.style.opacity = "0";
|
||||
|
||||
if (currentScore.uniqueid !== lastUniqueId) {
|
||||
lastUniqueId = currentScore.uniqueid;
|
||||
// Reset any animation/repeat logic here if needed
|
||||
}
|
||||
|
||||
const safeText = (selector, text) => {
|
||||
const el = document.querySelector(selector);
|
||||
if (el) el.innerText = text !== undefined ? text : '';
|
||||
};
|
||||
|
||||
safeText('.row1text', `${currentScore.vorname || ''} ${currentScore.name || ''}`);
|
||||
safeText('.row2_1text', currentScore.verein ? `${currentScore.verein}, ` : '');
|
||||
safeText('.row2_2text', currentScore.programm || '');
|
||||
|
||||
const starttext = document.querySelector('.start_text');
|
||||
const row2El = document.querySelector('.row2');
|
||||
if (starttext && row2El) {
|
||||
const rootStyles = getComputedStyle(document.documentElement);
|
||||
const dangerColor = rootStyles.getPropertyValue('--display-danger').trim();
|
||||
const successColor = rootStyles.getPropertyValue('--display-success').trim();
|
||||
|
||||
if (currentScore.start === true) {
|
||||
row2El.style.setProperty('--display-colorStartDiv', successColor);
|
||||
starttext.innerHTML = 'Start';
|
||||
} else {
|
||||
row2El.style.setProperty('--display-colorStartDiv', dangerColor);
|
||||
starttext.innerHTML = 'Stop';
|
||||
}
|
||||
}
|
||||
|
||||
safeText('.row3_1text', currentScore.noteLinks);
|
||||
safeText('.row3_2text', currentScore.noteRechts);
|
||||
}
|
||||
|
||||
fitTextAll();
|
||||
}
|
||||
|
||||
// --- Settings & UI Handlers ---
|
||||
function updateSettings(type, value) {
|
||||
|
||||
const sanitizeHex = (val) => val.replace(/[^0-9a-fA-F#]/g, '');
|
||||
|
||||
switch (type) {
|
||||
case 'wkName':
|
||||
const logotext = document.querySelector('.logotext');
|
||||
if (logotext) logotext.innerHTML = value;
|
||||
break;
|
||||
case 'displayColourLogo':
|
||||
document.documentElement.style.setProperty('--display-panelBgLogo', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayTextColourLogo':
|
||||
document.documentElement.style.setProperty('--display-text-color', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayCTextLogo':
|
||||
document.querySelector('.logoimg').classList.toggle('cTextHidden');
|
||||
break;
|
||||
case 'displayCTextWKName':
|
||||
document.querySelector('.logotext').classList.toggle('cTextHidden');
|
||||
break;
|
||||
case 'displayColorScoringBg':
|
||||
document.documentElement.style.setProperty('--display-bg', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringBgSoft':
|
||||
document.documentElement.style.setProperty('--display-bg-soft', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringShadowColor':
|
||||
document.documentElement.style.setProperty('--display-shadow', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringBorderColor':
|
||||
document.documentElement.style.setProperty('--display-border', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanel':
|
||||
document.documentElement.style.setProperty('--display-panel', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelSoft':
|
||||
document.documentElement.style.setProperty('--display-panel-soft', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelText':
|
||||
document.documentElement.style.setProperty('--display-text-main', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextSoft':
|
||||
document.documentElement.style.setProperty('--display-text-muted', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextNoteL': // Matching your PHP typo
|
||||
document.documentElement.style.setProperty('--display-color-note-l', sanitizeHex(value));
|
||||
break;
|
||||
case 'displayColorScoringPanelTextNoteR': // Matching your PHP typo
|
||||
document.documentElement.style.setProperty('--display-color-note-r', sanitizeHex(value));
|
||||
break;
|
||||
case 'logo-normal':
|
||||
const jsImgLogo = document.getElementById('jsImgLogo');
|
||||
if(jsImgLogo) jsImgLogo.src = '/intern/img/logo-normal.png?' + Date.now();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Text Resizing Engine ---
|
||||
function isOverflown(parent, elem, heightscale, widthscale, paddingtext) {
|
||||
return (
|
||||
(elem.scrollWidth + paddingtext) > (parent.clientWidth / widthscale) ||
|
||||
(elem.scrollHeight + paddingtext) > (parent.clientHeight / heightscale)
|
||||
);
|
||||
}
|
||||
|
||||
function fitTextElement(elem, { minSize = 10, maxSize = 1000, step = 1, unit = 'px' } = {}) {
|
||||
if (!elem) return;
|
||||
const parent = elem.parentElement;
|
||||
if (!parent) return;
|
||||
|
||||
// FIXED: Declare variables properly so they don't leak into the global scope
|
||||
let heightscale = 1;
|
||||
let widthscale = 1;
|
||||
let paddingtext = 60;
|
||||
|
||||
if (parent.classList.contains('row2text')) {
|
||||
heightscale = 2;
|
||||
paddingtext = 0;
|
||||
}
|
||||
if (parent.classList.contains('row3')) {
|
||||
widthscale = 2;
|
||||
}
|
||||
|
||||
let size = minSize;
|
||||
elem.style.whiteSpace = 'nowrap';
|
||||
elem.style.fontSize = size + unit;
|
||||
|
||||
while (size < maxSize && !isOverflown(parent, elem, heightscale, widthscale, paddingtext)) {
|
||||
size += step;
|
||||
elem.style.fontSize = size + unit;
|
||||
}
|
||||
|
||||
elem.style.fontSize = (size - step) + unit;
|
||||
}
|
||||
|
||||
function resizeCText() {
|
||||
ctext.style.fontSize = '';
|
||||
if (isOverflown(logobg, ctext, 1, 1, 0)) fitTextElement(ctext);
|
||||
}
|
||||
|
||||
function fitTextAll() {
|
||||
const paragraphs = document.querySelectorAll('.pagediv p');
|
||||
paragraphs.forEach(p => fitTextElement(p));
|
||||
resizeCText();
|
||||
}
|
||||
|
||||
window.addEventListener('resize', fitTextAll);
|
||||
|
||||
// --- Initialize ---
|
||||
startWebSocket();
|
||||
|
||||
async function morph() {
|
||||
gsap.to("#cross", {
|
||||
duration: 1,
|
||||
attr: {
|
||||
d: "M-15,-60 L0,-30 M30,-90 L0,-30"
|
||||
},
|
||||
stroke: "#0e0",
|
||||
ease: "power2.inOut"
|
||||
});
|
||||
|
||||
gsap.to(".opacity0gsap", {
|
||||
duration: 1,
|
||||
opacity: "0",
|
||||
ease: "back.out(1.7)"
|
||||
});
|
||||
|
||||
const pathStart = "M150 100 h200 m100 0 h200";
|
||||
|
||||
const pathEnd = "M150 100 h250 m0 0 h250";
|
||||
|
||||
gsap.to("#errorLine", {
|
||||
duration: 1,
|
||||
attr: { d: pathEnd },
|
||||
ease: "power2.inOut"
|
||||
});
|
||||
|
||||
gsap.to(".errortext", {
|
||||
duration: 1,
|
||||
textContent: "Verbindung Wiederhergestellt",
|
||||
ease: "back.out(1.7)"
|
||||
});
|
||||
|
||||
gsap.to(".errortextSmall", {
|
||||
duration: 1,
|
||||
textContent: "Stelle auf Wettkampfbetrieb um...",
|
||||
ease: "back.out(1.7)"
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (morphOk) {
|
||||
gsap.to('.errorws', {
|
||||
opacity: 0,
|
||||
duration: 0.5,
|
||||
overwrite: "auto"
|
||||
});
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
setTimeout(() => {
|
||||
if (morphOk) {
|
||||
document.querySelector('.errorws').style.display = 'none';
|
||||
}
|
||||
}, 3800);
|
||||
}
|
||||
|
||||
function restore() {
|
||||
// 1. Reset the Cross/Check path and color
|
||||
gsap.set("#cross", {
|
||||
attr: { d: "M-30,-30 L30,30 M30,-30 L-30,30" },
|
||||
stroke: "#f43f5e"
|
||||
});
|
||||
|
||||
// 2. Reset opacity for elements with that class
|
||||
gsap.set(".opacity0gsap", {
|
||||
opacity: ".4"
|
||||
});
|
||||
|
||||
// 3. Reset the Error Line path
|
||||
gsap.set("#errorLine", {
|
||||
attr: { d: "M150 100 h200 m100 0 h200" }
|
||||
});
|
||||
|
||||
gsap.to(".errortext", {
|
||||
duration: 1,
|
||||
textContent: "Keine WebSocket Verbindung",
|
||||
ease: "back.out(1.7)"
|
||||
});
|
||||
|
||||
document.querySelector(".errortextSmall").innerHTML = 'Versuche Verbindung... (Versuch <span id="counterTries"></span> / <span id="counterMaxTries"></span>)';
|
||||
|
||||
counterTriesEl = document.getElementById('counterTries');
|
||||
counterMaxTriesEl = document.getElementById('counterMaxTries');
|
||||
|
||||
if(counterTriesEl) counterTriesEl.innerHTML = filedConectCount;
|
||||
if(counterMaxTriesEl) counterMaxTriesEl.innerHTML = fallbackConectCount;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$request = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
|
||||
$segments = $request === '' ? [] : explode('/', $request);
|
||||
|
||||
$segments = array_map('urldecode', $segments);
|
||||
|
||||
$type = $segments[1] ?? null;
|
||||
$slug = $segments[2] ?? null;
|
||||
|
||||
$allowed_types = ["display", "audioplayer"];
|
||||
|
||||
if (($type !== null && !in_array($type, $allowed_types)) || count($segments) > 3) {
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
define('APP_ROUTER', true);
|
||||
|
||||
if ($type === "display") {
|
||||
require __DIR__ . "/display.php";
|
||||
} elseif ($type === "audioplayer") {
|
||||
require __DIR__ . "/audio.php";
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 200 KiB |
@@ -77,3 +77,130 @@
|
||||
.confirmNoButton:hover {
|
||||
background-color: rgba(255, 0, 0, 1);
|
||||
}
|
||||
|
||||
.confirmImportantHeading {
|
||||
font-size: 22px;
|
||||
margin: 0;
|
||||
letter-spacing: 1px;
|
||||
color: #36454F;
|
||||
}
|
||||
|
||||
.confirmImportantText {
|
||||
font-size: 16px;
|
||||
margin: 0;
|
||||
color: #36454F;
|
||||
}
|
||||
|
||||
.confirmImportantLabel {
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
color: #36454F;
|
||||
}
|
||||
|
||||
.confirmImportantInput {
|
||||
border: 1px solid #36454F;
|
||||
padding: 12px;
|
||||
width: 100%;
|
||||
border-radius: 12px;
|
||||
color: #36454F;
|
||||
}
|
||||
|
||||
.confirmImportantInput.notOk {
|
||||
color: #692727;
|
||||
}
|
||||
|
||||
.confirmImportantInput.ok {
|
||||
color: #2b6927;
|
||||
}
|
||||
|
||||
.confirmImportantInput:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.confirmImportantInput.notOk:focus {
|
||||
color: #8b0000;
|
||||
border-color: #692727;
|
||||
}
|
||||
|
||||
.confirmImportantInput.ok:focus {
|
||||
color: #008b00;
|
||||
border-color: #2b6927;
|
||||
}
|
||||
|
||||
|
||||
.confirmImportantInputDiv {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.confirmImportantConfrimBtn, .confirmImportantCancelBtn {
|
||||
background: #25789e;
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease filter 0.5s ease;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.confirmImportantConfrimBtn {
|
||||
background: #25789e;
|
||||
}
|
||||
|
||||
.confirmImportantCancelBtn {
|
||||
background: #9e253d;
|
||||
}
|
||||
|
||||
.blackBtn:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.blackBtn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.notValidBtn {
|
||||
user-select: none;
|
||||
cursor: not-allowed;
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
||||
.confirmImportantBtnDiv {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.confirmImportantTextDiv {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.confirmImportantBox {
|
||||
display: grid;
|
||||
padding: 20px;
|
||||
grid-template-columns: 1fr;
|
||||
position: relative;
|
||||
border-radius: 10px;
|
||||
background-color: #fff;
|
||||
width: min(500px, 90vw);
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.confirmImportantBg {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
z-index: 10000;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
backdrop-filter: blur(2px);
|
||||
background-color: #36454f2f;
|
||||
}
|
||||
@@ -23,6 +23,7 @@ table input {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.selectOptions,
|
||||
@@ -86,6 +87,6 @@ table input {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.selectLabel {
|
||||
.selectLabel:not(.sidebar-links .selectLabel) {
|
||||
font-size: 1rem;
|
||||
}
|
||||
@@ -65,7 +65,8 @@ body {
|
||||
.controls-wrapper>form {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 10px
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* From Trainer Dashboard - newBtn style */
|
||||
@@ -100,7 +101,7 @@ button[type="submit"]:active {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.change-type-form input {
|
||||
.change-type-form textarea {
|
||||
padding: 10px 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
@@ -111,7 +112,7 @@ button[type="submit"]:active {
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.change-type-form input:focus {
|
||||
.change-type-form textarea:focus {
|
||||
border-color: var(--main);
|
||||
}
|
||||
|
||||
@@ -131,6 +132,17 @@ button[type="submit"]:active {
|
||||
box-shadow: var(--card-shadow);
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
:root {
|
||||
--paddingSite: 20px;
|
||||
}
|
||||
|
||||
.iframeWithTitle {
|
||||
max-width: calc(100vw - 2 * var(--paddingSite));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.iframeWithTitle h1 {
|
||||
color: #fff;
|
||||
font-size: 1.2rem;
|
||||
|
||||
@@ -36,7 +36,6 @@ body {
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
background: var(--bg);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
::selection {
|
||||
@@ -190,13 +189,7 @@ input {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#wsInfo {
|
||||
margin: 0;
|
||||
font-weight: 300;
|
||||
opacity: 0;
|
||||
transition: all 2s ease;
|
||||
}
|
||||
|
||||
/*
|
||||
td a {
|
||||
position: relative;
|
||||
color: var(--bg-top);
|
||||
@@ -219,15 +212,7 @@ td a::after {
|
||||
td a:hover::after {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
|
||||
.payed {
|
||||
color: #099d1f;
|
||||
}
|
||||
|
||||
.notPayed,
|
||||
.inProcess {
|
||||
color: #9d1d09;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Kampfrichter header layout */
|
||||
|
||||
@@ -1166,6 +1151,7 @@ select:open {
|
||||
.settingsRowGroup {
|
||||
display: grid;
|
||||
gap: 18px;
|
||||
align-content: start;
|
||||
}
|
||||
span.light {
|
||||
font-weight: 300;
|
||||
@@ -1174,3 +1160,153 @@ span.light {
|
||||
.tableNoten input {
|
||||
width: fit-content !important;
|
||||
}
|
||||
|
||||
#css-editor-container {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cm-editor {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.cssCodeSaveBtn {
|
||||
padding: 6px 12px;
|
||||
background: var(--bg-top);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* From Uiverse.io by alexmaracinaru */
|
||||
.newBtn {
|
||||
cursor: pointer;
|
||||
font-weight: 300;
|
||||
transition: all 0.2s;
|
||||
padding: 10px 20px;
|
||||
border-radius: 100px;
|
||||
background: #1d6c6f;
|
||||
border: 1px solid transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 15px;
|
||||
align-self: flex-start;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.newBtn:disabled {
|
||||
cursor: not-allowed;
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
.newBtn:not(:disabled):hover {
|
||||
background: #1c8284;
|
||||
}
|
||||
|
||||
.newBtn>svg {
|
||||
width: 34px;
|
||||
margin-left: 10px;
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.newBtn:not(:disabled):hover svg {
|
||||
transform: translateX(5px);
|
||||
}
|
||||
|
||||
.newBtn:not(:disabled):active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
input[type="file"]#importPresetInput {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border: 2px dashed #cbd5e0;
|
||||
border-radius: 8px;
|
||||
background-color: #fafafa;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="file"]#importPresetInput::file-selector-button {
|
||||
background: #1d6c6f;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gridWKVSConfig {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 60px;
|
||||
}
|
||||
|
||||
.importWKVSConfigDiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.displayDiv.displayDivSettings {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
aspect-ratio: 16 / 11;
|
||||
}
|
||||
|
||||
.displayDivSettings * {
|
||||
transition: scale 0.6s ease;
|
||||
scale: 1;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.oneOneGridDisplay {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 450px;
|
||||
column-gap: 40px;
|
||||
}
|
||||
|
||||
@keyframes shakeHighlit {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
25% {
|
||||
transform: rotate(10deg);
|
||||
}
|
||||
75% {
|
||||
transform: rotate(-10deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
.scaled {
|
||||
scale: 1.05;
|
||||
animation-name: shakeHighlit;
|
||||
animation-duration: 0.5s;
|
||||
}
|
||||
|
||||
.subSettingsRowGroup .settingsRow span {
|
||||
color: #36454f;
|
||||
}
|
||||
|
||||
.subSettingsRowGroup {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
align-items: end;
|
||||
gap: 16px 22px;
|
||||
padding: 20px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.subSettingsRowGroup .settingsRow {
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
--text-muted: #5e5e5e;
|
||||
--disabled-bg: #f3f4f6;
|
||||
--disabled-border: #cbd5f5;
|
||||
--main-button: #36454F;
|
||||
}
|
||||
|
||||
/* Base */
|
||||
@@ -57,11 +58,6 @@ input {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* General numeric inputs in scoring area */
|
||||
.bgSection input[type="number"] {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.nopadding {
|
||||
height: 40px;
|
||||
}
|
||||
@@ -78,13 +74,6 @@ input {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
.bgSection.open {
|
||||
width: calc(100vw - 380px);
|
||||
/* - 2 * var(--paddingSite) */
|
||||
}
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
|
||||
.headerDivKampfrichter {
|
||||
@@ -220,15 +209,6 @@ table {
|
||||
}
|
||||
}
|
||||
|
||||
.allTurnerinenDiv tr:hover {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
/*.allTurnerinenDiv tr.notHeaderRow:hover td{
|
||||
-webkit-text-stroke: 0.75px currentColor;
|
||||
color: currentColor;
|
||||
}*/
|
||||
|
||||
/* Panel with inputs (new style, light) */
|
||||
|
||||
.div_edit_values_user {
|
||||
@@ -249,11 +229,15 @@ table {
|
||||
align-items: baseline;
|
||||
font-size: 1.15rem;
|
||||
letter-spacing: 0.01em;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.current-turnerin-name {
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
color: #14141f;
|
||||
margin: 10px 0 20px 0;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.heading_fv_nextturnerin {
|
||||
@@ -289,7 +273,7 @@ table {
|
||||
.editkampfrichter_user {
|
||||
border-collapse: collapse;
|
||||
background: #f9fafb;
|
||||
border-radius: 12px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
min-width: 180px;
|
||||
box-shadow: 0 0 0 1px rgba(209, 213, 219, 0.9);
|
||||
@@ -304,10 +288,10 @@ table {
|
||||
|
||||
.editkampfrichter_user th {
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.09em;
|
||||
color: var(--text-muted);
|
||||
background: #f3f4f6;
|
||||
color: #fff;
|
||||
background: #232431;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.table_endnote_edit {
|
||||
@@ -318,7 +302,7 @@ table {
|
||||
/* Tight cell for pure input */
|
||||
|
||||
.nopadding {
|
||||
padding: 0.25rem 0.5rem !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* Inputs inside edit card */
|
||||
@@ -326,20 +310,22 @@ table {
|
||||
.fullinput {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/*padding: 0.45rem 0.6rem;*/
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border: 2px solid var(--border-subtle);
|
||||
background: #ffffff;
|
||||
color: var(--text-main);
|
||||
font-size: 0.9rem;
|
||||
color: #000;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.3;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
border-radius: 0 0 5px 5px;
|
||||
height: 40px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.fullinput:focus {
|
||||
border-color: var(--accent);
|
||||
border: 4px solid var(--accent);
|
||||
box-shadow: 0 0 0 1px rgba(45, 115, 172, 0.25);
|
||||
background: #ffffff;
|
||||
}
|
||||
@@ -348,11 +334,12 @@ table {
|
||||
|
||||
.fullinput:disabled,
|
||||
.fullinput[readonly] {
|
||||
background: none;
|
||||
background: #e2e2e2;
|
||||
border: none;
|
||||
color: #6b7280;
|
||||
color: #000;
|
||||
opacity: 1;
|
||||
cursor: auto;
|
||||
cursor: not-allowed;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.fullinput:disabled:hover,
|
||||
@@ -363,24 +350,6 @@ table {
|
||||
border-color: var(--disabled-border);
|
||||
}
|
||||
|
||||
/* Computed result fields even clearer */
|
||||
|
||||
/*[id^="e-note-"]:disabled {
|
||||
background: #fff7d6;
|
||||
background: repeating-linear-gradient(
|
||||
135deg,
|
||||
#ffefb0,
|
||||
#ffefb0 6px,
|
||||
#fff7d6 6px,
|
||||
#fff7d6 12px
|
||||
);
|
||||
border-color: #f59e0b;
|
||||
box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.7);
|
||||
color: #92400e;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
}*/
|
||||
|
||||
[id^="note-user-"]:disabled {
|
||||
background: none;
|
||||
border: none;
|
||||
@@ -444,7 +413,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-self: baseline;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
/* Variants */
|
||||
@@ -482,8 +451,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
.submit-musik-start:hover,
|
||||
.submit-musik-stopp:hover,
|
||||
.submit-display-result:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.submit-display-turnerin:active,
|
||||
@@ -491,8 +459,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
.submit-musik-start:active,
|
||||
.submit-musik-stopp:active,
|
||||
.submit-display-result:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* Burger + menu (unchanged from your style) */
|
||||
@@ -523,15 +490,16 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
background-color: #fff;
|
||||
box-shadow: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100svh;
|
||||
right: 0;
|
||||
top: 150px;
|
||||
height: fit-content;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
transform: translateX(-100%);
|
||||
transform: translateX(100%);
|
||||
z-index: 100;
|
||||
padding: 20px;
|
||||
transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
|
||||
border-radius: 20px 0 0 20px;
|
||||
transition: transform 0.2s cubic-bezier(.4, 0, .2, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@@ -544,9 +512,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
min-height: 100vh;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.innerInternMenuDiv h3 {
|
||||
@@ -621,7 +587,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
|
||||
.button_gruppe {
|
||||
border: none;
|
||||
background: #2d73ac;
|
||||
background: var(--bg-top);
|
||||
color: white;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
@@ -633,7 +599,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
}
|
||||
|
||||
.button_gruppe:hover {
|
||||
background: #245d8a;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
@@ -681,28 +646,8 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.menuBg {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 98;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
/*background: rgba(0, 0, 0, 0.15);*/
|
||||
}
|
||||
|
||||
.menuBg.menuTransition {
|
||||
transition: opacity 0.6s ease-out;
|
||||
}
|
||||
|
||||
/*.menuBg.open {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
user-select: all;
|
||||
}*/
|
||||
|
||||
.menuTransition {
|
||||
transition: all 0.6s ease-out;
|
||||
transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
|
||||
}
|
||||
|
||||
.menuTransition>.kampfrichterBurgerMenuLine {
|
||||
@@ -761,6 +706,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 601px) {
|
||||
|
||||
.div_edit_values_user,
|
||||
@@ -804,30 +750,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.msgDiv {
|
||||
position: fixed;
|
||||
bottom: 50px;
|
||||
right: 20px;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
flex-direction: column-reverse;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.msgBox {
|
||||
transform: translateX(calc(100% + 40px));
|
||||
padding: 10px 15px;
|
||||
color: #fff;
|
||||
background-color: #5b5b5b98;
|
||||
border-left: 4px solid;
|
||||
border-radius: 2px;
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
.msgBox.show {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.playcontrolDiv {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -853,7 +775,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
color: var(--bg-top);
|
||||
}
|
||||
|
||||
.adminButtonDiv input,
|
||||
.buttonNewAdminStyle {
|
||||
background-color: var(--bg-top);
|
||||
color: #fff;
|
||||
@@ -866,21 +787,16 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.adminButtonDiv input {
|
||||
margin: 10px 0 0 10px;
|
||||
}
|
||||
|
||||
.adminButtonDiv input:hover {
|
||||
filter: brightness(1.2);
|
||||
}
|
||||
|
||||
.titleSingleAbt {
|
||||
font-weight: 400;
|
||||
color: var(--bg-top);
|
||||
}
|
||||
|
||||
.adminButtonDiv {
|
||||
display: block;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
table.widefat {
|
||||
@@ -928,6 +844,13 @@ table.widefat {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@media (max-width: 750px) {
|
||||
.editUserButtons {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.div-submit-display-result, .div-submit-display-start {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -937,6 +860,8 @@ table.widefat {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 3rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.singleNotentable {
|
||||
@@ -945,6 +870,46 @@ table.widefat {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.opacity50 {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.blackBtn {
|
||||
background: var(--main-button);
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.blackBtn:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.blackBtn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tr:nth-child(odd).notpaid td {
|
||||
background-color: #fff0f0;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tr:nth-child(even).notpaid td {
|
||||
background-color: #ffe5e5;
|
||||
}
|
||||
|
||||
.customDisplayEditorTable tr.notpaid:hover td {
|
||||
background-color: #ffdbdb !important;
|
||||
}
|
||||
|
||||
select {
|
||||
appearance: none;
|
||||
/* Standard */
|
||||
@@ -961,10 +926,7 @@ select {
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
|
||||
background-image: url("data:image/svg+xml;utf8,\
|
||||
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\
|
||||
<path d='M6 9L12 15L18 9' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
|
||||
</svg>");
|
||||
background-image: url("data:image/svg+xml;utf8,\<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'><path d='M6 9L12 15L18 9' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\</svg>");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 10px center;
|
||||
background-size: 20px;
|
||||
@@ -973,8 +935,10 @@ select {
|
||||
}
|
||||
|
||||
select:open {
|
||||
background-image: url("data:image/svg+xml;utf8,\
|
||||
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\
|
||||
<path d='M18 15L12 9L6 15' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
|
||||
</svg>");
|
||||
background-image: url("data:image/svg+xml;utf8,\<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\<path d='M18 15L12 9L6 15' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\</svg>");
|
||||
}
|
||||
|
||||
.horizontalLabelWrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
body{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.page-secure-login{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.bg-secure-login-form {
|
||||
gap: 20px;
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.bg-picture-secure-login{
|
||||
width: calc(100vw - 550px);
|
||||
height: 100vh;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.bg-picture-secure-login img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 0 80px 0 0;
|
||||
display: block;
|
||||
}
|
||||
.bg-secure-login{
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
max-width: 550px;
|
||||
height: 100vh;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30px;
|
||||
}
|
||||
.bg-secure-login-form > h1{
|
||||
color: #36454F !important;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.bg-secure-login-form input[type=password], .bg-secure-login-form input[type=text]{
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
font-size: 16px;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
#access_username {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=password]:focus, .bg-secure-login-form input[type=text]:focus{
|
||||
outline: none;
|
||||
border-bottom: 1px solid #000 !important;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=password]::placeholder, .bg-secure-login-form input[type=text]::placeholder {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=submit]{
|
||||
background-color: #fff !important;
|
||||
padding: 10px 20px !important;
|
||||
margin-top: 25px !important;
|
||||
border: 1px solid #000 !important;
|
||||
color: #36454F !important;
|
||||
transition: all 0.3s ease-out !important;
|
||||
border-radius: 0px !important;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.bg-secure-login-form input[type=submit]:hover{
|
||||
background-color: #36454F !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.bg-secure-login-form > p{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.seclog_home_link{
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
top: 30px;
|
||||
right: 30px;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
}
|
||||
|
||||
.seclog_home_link > img{
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
}
|
||||
#div_showpw, #access_username {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#togglePassword {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.5s ease;
|
||||
}
|
||||
|
||||
#togglePassword:hover {
|
||||
transform: translateY(-50%) scale(1.15);
|
||||
}
|
||||
|
||||
#div_showpw{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #36454F !important;
|
||||
font-weight: 300;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
input:-webkit-autofill,
|
||||
input:-webkit-autofill:hover,
|
||||
input:-webkit-autofill:focus,
|
||||
input:-webkit-autofill:active {
|
||||
-webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
|
||||
box-shadow: 0 0 0 1000px #ffffff inset !important;
|
||||
-webkit-text-fill-color: #000000 !important;
|
||||
transition: background-color 5000s ease-in-out 0s;
|
||||
}
|
||||
@@ -9,10 +9,11 @@
|
||||
--accent: #4a5568;
|
||||
--accent-soft: #f0f5ff;
|
||||
--border-subtle: #d4d7e1;
|
||||
--text-main: #191919;
|
||||
--text-main: #36454F;
|
||||
--text-muted: #5e5e5e;
|
||||
--disabled-bg: #f3f4f6;
|
||||
--disabled-border: #cbd5f5;
|
||||
--main-button: #36454F;
|
||||
}
|
||||
|
||||
/* ── Base ─────────────────────────────────────────────── */
|
||||
@@ -71,6 +72,7 @@ input {
|
||||
width: 100vw;
|
||||
box-sizing: border-box !important;
|
||||
background: none;
|
||||
padding: 0 var(--paddingSite) 10px
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
@@ -112,7 +114,6 @@ input {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 0 var(--paddingSite) 10px;
|
||||
}
|
||||
|
||||
.bg-erfassen button[type="submit"] {
|
||||
@@ -139,7 +140,6 @@ input {
|
||||
|
||||
h3.vereine,
|
||||
h3.benutzer {
|
||||
padding: 0 var(--paddingSite);
|
||||
font-weight: 400;
|
||||
font-size: 1.15rem;
|
||||
color: var(--text-main);
|
||||
@@ -149,8 +149,7 @@ h3.benutzer {
|
||||
|
||||
/* ── Inner section (card list) ────────────────────────── */
|
||||
|
||||
.inner-pw-set-bg {
|
||||
padding: 0 var(--paddingSite);
|
||||
.benutzerGrid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
@@ -161,53 +160,62 @@ h3.benutzer {
|
||||
/* ── User / Verein card ───────────────────────────────── */
|
||||
|
||||
.single_pwedit,
|
||||
.newUserLink {
|
||||
.newUserLinkDiv {
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--card-radius);
|
||||
box-shadow: var(--card-shadow);
|
||||
padding: 24px 28px;
|
||||
transition: box-shadow 0.25s ease;
|
||||
}
|
||||
|
||||
.single_pwedit:hover,
|
||||
.newUserLink:hover {
|
||||
.newUserLinkDiv:hover {
|
||||
box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
|
||||
}
|
||||
|
||||
.single_pwedit.verein,
|
||||
.newUserLink.verein {
|
||||
.newUserLinkDiv.verein {
|
||||
border-left: 4px solid var(--bg-top);
|
||||
}
|
||||
|
||||
/* ── Form fields inside user card ─────────────────────── */
|
||||
|
||||
.single_pwedit form,
|
||||
.newUserLink form {
|
||||
.newUserLinkDiv form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14px 24px;
|
||||
align-items: flex-end;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.single_pwedit form {
|
||||
padding: 24px 28px 14px 28px;
|
||||
}
|
||||
|
||||
.newUserLinkDiv {
|
||||
padding: 24px 28px;
|
||||
}
|
||||
|
||||
.single_pwedit label,
|
||||
.newUserLink label {
|
||||
.newUserLinkDiv label {
|
||||
display: block;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 1.5px;
|
||||
color: var(--text-main);
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.single_pwedit .field-group,
|
||||
.newUserLink .field-group {
|
||||
.newUserLinkDiv .field-group {
|
||||
flex: 1 1 200px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.single_pwedit input[type="text"],
|
||||
.newUserLink input[type="text"] {
|
||||
.newUserLinkDiv input[type="text"] {
|
||||
width: 100%;
|
||||
padding: 9px 12px;
|
||||
border: 1px dashed #999;
|
||||
@@ -220,21 +228,21 @@ h3.benutzer {
|
||||
}
|
||||
|
||||
.single_pwedit input[type="text"]:focus,
|
||||
.newUserLink input[type="text"]:focus {
|
||||
.newUserLinkDiv input[type="text"]:focus {
|
||||
outline: none;
|
||||
border: 1px solid var(--bg-top);
|
||||
box-shadow: 0 0 0 3px rgba(var(--bg-top-raw) / 0.12);
|
||||
}
|
||||
|
||||
.single_pwedit input[type="text"]::placeholder,
|
||||
.newUserLink input[type="text"]::placeholder {
|
||||
.newUserLinkDiv input[type="text"]::placeholder {
|
||||
color: #b0b0b0;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* ── Buttons inside cards ─────────────────────────────── */
|
||||
|
||||
.single_pwedit button[type="submit"],
|
||||
/*.single_pwedit button[type="submit"],
|
||||
.newUserLink button[type="submit"] {
|
||||
appearance: none;
|
||||
border: 1px solid #7777778e;
|
||||
@@ -255,7 +263,7 @@ h3.benutzer {
|
||||
border-color: var(--bg-top);
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}*/
|
||||
|
||||
.delete-user-btn,
|
||||
.delete-verein-btn {
|
||||
@@ -268,7 +276,6 @@ h3.benutzer {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
|
||||
@@ -289,9 +296,30 @@ h3.benutzer {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
margin-left: 8px;
|
||||
transition: all 0.25s ease;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.userActionsDivLink {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px 10px;
|
||||
}
|
||||
|
||||
.userActionsDivLink:not(.mty) {
|
||||
padding: 14px 28px 24px 28px;
|
||||
border-top: 1px solid var(--main-button);
|
||||
}
|
||||
|
||||
.userActionsDivLink.mty {
|
||||
padding: 0 28px 10px 28px;
|
||||
}
|
||||
|
||||
.userActionsDivEdit {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.createOturl:hover {
|
||||
@@ -311,11 +339,12 @@ h3.benutzer {
|
||||
justify-content: center;
|
||||
background-color: #39393941;
|
||||
backdrop-filter: blur(2px);
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.newUserLink {
|
||||
max-width: 600px;
|
||||
max-height: 500px;
|
||||
.newUserLinkDiv {
|
||||
max-width: min(600px, 80vw);
|
||||
max-height: min(500px, 80vh);
|
||||
overflow-y: auto;
|
||||
z-index: 9999;
|
||||
}
|
||||
@@ -356,7 +385,7 @@ h3.benutzer {
|
||||
color: var(--text-main);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.perm-section-title .perm-badge {
|
||||
@@ -370,9 +399,17 @@ h3.benutzer {
|
||||
background: var(--bg-top);
|
||||
color: #fff;
|
||||
font-size: 0.7rem;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.permBadgeCount {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.permBadgeText {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.perm-section-chevron {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
@@ -386,14 +423,14 @@ h3.benutzer {
|
||||
|
||||
.perm-section-body {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
overflow: hidden auto;
|
||||
transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.perm-section.open .perm-section-body {
|
||||
max-height: 500px;
|
||||
max-height: 300px;
|
||||
padding: 12px 16px 16px;
|
||||
}
|
||||
|
||||
@@ -509,19 +546,36 @@ table {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.inputPreisProgramm,
|
||||
.inputAktivProgramm {
|
||||
.inputAktivProgramm,
|
||||
.inputOrderIndexProgramm,
|
||||
.labelStartgebuerenWraper {
|
||||
padding: 6px 10px;
|
||||
border: 1px dashed #999;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9rem;
|
||||
transition: border-color 0.2s ease, background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.inputPreisProgramm:focus,
|
||||
.inputAktivProgramm:focus {
|
||||
.inputPreisProgramm,
|
||||
.inputAktivProgramm,
|
||||
.inputOrderIndexProgramm {
|
||||
max-width: 100px;
|
||||
font-size: 0.9rem;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.inputPreisProgramm {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.inputPreisProgramm:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.inputAktivProgramm:focus,
|
||||
.inputOrderIndexProgramm:focus {
|
||||
outline: none;
|
||||
border-color: var(--bg-top);
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
@@ -534,13 +588,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.deleteProgramm {
|
||||
appearance: none;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
select {
|
||||
appearance: none;
|
||||
@@ -562,7 +609,7 @@ select {
|
||||
/* ── One-time URL Modal ───────────────────────────────── */
|
||||
|
||||
.ot-modal {
|
||||
display: none;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
@@ -888,9 +935,9 @@ select {
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.inner-pw-set-bg {
|
||||
.benutzerGrid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
|
||||
grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -959,7 +1006,7 @@ select {
|
||||
}
|
||||
|
||||
.containerSection {
|
||||
padding: var(--paddingSite) calc(var(--paddingSite) * 1.5);
|
||||
padding: var(--paddingSite) calc(var(--paddingSite) * .5);
|
||||
margin-bottom: var(--paddingSite);
|
||||
}
|
||||
|
||||
@@ -983,3 +1030,57 @@ select {
|
||||
justify-content: center;
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
.containerTrainerKampfrichterPermissions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
width: 100%;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.inputPasswordUser {
|
||||
color: #fafafa !important;
|
||||
background-color:#fafafa !important;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.inputPasswordUser:hover, .inputPasswordUser:focus {
|
||||
color: #000000 !important;
|
||||
user-select: auto;
|
||||
}
|
||||
|
||||
.divAblaufdatumLink {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.blackBtn {
|
||||
background: var(--main-button);
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.blackBtn:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.blackBtn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
h3.normalTitle {
|
||||
color: var(--main-button);
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.userNotActive {
|
||||
color: #286690;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,585 @@
|
||||
:root {
|
||||
--paddingSite: 40px;
|
||||
--card-radius: 24px;
|
||||
--card-bg: #ffffff;
|
||||
--bg: #F4F3EF;
|
||||
--card-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
|
||||
--accent: #FF5A5F;
|
||||
/* Soft energetic pink/red from Dribbble */
|
||||
--accent-secondary: #FF8A65;
|
||||
--bg-top: rgb(54, 137, 13);
|
||||
--bg-top-raw: 54 137 13;
|
||||
--accent-soft: #f0f5ff;
|
||||
--border-subtle: #eaeaea;
|
||||
--text-main: #1b1b1b;
|
||||
--text-muted: #8A8A8A;
|
||||
--disabled-bg: #f3f4f6;
|
||||
--disabled-border: #cbd5f5;
|
||||
--ui-border: #dfe4ea;
|
||||
--main-button: #36454F;
|
||||
}
|
||||
|
||||
/* Base */
|
||||
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
section {
|
||||
margin: 0;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #0000003d;
|
||||
color: #ffffffff;
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
background: #a4bf4a99;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
input {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* General numeric inputs in scoring area */
|
||||
.bgSection input[type="number"] {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.nopadding {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* Layout */
|
||||
|
||||
.bgSection {
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
/*margin: var(--paddingSite);
|
||||
width: calc(100vw - 2 * var(--paddingSite));*/
|
||||
width: 100vw;
|
||||
box-sizing: border-box !important;
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media (min-width: 1081px) {
|
||||
.bgSection.open {
|
||||
width: calc(100vw - 380px);
|
||||
/* - 2 * var(--paddingSite) */
|
||||
}
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
|
||||
.headerDivTrainer {
|
||||
padding: var(--paddingSite);
|
||||
padding-bottom: 10px;
|
||||
background: transparent;
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.dashboardGrid {
|
||||
padding: 0 var(--paddingSite) var(--paddingSite);
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 30px;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.twoColumDiv {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 30px;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 1080px) {
|
||||
.twoColumDiv {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* headings */
|
||||
|
||||
.containerHeading {
|
||||
margin-top: 0;
|
||||
font-weight: 600;
|
||||
font-size: 20px;
|
||||
margin-bottom: 24px;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.subSettingsRowGroup .settingsRow span {
|
||||
color: #36454f;
|
||||
}
|
||||
|
||||
.subSettingsRowGroup {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
align-items: end;
|
||||
gap: 16px 22px;
|
||||
padding: 20px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.customSelectSubGroupHeader {
|
||||
border-bottom: 1px solid #1c2d34;
|
||||
font-weight: 600;
|
||||
border-radius: 0 !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.customSelectAddOption {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig > span {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
padding: 20px;
|
||||
border: 1px solid #00000046;
|
||||
}
|
||||
|
||||
#bodyRowRankLiveConfig > td > span {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 15px;
|
||||
position: relative;
|
||||
padding: 10px 20px;
|
||||
border: 1px solid #00000046;
|
||||
position: relative;
|
||||
min-height: 54.5px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig .addColumnBtn {
|
||||
font-size: 24px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 0;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
background-color: #5d9ab9;
|
||||
border: 1px solid #3a6b83;
|
||||
color: #fff;
|
||||
border-radius: 15px;
|
||||
align-content: center;
|
||||
cursor: pointer;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig .addColumnBtn.addColumnBtnAfter {
|
||||
right: 0;
|
||||
transform: translateX(50%) translateY(-50%);
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig .addColumnBtn.addColumnBtnBefore {
|
||||
left: 0;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig .addColumnBtn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig:not(.ui-sortable-helper) > span:hover .addColumnBtn.addColumnBtnAfter {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig:not(.ui-sortable-helper):first-child > span:hover .addColumnBtn.addColumnBtnBefore {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig:not(.ui-sortable-helper) > span:hover {
|
||||
border-right: 1px solid #3a6b83;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig:not(.ui-sortable-helper):first-child > span:hover {
|
||||
border-left: 1px solid #3a6b83;
|
||||
}
|
||||
|
||||
|
||||
.deleteColumnBtn {
|
||||
color: #6a2a2a;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.customSelectAddOption {
|
||||
max-width: min(100vw, 600px);
|
||||
border: 1px solid #777;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.rankLiveFieldContainerEmty {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
width: 100%;
|
||||
background: repeating-linear-gradient(
|
||||
45deg,
|
||||
#eeeeee50,
|
||||
#eeeeee50 5px,
|
||||
#dddddd50 5px,
|
||||
#dddddd50 10px
|
||||
);
|
||||
}
|
||||
|
||||
.singleValueSpan {
|
||||
position: relative;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #777;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.staticText {
|
||||
border-color: #00f;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.staticText .textSingleValueSpan {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.settingSpan {
|
||||
display: none;
|
||||
padding: 2px;
|
||||
border-radius: 3px;
|
||||
background-color: #09d1ce;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
transform: translateX(50%) translateY(-50%);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig .settingSpan {
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
.singleValueSpan .settingSpan {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.mainTable:not(.selectCondEl) .singleValueSpan:hover .settingSpan,
|
||||
.mainTable:not(.selectCondEl) .headerThRankLiveConfig:hover .settingSpan,
|
||||
.settingsDivSingleValueSpan:not(.hidden) + .settingSpan {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.settingSpan > svg {
|
||||
display: block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.settingsDivSingleValueSpan {
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transform: translateY(100%);
|
||||
min-width: 100%;
|
||||
width: fit-content;
|
||||
gap: 12px;
|
||||
z-index: 10;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.settingsInputGroup {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.singleValueSpan[data-bold="true"] .textSingleValueSpan, .singleValueSpan[data-bold="true"] .statischerTextInput {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.addFieldBtn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #36e049;
|
||||
display: flex;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
font-weight: 800;
|
||||
border-radius: 0 0 10px 0;
|
||||
filter: grayscale(1);
|
||||
transform: translateY(-37.5%) translateX(-37.5%) scale(0.25);
|
||||
transition: transform 0.3s ease, scale 0.3s ease;
|
||||
cursor: pointer;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mainTable.selectCondEl .addFieldBtn {
|
||||
transform: scale(0) translateY(-50%) translateX(-50%);
|
||||
scale: 1;
|
||||
}
|
||||
|
||||
.mainTable:not(.selectCondEl) .rankLiveFieldContainer:hover:not(:has(.singleValueSpan:hover)) .addFieldBtn {
|
||||
filter: grayscale(0);
|
||||
transform: scale(1) translateY(0) translateX(0);
|
||||
scale: 1;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig > span .deleteColumnBtn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: #e03669;
|
||||
display: flex;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
font-weight: 800;
|
||||
border-radius: 0 0 0 10px;
|
||||
filter: grayscale(1);
|
||||
transform: translateY(-37.5%) translateX(37.5%) scale(0.25);
|
||||
transition: transform 0.3s ease, scale 0.3s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.headerThRankLiveConfig:not(.ui-sortable-helper) > span:hover .deleteColumnBtn {
|
||||
filter: grayscale(0);
|
||||
transform: scale(1) translateY(0) translateX(0);
|
||||
scale: 1;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: max-content;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.checkbox input {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.checkbox-ui {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
width: 42px;
|
||||
height: 24px;
|
||||
flex: 0 0 auto;
|
||||
background: var(--ui-border);
|
||||
border: 1px solid color-mix(in srgb, var(--ui-border) 80%, #000);
|
||||
border-radius: 999px;
|
||||
transition:
|
||||
background-color 180ms ease,
|
||||
border-color 180ms ease,
|
||||
box-shadow 180ms ease;
|
||||
}
|
||||
|
||||
.checkbox-ui::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 3px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 7px rgba(15, 23, 42, 0.22);
|
||||
transform: translateY(-50%);
|
||||
transition: transform 180ms ease;
|
||||
}
|
||||
|
||||
.checkbox input:checked + .checkbox-ui {
|
||||
background: var(--bg-top);
|
||||
border-color: var(--bg-top);
|
||||
}
|
||||
|
||||
.checkbox input:checked + .checkbox-ui::after {
|
||||
transform: translate(18px, -50%);
|
||||
}
|
||||
|
||||
.checkbox input:focus-visible + .checkbox-ui {
|
||||
box-shadow: 0 0 0 4px var(--ui-focus);
|
||||
}
|
||||
|
||||
.dropPlaceholder {
|
||||
border: 2px dashed #ccc;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.dropPlaceholderColumn {
|
||||
border: 2px dashed #ddd;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.statischerTextInput {
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
.statischerTextInput:focus {
|
||||
border-color: var(--bg-top);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.columnTitleInput, .inputFontSize, .gebutsdatumFormatInput, .inputDisplayOnDisplayWidth {
|
||||
background: none;
|
||||
padding: 2px;
|
||||
margin-right: 10px;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
max-width: 20vw;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
.columnTitleInput:focus {
|
||||
border-color: var(--bg-top);
|
||||
}
|
||||
|
||||
.customSelectAddOption .selectOptions {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.customSelectAddOption {
|
||||
position: absolute !important;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.inputFontSize {
|
||||
max-width: 60px;
|
||||
}
|
||||
|
||||
.inputDisplayOnDisplayWidth {
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.autocomplete-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dropdown-list {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: white;
|
||||
border: 1px solid #ccc;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.verticalLayoutEl {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.verticalLayoutEl > span.dragableDropArea {
|
||||
min-height: 20px;
|
||||
min-width: max(50px, 100%);
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.verticalLayoutEl > span.dragableDropArea:not(:last-child) {
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
.inputLabelWrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.selectSlugType {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.customSelectSlugType {
|
||||
border: 1px solid #000;
|
||||
padding: 6px 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.selectCondEl.mainTable .singleValueSpan:not(.condEl) {
|
||||
border-color: #a5a5a5;
|
||||
color: #a5a5a5;
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.selectCondEl.mainTable .singleValueSpan:not(.condEl):hover {
|
||||
border-color: #0fab91;
|
||||
color: #0fab91;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.selectCondEl.mainTable .singleValueSpan.selectedCondEl {
|
||||
border-color: #ab4b0f;
|
||||
color: #ab4b0f;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.blackBtn {
|
||||
background: var(--main-button);
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease;
|
||||
letter-spacing: 1px;
|
||||
display: inline-flex;
|
||||
align-self: flex-start;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.blackBtn:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.blackBtn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
@@ -80,13 +80,6 @@ input {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
.bgSection.open {
|
||||
width: calc(100vw - 380px);
|
||||
/* - 2 * var(--paddingSite) */
|
||||
}
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
|
||||
.headerDivTrainer {
|
||||
@@ -97,8 +90,6 @@ input {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* headings */
|
||||
|
||||
.containerHeading {
|
||||
@@ -539,47 +530,47 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
|
||||
/* Burger + menu (unchanged from your style) */
|
||||
|
||||
.trainerBurgerMenuDiv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.trainerBurgerMenuDiv, .trainerBurgerMenuDiv svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
cursor: pointer;
|
||||
z-index: 99;
|
||||
color: var(--bg);
|
||||
}
|
||||
|
||||
.trainerBurgerMenuDiv svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
stroke: currentColor;
|
||||
transition: transform 0.3s ease;
|
||||
stroke: #fff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.trainerBurgerMenuDiv.open svg {
|
||||
transform: rotate(-90deg);
|
||||
.trainerBurgerMenuDiv:hover svg {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.trainerBurgerMenuDiv:active svg {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.internMenuDiv {
|
||||
background-color: #fff;
|
||||
box-shadow: none;
|
||||
box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100svh;
|
||||
width: 100%;
|
||||
max-width: 380px;
|
||||
transform: translateX(-100%);
|
||||
right: 0;
|
||||
top: 150px;
|
||||
width: 90vw;
|
||||
height: 200px;
|
||||
max-width: 400px;
|
||||
transform: translateX(0%);
|
||||
z-index: 100;
|
||||
padding: 20px;
|
||||
transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
|
||||
opacity: 1;
|
||||
border-radius: 20px 0 0 20px;
|
||||
}
|
||||
|
||||
.internMenuDiv.open {
|
||||
transform: translateX(0);
|
||||
box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
|
||||
transform: translateX(100%);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.innerInternMenuDiv {
|
||||
@@ -1022,6 +1013,93 @@ tr.rowStartgebuer::after {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.chartjs-tooltip {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
.chartjs-tooltip th {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.chartjs-tooltip td {
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.customSelect {
|
||||
position: relative;
|
||||
width: 240px;
|
||||
font-family: system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.customSelect > * {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.bulkSelectDiv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.bulkSelect:focus .selectArrow {
|
||||
rotate: 180deg
|
||||
}
|
||||
|
||||
.selectTrigger {
|
||||
width: 100%;
|
||||
border: 1px solid #ccc;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.selectOptions {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 0;
|
||||
border: 1px solid #ccc;
|
||||
border-top: none;
|
||||
list-style: none;
|
||||
background: #fff;
|
||||
display: none;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.selectOptions li {
|
||||
padding: 10px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.selectOptions li:hover,
|
||||
.selectOptions li.selected {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.buttonDownload {
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
background-color: var(--bg-top);
|
||||
color: #fff;
|
||||
border-top: 2px solid #727272;
|
||||
border-left: 2px solid #727272;
|
||||
border-bottom: 2px solid #2c2c2c;
|
||||
border-right: 2px solid #2c2c2c;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.buttonDownload:hover {
|
||||
transform: scale(1.015);
|
||||
}
|
||||
|
||||
.buttonDownload:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
select {
|
||||
appearance: none;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
--main: #fe3f18;
|
||||
--bg-top-raw: 254 63 24;
|
||||
--main-box-shadow: rgb(from var(--main) r g b / 0.05);
|
||||
--accent: #cfef00;
|
||||
--accent: #fe3f18;
|
||||
--accent-hover: #c5e300;
|
||||
--paddingSite: 40px;
|
||||
--card-radius: 20px;
|
||||
@@ -12,6 +12,7 @@
|
||||
--border-subtle: #d4d7e1;
|
||||
--text-main: #191919;
|
||||
--text-muted: #5e5e5e;
|
||||
--main-button: #36454F;
|
||||
}
|
||||
|
||||
/* --- BASE & TYPOGRAPHY --- */
|
||||
@@ -62,7 +63,7 @@ body {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: var(--paddingSite);
|
||||
background: linear-gradient(135deg, var(--main), #d85a00);
|
||||
background: var(--main);
|
||||
color: #fff;
|
||||
margin-bottom: var(--paddingSite);
|
||||
position: relative;
|
||||
@@ -82,7 +83,7 @@ body {
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv {
|
||||
.mainContentDiv {
|
||||
padding: 0 var(--paddingSite);
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ body {
|
||||
max-width: 450px;
|
||||
transform: translateX(-100%);
|
||||
z-index: 100;
|
||||
padding: 20px;
|
||||
padding: 30px;
|
||||
transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -141,9 +142,8 @@ body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
height: 100dvh;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.text_akt_abt {
|
||||
@@ -207,6 +207,20 @@ body {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.textInputAbtTitel {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--main);
|
||||
font-size: 1.5rem;
|
||||
color: #191919;
|
||||
background: none;
|
||||
width: max-content;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.deleteProgramm {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -243,45 +257,26 @@ body {
|
||||
}
|
||||
|
||||
/* Sidebar Menu Button Styling */
|
||||
.header-text-conatiner {
|
||||
.headerOptionConatiner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
padding-top: 20px;
|
||||
gap: 15px;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.header-text-conatiner button {
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
padding: 12px 20px;
|
||||
border-radius: 100px;
|
||||
background: var(--accent);
|
||||
border: 1px solid transparent;
|
||||
font-size: 15px;
|
||||
color: #000;
|
||||
width: 100%;
|
||||
box-shadow: 0 4px 6px rgba(207, 239, 0, 0.2);
|
||||
.headerOptionConatiner > button {
|
||||
|
||||
}
|
||||
|
||||
.header-text-conatiner button:hover {
|
||||
background: var(--accent-hover);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 12px rgba(207, 239, 0, 0.3);
|
||||
}
|
||||
|
||||
.header-text-conatiner button:active {
|
||||
transform: scale(0.98) translateY(0);
|
||||
}
|
||||
|
||||
.header-text-conatiner label {
|
||||
.headerOptionConatiner label {
|
||||
font-weight: 400;
|
||||
color: var(--text-main);
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
|
||||
.header-text-conatiner input[type="number"] {
|
||||
.headerOptionConatiner input[type="number"] {
|
||||
padding: 12px 15px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
@@ -292,7 +287,7 @@ body {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-text-conatiner input[type="number"]:focus {
|
||||
.headerOptionConatiner input[type="number"]:focus {
|
||||
border-color: var(--main);
|
||||
box-shadow: 0 0 0 3px rgba(40, 102, 110, 0.1);
|
||||
}
|
||||
@@ -309,6 +304,7 @@ body {
|
||||
transition: all 0.3s ease;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.geraet-table thead {
|
||||
@@ -465,45 +461,177 @@ body {
|
||||
|
||||
/* Invalid / Unassigned Wrapper */
|
||||
.invalidAbtDiv {
|
||||
padding: 20px;
|
||||
border-radius: 12px;
|
||||
margin: 20px 20px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.invalidAbtDiv .geraet-table {
|
||||
box-shadow: none;
|
||||
border-color: #fecdd3;
|
||||
border-color: #d93f4a;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.invalidAbtDiv .geraet-table thead {
|
||||
background: #ffe4e6;
|
||||
background: #d93f4a;
|
||||
}
|
||||
|
||||
.invalidAbtDiv .geraet-table thead th {
|
||||
color: #e11d48;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* Horizontal scroll area for departments */
|
||||
.allTurnerinenDiv>div {
|
||||
|
||||
.singleAbtDiv {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv>div>div:last-child {
|
||||
.singleAbtDataContainer {
|
||||
overflow-x: auto;
|
||||
padding: 10px 0 20px 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv>div>div:last-child::-webkit-scrollbar {
|
||||
.singleAbtDataContainer::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv>div>div:last-child::-webkit-scrollbar-track {
|
||||
.singleAbtDataContainer::-webkit-scrollbar-track {
|
||||
background: #f1f5f9;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv>div>div:last-child::-webkit-scrollbar-thumb {
|
||||
.singleAbtDataContainer::-webkit-scrollbar-thumb {
|
||||
background: #cbd5e1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.buttonMoveDiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.buttonMove {
|
||||
background: #fff;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
width: 24px;
|
||||
height: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
input.abtIndexInput::-webkit-outer-spin-button,
|
||||
input.abtIndexInput::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input.abtIndexInput[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.abtIndexInput {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nichtBezahlt {
|
||||
color: #e11d48;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.timePicker {
|
||||
border: none;
|
||||
border-bottom: 1px solid #000;
|
||||
background: none;
|
||||
padding: 4px 8px;
|
||||
font-size: 1rem;
|
||||
color: var(--main);
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.addTimetypeButton {
|
||||
color: #2dac79;
|
||||
}
|
||||
|
||||
.removeTimetypeButton {
|
||||
color: #e11d48;
|
||||
}
|
||||
|
||||
.subHeaderAbt {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 4px 8px;
|
||||
background: #f1f5f9;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
align-self: start;
|
||||
margin-top: 18px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.subHeaderAbt .customSelect {
|
||||
position: absolute;
|
||||
width: 160px;
|
||||
bottom: 0px;
|
||||
transform: translateY(120%) translateX(-10%);
|
||||
padding: 6px;
|
||||
background: #fff;
|
||||
border: 1px solid #7b7676;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.buttonsDiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 20px;
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.blackBtn {
|
||||
background: var(--main-button);
|
||||
border: 1px solid #fff;
|
||||
color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 10px;
|
||||
transition: transform 0.3s ease;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.blackBtn:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.blackBtn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
h3.normalTitle {
|
||||
color: var(--main-button);
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
@@ -184,9 +184,15 @@
|
||||
}
|
||||
|
||||
.menuWrapper {
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 20px;
|
||||
border-radius: 40px;
|
||||
background-color: rgb(var(--bg-top-raw));
|
||||
}
|
||||
|
||||
.abmeldenbutton {
|
||||
@@ -211,7 +217,7 @@
|
||||
padding: 20px 24px 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(45, 45, 45, 0.85);
|
||||
color: rgb(146 146 146 / 85%);
|
||||
}
|
||||
|
||||
.customSelect {
|
||||
@@ -230,8 +236,7 @@ table input {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.selectTrigger,
|
||||
.selectTriggerBulk {
|
||||
.selectTriggerSidebar {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
@@ -241,21 +246,21 @@ table input {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sidebar-nav .selectOptions,
|
||||
.sidebar-nav .selectOptionsBulk {
|
||||
.sidebar-nav .selectOptionsSidebar {
|
||||
position: absolute;
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 4px;
|
||||
list-style: none;
|
||||
margin-top: 2px;
|
||||
|
||||
border: 1px solid;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
|
||||
background: var(--sidebar-bg);
|
||||
background: #fff;
|
||||
z-index: 1000;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
|
||||
opacity: 0;
|
||||
transform: scaleY(0);
|
||||
@@ -265,8 +270,7 @@ table input {
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.sidebar-nav .customSelect.open .selectOptions,
|
||||
.sidebar-nav .customSelect.open .selectOptionsBulk {
|
||||
.sidebar-nav .customSelect.open .selectOptionsSidebar {
|
||||
opacity: 1;
|
||||
transform: scaleY(1);
|
||||
pointer-events: auto;
|
||||
@@ -276,8 +280,7 @@ table input {
|
||||
rotate: 180deg
|
||||
}
|
||||
|
||||
.selectOptions li,
|
||||
.selectOptionsBulk li {
|
||||
.selectOptionsSidebar li {
|
||||
padding: 10px 14px;
|
||||
cursor: pointer;
|
||||
border-radius: 8px;
|
||||
@@ -285,8 +288,7 @@ table input {
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.selectOptions li:last-child,
|
||||
.selectOptionsBulk li:last-child {
|
||||
.selectOptionsSidebar li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@@ -302,43 +304,36 @@ table input {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
color: rgba(45, 45, 45, 0.45);
|
||||
color: #fff;
|
||||
margin-bottom: 6px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.sidebar-li-freigaben .selectTrigger {
|
||||
.selectTriggerSidebar {
|
||||
width: 100%;
|
||||
padding: 9px 12px;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
background: #171717;
|
||||
border: 1px solid #fcfcfc;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--sidebar-text);
|
||||
color: #fcfcfc;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.sidebar-li-freigaben .selectTrigger:hover {
|
||||
border-color: rgba(0, 0, 0, 0.15);
|
||||
.selectTriggerSidebar:hover, .sidebar-li-freigaben .customSelect.open .selectTriggerSidebar {
|
||||
background: #fcfcfc;
|
||||
color: #171717;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.sidebar-li-freigaben .selectOptions {
|
||||
background: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.sidebar-li-freigaben .selectOptions li {
|
||||
.selectOptionsSidebar li {
|
||||
font-size: 13px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.sidebar-li-freigaben .selectOptions li.selected {
|
||||
.selectOptionsSidebar li.selected {
|
||||
background: var(--sidebar-active);
|
||||
color: #111;
|
||||
font-weight: 600;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
--text-muted: #5e5e5e;
|
||||
--disabled-bg: #f3f4f6;
|
||||
--disabled-border: #cbd5f5;
|
||||
--color-excel: #1D6F42;
|
||||
}
|
||||
|
||||
/* Base */
|
||||
@@ -86,13 +87,6 @@ input {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media (min-width: 1500px) {
|
||||
.bgSection.open {
|
||||
width: calc(100vw - 380px);
|
||||
/* - 2 * var(--paddingSite) */
|
||||
}
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
|
||||
.headerDivTrainer {
|
||||
@@ -112,6 +106,16 @@ input {
|
||||
.headingStartgebuerenTabelle {
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.headingStartgebuerenTabelle {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.heading_edit_turnerin,
|
||||
.headingAlleTurnerinnen {
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@@ -185,6 +189,79 @@ input {
|
||||
transition: all 2s ease;
|
||||
}
|
||||
|
||||
/* Basis-Container-Positionierung */
|
||||
.tooltip-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Das gehoverte Element */
|
||||
.target-element {
|
||||
padding: 10px 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Der Tooltip selbst */
|
||||
.tooltip {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
|
||||
/* Positionierung: Oben über dem Element, zentriert */
|
||||
bottom: 120%; /* Abstand nach oben */
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
/* Styling */
|
||||
background-color: #ffffff;
|
||||
color: #2f2f2f;
|
||||
text-align: center;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 4px 6px rgba(162, 162, 162, 0.1);
|
||||
align-items: center;
|
||||
text-align: left;
|
||||
|
||||
/* Die 0.5s Verzögerung */
|
||||
transition: visibility 0s linear 0.5s, opacity 0.3s linear;
|
||||
}
|
||||
|
||||
/* Kleiner Pfeil nach unten */
|
||||
.tooltip::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #ffffff transparent transparent transparent;
|
||||
}
|
||||
|
||||
/* Sichtbar machen beim Hovern über den Container */
|
||||
.tooltip-container:hover .tooltip {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
|
||||
/* Keine Verzögerung beim Verschwinden */
|
||||
transition-delay: 0s;
|
||||
transition: visibility 0s linear 0s, opacity 0.3s linear;
|
||||
}
|
||||
|
||||
.tooltipPaymentStatus {
|
||||
display: grid;
|
||||
grid-template-columns: 180px 1fr;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tooltipPaymentStatus > * {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Kampfrichter header layout */
|
||||
|
||||
.headerDivTrainer {
|
||||
@@ -369,19 +446,16 @@ div.bezahlstatus.paymentAdmin {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv .editTurnerin,
|
||||
.allTurnerinenDiv .editTurnerinAdmin {
|
||||
.allTurnerinenDiv .editPerson {
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv .editTurnerin svg,
|
||||
.allTurnerinenDiv .editTurnerinAdmin svg {
|
||||
.allTurnerinenDiv .editPerson svg{
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.allTurnerinenDiv .editTurnerin svg:hover,
|
||||
.allTurnerinenDiv .editTurnerinAdmin svg:hover {
|
||||
.allTurnerinenDiv .editPerson svg:hover {
|
||||
transform: scale(1.2);
|
||||
animation-name: stiftWackler;
|
||||
animation-duration: 0.5s;
|
||||
@@ -447,6 +521,7 @@ div.bezahlstatus.paymentAdmin {
|
||||
.editContainerDivInner>form>input,
|
||||
.editContainerDivInner>form>select,
|
||||
.bulkSelect,
|
||||
.editContainerDivInner .customSelect,
|
||||
.emptyEditForm {
|
||||
border: 1px dashed #777;
|
||||
max-width: 300px;
|
||||
@@ -456,6 +531,16 @@ div.bezahlstatus.paymentAdmin {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.bulkSelectDiv .customSelect {
|
||||
border: 1px solid #777;
|
||||
max-width: 300px;
|
||||
border-radius: 3px;
|
||||
font-size: 16px;
|
||||
margin-bottom: 15px;
|
||||
font-weight: 300;
|
||||
min-width: min(250px, 100%);
|
||||
}
|
||||
|
||||
.editContainerDivInner>form>input:focus,
|
||||
.editContainerDivInner>form>select:focus,
|
||||
.bulkSelect:focus {
|
||||
@@ -466,6 +551,8 @@ div.bezahlstatus.paymentAdmin {
|
||||
}
|
||||
|
||||
.editContainerDivInner>form>input,
|
||||
.editContainerDivInner .customSelect,
|
||||
.bulkSelectDiv .customSelect,
|
||||
.emptyEditForm {
|
||||
padding: 6px 10px;
|
||||
}
|
||||
@@ -787,8 +874,12 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.trainerBurgerMenuDiv.open svg {
|
||||
transform: rotate(45deg);
|
||||
.trainerBurgerMenuDiv:hover svg, .deleteStartgebuerCell:hover svg {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.trainerBurgerMenuDiv:active svg, .deleteStartgebuerCell:active svg {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.internMenuDiv {
|
||||
@@ -796,8 +887,9 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
box-shadow: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100svh;
|
||||
border-radius: 0 40px 40px 0;
|
||||
bottom: 40px;
|
||||
height: calc(80svh - 80px);
|
||||
width: 100%;
|
||||
max-width: 450px;
|
||||
transform: translateX(-100%);
|
||||
@@ -805,6 +897,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
padding: 20px;
|
||||
transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
|
||||
opacity: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.internMenuDiv.open {
|
||||
@@ -816,9 +909,8 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
height: 100dvh;
|
||||
max-height: calc(100% - 150px);
|
||||
overflow-y: auto;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.text_akt_abt {
|
||||
@@ -828,12 +920,12 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.innerInternMenuDiv form {
|
||||
.internMenuDiv form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.innerInternMenuDiv input[type="submit"],
|
||||
.innerInternMenuDiv select {
|
||||
.internMenuDiv input[type="submit"],
|
||||
.internMenuDiv select {
|
||||
width: 100%;
|
||||
padding: 12px 14px;
|
||||
border-radius: 10px;
|
||||
@@ -842,28 +934,17 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.innerInternMenuDiv input[type="submit"]:focus,
|
||||
.innerInternMenuDiv select:focus {
|
||||
.internMenuDiv input[type="submit"]:focus,
|
||||
.internMenuDiv select:focus {
|
||||
outline: none;
|
||||
border-color: #2d73ac;
|
||||
box-shadow: 0 0 6px rgba(45, 115, 172, 0.3);
|
||||
}
|
||||
|
||||
.innerInternMenuDiv .button-secondary {
|
||||
background: linear-gradient(135deg, #2d73ac, #1f4f75);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
padding: 12px 18px;
|
||||
transition: transform 0.2s ease, background 0.3s ease;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.innerInternMenuDiv .button-secondary:hover {
|
||||
background: linear-gradient(135deg, #245d8a, #163b5a);
|
||||
transform: translateY(-2px);
|
||||
.internMenuDiv button.newBtn {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
right: 30px;
|
||||
}
|
||||
|
||||
.gruppennav {
|
||||
@@ -1184,15 +1265,18 @@ tr.rowStartgebuer {
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
tr.rowStartgebuer:hover {
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
|
||||
tr.rowStartgebuer {
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.tableStartgebueren {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
tr.rowStartgebuerTotal {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
font-weight: bold;
|
||||
border-top: 2px solid #ddd;
|
||||
background-color: #fdfdfd;
|
||||
@@ -1240,14 +1324,12 @@ tr.rowStartgebuerTotal {
|
||||
}
|
||||
|
||||
.tableStartgebueren {
|
||||
max-height: 60vh;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
/* Prevent scroll chaining to body */
|
||||
overscroll-behavior-x: contain;
|
||||
overscroll-behavior-x: none;
|
||||
overscroll-behavior-y: none;
|
||||
|
||||
/* Smooth scrolling on touch devices */
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
@@ -1294,87 +1376,97 @@ tr.rowStartgebuerTotal {
|
||||
|
||||
/* Container styling */
|
||||
.form_excel {
|
||||
max-width: 400px;
|
||||
padding: 30px;
|
||||
max-width: 420px;
|
||||
padding: 18px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
|
||||
text-align: center;
|
||||
border-top: 6px solid #1D6F42;
|
||||
/* Excel Green */
|
||||
border: 4px solid var(--color-excel);
|
||||
}
|
||||
|
||||
.form_excel h4 {
|
||||
.form_excel h3 {
|
||||
color: #333;
|
||||
margin-bottom: 20px;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin: 0 0 20px 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* Download Template Section */
|
||||
|
||||
.listExcelForm {
|
||||
text-align: left;
|
||||
line-height: 1.25;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.form_excel a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
margin-bottom: 25px;
|
||||
display: inline-flex;
|
||||
color: var(--color-excel);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form_excel button[type="button"] {
|
||||
background-color: #f3f3f3;
|
||||
color: #1D6F42;
|
||||
border: 1px solid #1D6F42;
|
||||
padding: 10px 20px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
.form_excel a::after {
|
||||
content: "";
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
background-color: var(--color-excel);
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
transform: scaleX(0);
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.form_excel button[type="button"]:hover {
|
||||
background-color: #e8f5e9;
|
||||
transform: translateY(-1px);
|
||||
.form_excel a:hover::after {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
|
||||
/* File Input Styling */
|
||||
.form_excel input[type="file"] {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
border: 2px dashed #cbd5e0;
|
||||
border-radius: 8px;
|
||||
background-color: #fafafa;
|
||||
padding: 8px 0;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form_excel input[type="file"]::file-selector-button {
|
||||
background: #1D6F42;
|
||||
color: white;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--color-excel);
|
||||
border: 1px solid var(--color-excel);
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
letter-spacing: 1px;
|
||||
transition: background 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
.form_excel input[type="file"]::file-selector-button:hover {
|
||||
background: var(--color-excel);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
/* Submit Button */
|
||||
.form_excel button[type="submit"] {
|
||||
background-color: #1D6F42;
|
||||
/* Official Excel Green */
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
color: var(--color-excel);
|
||||
border: 1px solid var(--color-excel);
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
margin-top: 8px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 4px 6px rgba(29, 111, 66, 0.2);
|
||||
transition: background 0.3s ease;
|
||||
transition: background 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
.form_excel button[type="submit"]:hover {
|
||||
background-color: #155231;
|
||||
box-shadow: 0 6px 12px rgba(29, 111, 66, 0.3);
|
||||
background: var(--color-excel);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Payment Modal Overlay */
|
||||
@@ -1574,13 +1666,65 @@ span.flatpickr-weekday {
|
||||
color: #cfef00;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.tooltipPaymentStatusContainer {
|
||||
position: absolute;
|
||||
transform: translateY(-100%) translateX(-50%);
|
||||
background-color: #ffffff;
|
||||
color: #2f2f2f;
|
||||
text-align: center;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 4px 6px rgba(162, 162, 162, 0.1);
|
||||
align-items: center;
|
||||
text-align: left;
|
||||
transition: opacity 0.5s ease;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.opacity0 {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease !important;
|
||||
}
|
||||
|
||||
.closeWarenkorb {
|
||||
color: #d30741;
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
transform: scale(1);
|
||||
transition: transform 0.3s ease;
|
||||
display: inline-flex;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.closeWarenkorb:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.closeWarenkorb:active {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
.headerDivWarenkorb {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
select:not(.flatpickr-monthDropdown-months) {
|
||||
appearance: none;
|
||||
/* Standard */
|
||||
-webkit-appearance: none;
|
||||
/* WebKit */
|
||||
-moz-appearance: none;
|
||||
/* Firefox */
|
||||
|
||||
width: 100%;
|
||||
padding: 12px 35px 12px 14px !important;
|
||||
@@ -1590,10 +1734,7 @@ select:not(.flatpickr-monthDropdown-months) {
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
|
||||
background-image: url("data:image/svg+xml;utf8,\
|
||||
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\
|
||||
<path d='M6 9L12 15L18 9' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
|
||||
</svg>");
|
||||
background-image: url("data:image/svg+xml;utf8,\<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\<path d='M6 9L12 15L18 9' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\</svg>");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 10px center;
|
||||
background-size: 20px;
|
||||
@@ -1602,8 +1743,5 @@ select:not(.flatpickr-monthDropdown-months) {
|
||||
}
|
||||
|
||||
select:open {
|
||||
background-image: url("data:image/svg+xml;utf8,\
|
||||
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\
|
||||
<path d='M18 15L12 9L6 15' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
|
||||
</svg>");
|
||||
background-image: url("data:image/svg+xml;utf8,\<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'>\<path d='M18 15L12 9L6 15' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\</svg>");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/* Dies ist eine CSS-Datei, welche mit eigener CSS-Logik gefüllt werden kann. Diese CSS Datei glit für alle Intern Seiten.*/
|
||||
@@ -1,77 +0,0 @@
|
||||
.welcomeScreen{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 10000;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.welcomeScreen{
|
||||
animation: fadeOut 0.9s forwards;
|
||||
animation-delay: 3s;
|
||||
}
|
||||
|
||||
.innerWelcomeScreen{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.textWelcomeScreen{
|
||||
text-align: center;
|
||||
}
|
||||
.textWelcomeScreen.text span {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
animation: rise 0.5s forwards;
|
||||
font-size: 60px;
|
||||
font-weight: 100;
|
||||
color: #8044A6;
|
||||
}
|
||||
|
||||
.textWelcomeScreen.title span {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
animation: fall 0.9s forwards;
|
||||
font-size: 120px;
|
||||
}
|
||||
|
||||
|
||||
@keyframes rise {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
99% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fall {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 672 KiB |
|
Before Width: | Height: | Size: 399 KiB After Width: | Height: | Size: 357 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 9.6 KiB |
@@ -0,0 +1,632 @@
|
||||
ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
|
||||
var oop = require("../lib/oop");
|
||||
var lang = require("../lib/lang");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
|
||||
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
|
||||
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
|
||||
var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
|
||||
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
|
||||
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
|
||||
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
||||
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
|
||||
var CssHighlightRules = function () {
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"support.function": supportFunction,
|
||||
"support.constant": supportConstant,
|
||||
"support.type": supportType,
|
||||
"support.constant.color": supportConstantColor,
|
||||
"support.constant.fonts": supportConstantFonts
|
||||
}, "text", true);
|
||||
this.$rules = {
|
||||
"start": [{
|
||||
include: ["strings", "url", "comments"]
|
||||
}, {
|
||||
token: "paren.lparen",
|
||||
regex: "\\{",
|
||||
next: "ruleset"
|
||||
}, {
|
||||
token: "paren.rparen",
|
||||
regex: "\\}"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: "@(?!viewport)",
|
||||
next: "media"
|
||||
}, {
|
||||
token: "keyword",
|
||||
regex: "#[a-z0-9-_]+"
|
||||
}, {
|
||||
token: "keyword",
|
||||
regex: "%"
|
||||
}, {
|
||||
token: "variable",
|
||||
regex: "\\.[a-z0-9-_]+"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: ":[a-z0-9-_]+"
|
||||
}, {
|
||||
token: "constant.numeric",
|
||||
regex: numRe
|
||||
}, {
|
||||
token: "constant",
|
||||
regex: "[a-z0-9-_]+"
|
||||
}, {
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"media": [{
|
||||
include: ["strings", "url", "comments"]
|
||||
}, {
|
||||
token: "paren.lparen",
|
||||
regex: "\\{",
|
||||
next: "start"
|
||||
}, {
|
||||
token: "paren.rparen",
|
||||
regex: "\\}",
|
||||
next: "start"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: ";",
|
||||
next: "start"
|
||||
}, {
|
||||
token: "keyword",
|
||||
regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
|
||||
+ "|page|font|keyframes|viewport|counter-style|font-feature-values"
|
||||
+ "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
|
||||
}],
|
||||
"comments": [{
|
||||
token: "comment", // multi line comment
|
||||
regex: "\\/\\*",
|
||||
push: [{
|
||||
token: "comment",
|
||||
regex: "\\*\\/",
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "comment"
|
||||
}]
|
||||
}],
|
||||
"ruleset": [{
|
||||
regex: "-(webkit|ms|moz|o)-",
|
||||
token: "text"
|
||||
}, {
|
||||
token: "punctuation.operator",
|
||||
regex: "[:;]"
|
||||
}, {
|
||||
token: "paren.rparen",
|
||||
regex: "\\}",
|
||||
next: "start"
|
||||
}, {
|
||||
include: ["strings", "url", "comments"]
|
||||
}, {
|
||||
token: ["constant.numeric", "keyword"],
|
||||
regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
|
||||
}, {
|
||||
token: "constant.numeric",
|
||||
regex: numRe
|
||||
}, {
|
||||
token: "constant.numeric", // hex6 color
|
||||
regex: "#[a-f0-9]{6}"
|
||||
}, {
|
||||
token: "constant.numeric", // hex3 color
|
||||
regex: "#[a-f0-9]{3}"
|
||||
}, {
|
||||
token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
||||
regex: pseudoElements
|
||||
}, {
|
||||
token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
||||
regex: pseudoClasses
|
||||
}, {
|
||||
include: "url"
|
||||
}, {
|
||||
token: keywordMapper,
|
||||
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
||||
}, {
|
||||
token: "paren.lparen",
|
||||
regex: "\\{"
|
||||
}, {
|
||||
caseInsensitive: true
|
||||
}],
|
||||
url: [{
|
||||
token: "support.function",
|
||||
regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
|
||||
push: [{
|
||||
token: "support.function",
|
||||
regex: "\\)",
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}],
|
||||
strings: [{
|
||||
token: "string.start",
|
||||
regex: "'",
|
||||
push: [{
|
||||
token: "string.end",
|
||||
regex: "'|$",
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "escapes"
|
||||
}, {
|
||||
token: "constant.language.escape",
|
||||
regex: /\\$/,
|
||||
consumeLineEnd: true
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}, {
|
||||
token: "string.start",
|
||||
regex: '"',
|
||||
push: [{
|
||||
token: "string.end",
|
||||
regex: '"|$',
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "escapes"
|
||||
}, {
|
||||
token: "constant.language.escape",
|
||||
regex: /\\$/,
|
||||
consumeLineEnd: true
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}],
|
||||
escapes: [{
|
||||
token: "constant.language.escape",
|
||||
regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
|
||||
}]
|
||||
};
|
||||
this.normalizeRules();
|
||||
};
|
||||
oop.inherits(CssHighlightRules, TextHighlightRules);
|
||||
exports.CssHighlightRules = CssHighlightRules;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
|
||||
var Range = require("../range").Range;
|
||||
var MatchingBraceOutdent = function () { };
|
||||
(function () {
|
||||
this.checkOutdent = function (line, input) {
|
||||
if (!/^\s+$/.test(line))
|
||||
return false;
|
||||
return /^\s*\}/.test(input);
|
||||
};
|
||||
this.autoOutdent = function (doc, row) {
|
||||
var line = doc.getLine(row);
|
||||
var match = line.match(/^(\s*\})/);
|
||||
if (!match)
|
||||
return 0;
|
||||
var column = match[1].length;
|
||||
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
|
||||
if (!openBracePos || openBracePos.row == row)
|
||||
return 0;
|
||||
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
||||
doc.replace(new Range(row, 0, row, column - 1), indent);
|
||||
};
|
||||
this.$getIndent = function (line) {
|
||||
return line.match(/^\s*/)[0];
|
||||
};
|
||||
}).call(MatchingBraceOutdent.prototype);
|
||||
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
|
||||
var propertyMap = {
|
||||
"background": { "#$0": 1 },
|
||||
"background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
|
||||
"background-image": { "url('/$0')": 1 },
|
||||
"background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
|
||||
"background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
|
||||
"background-attachment": { "scroll": 1, "fixed": 1 },
|
||||
"background-size": { "cover": 1, "contain": 1 },
|
||||
"background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
|
||||
"background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
|
||||
"border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
|
||||
"border-color": { "#$0": 1 },
|
||||
"border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
|
||||
"border-collapse": { "collapse": 1, "separate": 1 },
|
||||
"bottom": { "px": 1, "em": 1, "%": 1 },
|
||||
"clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
|
||||
"color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
|
||||
"cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
|
||||
"display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
|
||||
"empty-cells": { "show": 1, "hide": 1 },
|
||||
"float": { "left": 1, "right": 1, "none": 1 },
|
||||
"font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
|
||||
"font-size": { "px": 1, "em": 1, "%": 1 },
|
||||
"font-weight": { "bold": 1, "normal": 1 },
|
||||
"font-style": { "italic": 1, "normal": 1 },
|
||||
"font-variant": { "normal": 1, "small-caps": 1 },
|
||||
"height": { "px": 1, "em": 1, "%": 1 },
|
||||
"left": { "px": 1, "em": 1, "%": 1 },
|
||||
"letter-spacing": { "normal": 1 },
|
||||
"line-height": { "normal": 1 },
|
||||
"list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
|
||||
"margin": { "px": 1, "em": 1, "%": 1 },
|
||||
"margin-right": { "px": 1, "em": 1, "%": 1 },
|
||||
"margin-left": { "px": 1, "em": 1, "%": 1 },
|
||||
"margin-top": { "px": 1, "em": 1, "%": 1 },
|
||||
"margin-bottom": { "px": 1, "em": 1, "%": 1 },
|
||||
"max-height": { "px": 1, "em": 1, "%": 1 },
|
||||
"max-width": { "px": 1, "em": 1, "%": 1 },
|
||||
"min-height": { "px": 1, "em": 1, "%": 1 },
|
||||
"min-width": { "px": 1, "em": 1, "%": 1 },
|
||||
"overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
|
||||
"overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
|
||||
"overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
|
||||
"padding": { "px": 1, "em": 1, "%": 1 },
|
||||
"padding-top": { "px": 1, "em": 1, "%": 1 },
|
||||
"padding-right": { "px": 1, "em": 1, "%": 1 },
|
||||
"padding-bottom": { "px": 1, "em": 1, "%": 1 },
|
||||
"padding-left": { "px": 1, "em": 1, "%": 1 },
|
||||
"page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
|
||||
"page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
|
||||
"position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
|
||||
"right": { "px": 1, "em": 1, "%": 1 },
|
||||
"table-layout": { "fixed": 1, "auto": 1 },
|
||||
"text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
|
||||
"text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
|
||||
"text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
|
||||
"top": { "px": 1, "em": 1, "%": 1 },
|
||||
"vertical-align": { "top": 1, "bottom": 1 },
|
||||
"visibility": { "hidden": 1, "visible": 1 },
|
||||
"white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
|
||||
"width": { "px": 1, "em": 1, "%": 1 },
|
||||
"word-spacing": { "normal": 1 },
|
||||
"filter": { "alpha(opacity=$0100)": 1 },
|
||||
"text-shadow": { "$02px 2px 2px #777": 1 },
|
||||
"text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
|
||||
"-moz-border-radius": 1,
|
||||
"-moz-border-radius-topright": 1,
|
||||
"-moz-border-radius-bottomright": 1,
|
||||
"-moz-border-radius-topleft": 1,
|
||||
"-moz-border-radius-bottomleft": 1,
|
||||
"-webkit-border-radius": 1,
|
||||
"-webkit-border-top-right-radius": 1,
|
||||
"-webkit-border-top-left-radius": 1,
|
||||
"-webkit-border-bottom-right-radius": 1,
|
||||
"-webkit-border-bottom-left-radius": 1,
|
||||
"-moz-box-shadow": 1,
|
||||
"-webkit-box-shadow": 1,
|
||||
"transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
|
||||
"-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
|
||||
"-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
|
||||
};
|
||||
var CssCompletions = function () {
|
||||
};
|
||||
(function () {
|
||||
this.completionsDefined = false;
|
||||
this.defineCompletions = function () {
|
||||
if (document) {
|
||||
var style = document.createElement('c').style;
|
||||
for (var i in style) {
|
||||
if (typeof style[i] !== 'string')
|
||||
continue;
|
||||
var name = i.replace(/[A-Z]/g, function (x) {
|
||||
return '-' + x.toLowerCase();
|
||||
});
|
||||
if (!propertyMap.hasOwnProperty(name))
|
||||
propertyMap[name] = 1;
|
||||
}
|
||||
}
|
||||
this.completionsDefined = true;
|
||||
};
|
||||
this.getCompletions = function (state, session, pos, prefix) {
|
||||
if (!this.completionsDefined) {
|
||||
this.defineCompletions();
|
||||
}
|
||||
if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
|
||||
var line = session.getLine(pos.row).substr(0, pos.column);
|
||||
var inParens = /\([^)]*$/.test(line);
|
||||
if (inParens) {
|
||||
line = line.substr(line.lastIndexOf('(') + 1);
|
||||
}
|
||||
if (/:[^;]+$/.test(line)) {
|
||||
/([\w\-]+):[^:]*$/.test(line);
|
||||
return this.getPropertyValueCompletions(state, session, pos, prefix);
|
||||
}
|
||||
else {
|
||||
return this.getPropertyCompletions(state, session, pos, prefix, inParens);
|
||||
}
|
||||
}
|
||||
return [];
|
||||
};
|
||||
this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
|
||||
skipSemicolon = skipSemicolon || false;
|
||||
var properties = Object.keys(propertyMap);
|
||||
return properties.map(function (property) {
|
||||
return {
|
||||
caption: property,
|
||||
snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
|
||||
meta: "property",
|
||||
score: 1000000
|
||||
};
|
||||
});
|
||||
};
|
||||
this.getPropertyValueCompletions = function (state, session, pos, prefix) {
|
||||
var line = session.getLine(pos.row).substr(0, pos.column);
|
||||
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
|
||||
if (!property)
|
||||
return [];
|
||||
var values = [];
|
||||
if (property in propertyMap && typeof propertyMap[property] === "object") {
|
||||
values = Object.keys(propertyMap[property]);
|
||||
}
|
||||
return values.map(function (value) {
|
||||
return {
|
||||
caption: value,
|
||||
snippet: value,
|
||||
meta: "property value",
|
||||
score: 1000000
|
||||
};
|
||||
});
|
||||
};
|
||||
}).call(CssCompletions.prototype);
|
||||
exports.CssCompletions = CssCompletions;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
|
||||
var oop = require("../../lib/oop");
|
||||
var Behaviour = require("../behaviour").Behaviour;
|
||||
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
||||
var TokenIterator = require("../../token_iterator").TokenIterator;
|
||||
var CssBehaviour = function () {
|
||||
this.inherit(CstyleBehaviour);
|
||||
this.add("colon", "insertion", function (state, action, editor, session, text) {
|
||||
if (text === ':' && editor.selection.isEmpty()) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
||||
var token = iterator.getCurrentToken();
|
||||
if (token && token.value.match(/\s+/)) {
|
||||
token = iterator.stepBackward();
|
||||
}
|
||||
if (token && token.type === 'support.type') {
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar === ':') {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
|
||||
return {
|
||||
text: ':;',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.add("colon", "deletion", function (state, action, editor, session, range) {
|
||||
var selected = session.doc.getTextRange(range);
|
||||
if (!range.isMultiLine() && selected === ':') {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
||||
var token = iterator.getCurrentToken();
|
||||
if (token && token.value.match(/\s+/)) {
|
||||
token = iterator.stepBackward();
|
||||
}
|
||||
if (token && token.type === 'support.type') {
|
||||
var line = session.doc.getLine(range.start.row);
|
||||
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
||||
if (rightChar === ';') {
|
||||
range.end.column++;
|
||||
return range;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.add("semicolon", "insertion", function (state, action, editor, session, text) {
|
||||
if (text === ';' && editor.selection.isEmpty()) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
||||
if (rightChar === ';') {
|
||||
return {
|
||||
text: '',
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
this.add("!important", "insertion", function (state, action, editor, session, text) {
|
||||
if (text === '!' && editor.selection.isEmpty()) {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.doc.getLine(cursor.row);
|
||||
if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
|
||||
return {
|
||||
text: '!important',
|
||||
selection: [10, 10]
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
oop.inherits(CssBehaviour, CstyleBehaviour);
|
||||
exports.CssBehaviour = CssBehaviour;
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
|
||||
var oop = require("../../lib/oop");
|
||||
var Range = require("../../range").Range;
|
||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||
var FoldMode = exports.FoldMode = function (commentRegex) {
|
||||
if (commentRegex) {
|
||||
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
|
||||
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
|
||||
}
|
||||
};
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
(function () {
|
||||
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
||||
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
||||
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
|
||||
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
|
||||
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
|
||||
this._getFoldWidgetBase = this.getFoldWidget;
|
||||
this.getFoldWidget = function (session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
if (this.singleLineBlockCommentRe.test(line)) {
|
||||
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
||||
return "";
|
||||
}
|
||||
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
||||
if (!fw && this.startRegionRe.test(line))
|
||||
return "start"; // lineCommentRegionStart
|
||||
return fw;
|
||||
};
|
||||
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
|
||||
var line = session.getLine(row);
|
||||
if (this.startRegionRe.test(line))
|
||||
return this.getCommentRegionBlock(session, line, row);
|
||||
var match = line.match(this.foldingStartMarker);
|
||||
if (match) {
|
||||
var i = match.index;
|
||||
if (match[1])
|
||||
return this.openingBracketBlock(session, match[1], row, i);
|
||||
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
||||
if (range && !range.isMultiLine()) {
|
||||
if (forceMultiline) {
|
||||
range = this.getSectionRange(session, row);
|
||||
}
|
||||
else if (foldStyle != "all")
|
||||
range = null;
|
||||
}
|
||||
return range;
|
||||
}
|
||||
if (foldStyle === "markbegin")
|
||||
return;
|
||||
var match = line.match(this.foldingStopMarker);
|
||||
if (match) {
|
||||
var i = match.index + match[0].length;
|
||||
if (match[1])
|
||||
return this.closingBracketBlock(session, match[1], row, i);
|
||||
return session.getCommentFoldRange(row, i, -1);
|
||||
}
|
||||
};
|
||||
this.getSectionRange = function (session, row) {
|
||||
var line = session.getLine(row);
|
||||
var startIndent = line.search(/\S/);
|
||||
var startRow = row;
|
||||
var startColumn = line.length;
|
||||
row = row + 1;
|
||||
var endRow = row;
|
||||
var maxRow = session.getLength();
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var indent = line.search(/\S/);
|
||||
if (indent === -1)
|
||||
continue;
|
||||
if (startIndent > indent)
|
||||
break;
|
||||
var subRange = this.getFoldWidgetRange(session, "all", row);
|
||||
if (subRange) {
|
||||
if (subRange.start.row <= startRow) {
|
||||
break;
|
||||
}
|
||||
else if (subRange.isMultiLine()) {
|
||||
row = subRange.end.row;
|
||||
}
|
||||
else if (startIndent == indent) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
endRow = row;
|
||||
}
|
||||
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
||||
};
|
||||
this.getCommentRegionBlock = function (session, line, row) {
|
||||
var startColumn = line.search(/\s*$/);
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
||||
var depth = 1;
|
||||
while (++row < maxRow) {
|
||||
line = session.getLine(row);
|
||||
var m = re.exec(line);
|
||||
if (!m)
|
||||
continue;
|
||||
if (m[1])
|
||||
depth--;
|
||||
else
|
||||
depth++;
|
||||
if (!depth)
|
||||
break;
|
||||
}
|
||||
var endRow = row;
|
||||
if (endRow > startRow) {
|
||||
return new Range(startRow, startColumn, endRow, line.length);
|
||||
}
|
||||
};
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
|
||||
ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
||||
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
||||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
var CssCompletions = require("./css_completions").CssCompletions;
|
||||
var CssBehaviour = require("./behaviour/css").CssBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var Mode = function () {
|
||||
this.HighlightRules = CssHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CssBehaviour();
|
||||
this.$completer = new CssCompletions();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
(function () {
|
||||
this.foldingRules = "cStyle";
|
||||
this.blockComment = { start: "/*", end: "*/" };
|
||||
this.getNextLineIndent = function (state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
|
||||
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
var match = line.match(/^.*\{\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
return indent;
|
||||
};
|
||||
this.checkOutdent = function (state, line, input) {
|
||||
return this.$outdent.checkOutdent(line, input);
|
||||
};
|
||||
this.autoOutdent = function (state, doc, row) {
|
||||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
this.getCompletions = function (state, session, pos, prefix) {
|
||||
return this.$completer.getCompletions(state, session, pos, prefix);
|
||||
};
|
||||
this.createWorker = function (session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
worker.on("annotate", function (e) {
|
||||
session.setAnnotations(e.data);
|
||||
});
|
||||
worker.on("terminate", function () {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
return worker;
|
||||
};
|
||||
this.$id = "ace/mode/css";
|
||||
this.snippetFileId = "ace/snippets/css";
|
||||
}).call(Mode.prototype);
|
||||
exports.Mode = Mode;
|
||||
|
||||
}); (function() {
|
||||
ace.require(["ace/mode/css"], function(m) {
|
||||
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||
module.exports = m;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -65,33 +65,3 @@ function deleteCookieBanner() {
|
||||
$div.remove();
|
||||
}, 400);
|
||||
}
|
||||
|
||||
/* function hasSessionCookie(callback) {
|
||||
$.ajax({
|
||||
url: '/myjupa/api/check-php-session.php',
|
||||
method: 'GET',
|
||||
cache: false, // Ensure we don't get a cached result
|
||||
success: function(response) {
|
||||
callback(response.cookieExists);
|
||||
},
|
||||
error: function() {
|
||||
callback(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Usage in your click handler
|
||||
$(document).on('click', 'a[href*="/myjupa/"]', function (el) {
|
||||
el.preventDefault();
|
||||
const target = $(this).attr("href");
|
||||
|
||||
hasSessionCookie(function(exists) {
|
||||
if (exists) {
|
||||
window.location.assign(target);
|
||||
} else {
|
||||
deleteCookieBanner();
|
||||
|
||||
displayCookieBanner(target);
|
||||
}
|
||||
});
|
||||
}); */
|
||||
@@ -23,6 +23,8 @@ jQuery(document).ready(function ($) {
|
||||
|
||||
});
|
||||
|
||||
const colors = ["rgb(255, 0, 0)", "rgb(0, 255, 0)", "#ff9d00"];
|
||||
|
||||
function displayMsg(type, msg) {
|
||||
const now = Date.now();
|
||||
|
||||
@@ -37,7 +39,6 @@ function displayMsg(type, msg) {
|
||||
lastMsgTime = now;
|
||||
lastMsgContent = msg;
|
||||
|
||||
const colors = ["rgb(255, 0, 0)", "rgb(0, 255, 0)", "#ff9d00"];
|
||||
if (type !== 0 && type !== 1 && type !== 2) return;
|
||||
|
||||
const d = new Date();
|
||||
@@ -58,33 +59,95 @@ function displayMsg(type, msg) {
|
||||
setTimeout(() => fadeOutDiv($div), 5000);
|
||||
}
|
||||
|
||||
function displayConfirm(type, msg) {
|
||||
function displayConfirm(msg = null) {
|
||||
return new Promise((resolve) => {
|
||||
const colors = ["rgb(255, 0, 0)", "rgb(0, 255, 0)", "#ff9d00"];
|
||||
if (![0, 1, 2].includes(type)) return resolve(false);
|
||||
|
||||
const $div = $('<div class="confirmBox"></div>')
|
||||
.css({ 'border-color': colors[type] })
|
||||
.text(msg);
|
||||
// Created clean layout references
|
||||
const $heading = $('<h3>', { class: 'confirmImportantHeading', text: 'Bitte bestätige diese Aktion' });
|
||||
const $text = $('<p>', { class: 'confirmImportantText', text: msg || 'Diese Aktion ist unumkehrbar.' });
|
||||
|
||||
const $buttonDiv = $('<div class="buttonConfirmDiv"></div>');
|
||||
const $buttonYes = $('<button class="confirmYesButton">Ja</button>');
|
||||
const $buttonNo = $('<button class="confirmNoButton">Nein</button>');
|
||||
const $submitBtn = $('<button>', { class: 'confirmImportantConfrimBtn', text: "Bestätigen" });
|
||||
const $cancelBtn = $('<button>', { class: 'confirmImportantCancelBtn', text: "Abbrechen" });
|
||||
const $btnDiv = $('<div>', { class: 'confirmImportantBtnDiv' }).append($cancelBtn, $submitBtn);
|
||||
|
||||
$buttonDiv.append($buttonNo, $buttonYes);
|
||||
$div.append($buttonDiv);
|
||||
$msgDiv.append($div);
|
||||
const $textDiv = $('<div>', { class: 'confirmImportantTextDiv' }).append($heading, $text);
|
||||
const $box = $('<div>', { class: 'confirmImportantBox' }).append($textDiv, $btnDiv);
|
||||
const $displayBg = $('<div>', { class: 'confirmImportantBg' }).append($box);
|
||||
|
||||
$buttonYes.on('click', function () {
|
||||
fadeOutDiv($div);
|
||||
resolve(true);
|
||||
$('body').append($displayBg);
|
||||
|
||||
const closeModal = (result) => {
|
||||
$(document).off('keydown', handleEscape);
|
||||
$displayBg.remove();
|
||||
resolve(result);
|
||||
};
|
||||
|
||||
const handleEscape = function (e) {
|
||||
if (e.key === 'Escape' || e.key === 'Esc') {
|
||||
closeModal(false);
|
||||
}
|
||||
};
|
||||
$(document).on('keydown', handleEscape);
|
||||
|
||||
$submitBtn.on('click', function () {
|
||||
closeModal(true);
|
||||
});
|
||||
|
||||
$buttonNo.on('click', function () {
|
||||
fadeOutDiv($div);
|
||||
resolve(false);
|
||||
$cancelBtn.on('click', function () {
|
||||
closeModal(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function displayConfirmImportant(msg = null, deleteString = "LOESCHEN") {
|
||||
return new Promise((resolve) => {
|
||||
|
||||
const trimmedString = deleteString.trim();
|
||||
|
||||
// Created clean layout references
|
||||
const $heading = $('<h3>', { class: 'confirmImportantHeading', text: 'Bitte bestätige diese Aktion' });
|
||||
const $text = $('<p>', { class: 'confirmImportantText', text: msg || 'Diese Aktion ist unumkehrbar.' });
|
||||
|
||||
const $label = $('<label>', { class: 'confirmImportantLabel', for: 'confirmImportantInput', text: `Bitte geben Sie im untenstehenden Feld "${deleteString}" ein, um fortzufahren` });
|
||||
const $input = $('<input>', { class: 'confirmImportantInput', id: 'confirmImportantInput', type: "text", placeholder: `Hier "${deleteString}" eingeben` });
|
||||
const $inputDiv = $('<div>', { class: 'confirmImportantInputDiv' }).append($label, $input);
|
||||
|
||||
const $submitBtn = $('<button>', { class: 'confirmImportantConfrimBtn notValidBtn', text: "Bestätigen" });
|
||||
const $cancelBtn = $('<button>', { class: 'confirmImportantCancelBtn', text: "Abbrechen" });
|
||||
const $btnDiv = $('<div>', { class: 'confirmImportantBtnDiv' }).append($cancelBtn, $submitBtn);
|
||||
|
||||
const $textDiv = $('<div>', { class: 'confirmImportantTextDiv' }).append($heading, $text);
|
||||
const $box = $('<div>', { class: 'confirmImportantBox' }).append($textDiv, $inputDiv, $btnDiv);
|
||||
const $displayBg = $('<div>', { class: 'confirmImportantBg' }).append($box);
|
||||
|
||||
$('body').append($displayBg);
|
||||
|
||||
const closeModal = (result) => {
|
||||
$(document).off('keydown', handleEscape);
|
||||
$displayBg.remove();
|
||||
resolve(result);
|
||||
};
|
||||
|
||||
const handleEscape = function (e) {
|
||||
if (e.key === 'Escape' || e.key === 'Esc') {
|
||||
closeModal(false);
|
||||
}
|
||||
};
|
||||
$(document).on('keydown', handleEscape);
|
||||
|
||||
$input.on('input', function () {
|
||||
const matches = $(this).val().trim() === trimmedString;
|
||||
$submitBtn.toggleClass('notValidBtn', !matches);
|
||||
$(this).toggleClass('ok', matches).toggleClass('notOk', !matches);
|
||||
});
|
||||
|
||||
$submitBtn.on('click', function () {
|
||||
if ($input.val().trim() !== trimmedString || $submitBtn.hasClass('notValidBtn')) return;
|
||||
closeModal(true);
|
||||
});
|
||||
|
||||
$cancelBtn.on('click', function () {
|
||||
closeModal(false);
|
||||
});
|
||||
|
||||
setTimeout(() => $div.addClass('show'), 50);
|
||||
});
|
||||
}
|
||||
@@ -19,6 +19,7 @@ $(document).on('click', '.selectOptions li', function (e) {
|
||||
|
||||
$input.val(val);
|
||||
$label.text(text);
|
||||
$input.trigger('change');
|
||||
$label.removeClass('placeholder');
|
||||
$container.removeClass('open');
|
||||
});
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# QRCode.js
|
||||
QRCode.js is javascript library for making QRCode. QRCode.js supports Cross-browser with HTML5 Canvas and table tag in DOM.
|
||||
QRCode.js has no dependencies.
|
||||
|
||||
## Basic Usages
|
||||
```
|
||||
<div id="qrcode"></div>
|
||||
<script type="text/javascript">
|
||||
new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");
|
||||
</script>
|
||||
```
|
||||
|
||||
or with some options
|
||||
|
||||
```
|
||||
<div id="qrcode"></div>
|
||||
<script type="text/javascript">
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
text: "http://jindo.dev.naver.com/collie",
|
||||
width: 128,
|
||||
height: 128,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#ffffff",
|
||||
correctLevel : QRCode.CorrectLevel.H
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
and you can use some methods
|
||||
|
||||
```
|
||||
qrcode.clear(); // clear the code.
|
||||
qrcode.makeCode("http://naver.com"); // make another code.
|
||||
```
|
||||
|
||||
## Browser Compatibility
|
||||
IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC.
|
||||
|
||||
## License
|
||||
MIT License
|
||||
|
||||
## Contact
|
||||
twitter @davidshimjs
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
|
||||
<head>
|
||||
<title>Cross-Browser QRCode generator for Javascript</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
|
||||
<script type="text/javascript" src="jquery.min.js"></script>
|
||||
<script type="text/javascript" src="qrcode.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="text" type="text" value="http://jindo.dev.naver.com/collie" style="width:80%" />
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="qrcode"/>
|
||||
</svg>
|
||||
<script type="text/javascript">
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width : 100,
|
||||
height : 100,
|
||||
useSVG: true
|
||||
});
|
||||
|
||||
function makeCode () {
|
||||
var elText = document.getElementById("text");
|
||||
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
|
||||
makeCode();
|
||||
|
||||
$("#text").
|
||||
on("blur", function () {
|
||||
makeCode();
|
||||
}).
|
||||
on("keydown", function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,44 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
|
||||
<head>
|
||||
<title>Cross-Browser QRCode generator for Javascript</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
|
||||
<script type="text/javascript" src="jquery.min.js"></script>
|
||||
<script type="text/javascript" src="qrcode.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="text" type="text" value="http://jindo.dev.naver.com/collie" style="width:80%" /><br />
|
||||
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width : 100,
|
||||
height : 100
|
||||
});
|
||||
|
||||
function makeCode () {
|
||||
var elText = document.getElementById("text");
|
||||
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
|
||||
makeCode();
|
||||
|
||||
$("#text").
|
||||
on("blur", function () {
|
||||
makeCode();
|
||||
}).
|
||||
on("keydown", function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-50 0 200 100">
|
||||
<g id="qrcode"/>
|
||||
<foreignObject x="-50" y="0" width="100" height="100">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml" style="padding:0; margin:0">
|
||||
<div style="padding:inherit; margin:inherit; height:100%">
|
||||
<textarea id="text" style="height:100%; width:100%; position:absolute; margin:inherit; padding:inherit">james</textarea>
|
||||
</div>
|
||||
<script type="application/ecmascript" src="qrcode.js"></script>
|
||||
<script type="application/ecmascript">
|
||||
var elem = document.getElementById("qrcode");
|
||||
var qrcode = new QRCode(elem, {
|
||||
width : 100,
|
||||
height : 100
|
||||
});
|
||||
|
||||
function makeCode () {
|
||||
var elText = document.getElementById("text");
|
||||
|
||||
if (elText.value === "") {
|
||||
//alert("Input a text");
|
||||
//elText.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
|
||||
makeCode();
|
||||
|
||||
document.getElementById("text").onkeyup = function (e) {
|
||||
makeCode();
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</foreignObject>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -75,12 +75,12 @@ function changeFreigabe(freigabe) {
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('click', '.sidebar-nav .selectTrigger', function (e) {
|
||||
$(document).on('click', '.sidebar-nav .selectTriggerSidebar', function (e) {
|
||||
e.stopPropagation();
|
||||
$(this).closest('.customSelect').toggleClass('open');
|
||||
});
|
||||
|
||||
$(document).on('click', '.sidebar-nav .selectOptions li', function (e) {
|
||||
$(document).on('click', '.sidebar-nav .selectOptionsSidebar li', function (e) {
|
||||
e.stopPropagation();
|
||||
const $item = $(this);
|
||||
const $container = $item.closest('.customSelect');
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
require_once __DIR__ . '/../../scripts/rate-limiter/rate-limiter.php';
|
||||
|
||||
$limiter = new TokenBucket(
|
||||
redis: $redis,
|
||||
capacity: 3,
|
||||
refillRate: 1,
|
||||
refillInterval: 5.0
|
||||
);
|
||||
|
||||
$result = $limiter->allow('RATE_LIMITER:TYPE:otlogin:IP:'. $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if (!$result['allowed']) {
|
||||
http_response_code(429);
|
||||
include __DIR__ . "/../error-pages/429.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
@@ -10,6 +23,8 @@ if (!isset($baseDir)) {
|
||||
$baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
}
|
||||
|
||||
date_default_timezone_set('Europe/Zurich');
|
||||
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
ini_wkvs_session(true);
|
||||
@@ -295,29 +310,23 @@ class otl {
|
||||
|
||||
$pwClass = New otl();
|
||||
|
||||
/* ============================================================
|
||||
PASSWORD SET ON POST
|
||||
============================================================ */
|
||||
|
||||
|
||||
/* ============================================================
|
||||
ONE-TIME-LOGIN VALIDATION (GET)
|
||||
============================================================ */
|
||||
|
||||
require $baseDir .'/../scripts/db/db-verbindung-script-guest.php';
|
||||
|
||||
// fetch one-time login record
|
||||
|
||||
$now = date("Y-m-d H:i:s");
|
||||
|
||||
$result = db_select(
|
||||
$guest,
|
||||
$tableOTL,
|
||||
'id, user_id, `type`',
|
||||
'url = ? AND timestamp >= NOW() - INTERVAL 24 HOUR',
|
||||
[$oturl]
|
||||
'url = ? AND expires_at >= ?',
|
||||
[$oturl, $now]
|
||||
);
|
||||
|
||||
if (!$result || count($result) !== 1) {
|
||||
echo 'forbidden';
|
||||
http_response_code(403);
|
||||
http_response_code(400);
|
||||
include $baseDir . "/error-pages/400.html";
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -389,9 +398,10 @@ $guest->close();
|
||||
<link href="/files/fonts/fonts.css" rel="stylesheet">
|
||||
<link href="/intern/css/otl.css" rel="stylesheet">
|
||||
<script src="/intern/js/custom-msg-display.js"></script>
|
||||
<link rel="stylesheet" href="/intern/css/user.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<body class="otlogin">
|
||||
<section class="page-secure-login">
|
||||
<div class="bg-picture-secure-login">
|
||||
<img src="/intern/img/login/bgOtl.webp">
|
||||
|
||||
@@ -10,19 +10,28 @@ ini_wkvs_session();
|
||||
|
||||
verify_csrf();
|
||||
|
||||
check_multiple_allowed_permissions(['kampfrichter', 'wk_leitung']);
|
||||
$accessPermission = trim($_POST['accessPermission'] ?? '');
|
||||
|
||||
$access = preg_replace("/[\W]/", "", trim($_POST['access'] ?? ''));
|
||||
$accesstype = preg_replace("/[\W]/", "", trim($_POST['accesstype'] ?? ''));
|
||||
|
||||
if (!isset($_POST['access'])) {
|
||||
if ($accessPermission === '' || $access === '' || $accesstype === '') {
|
||||
echo json_encode(['success' => false, 'message' => 'Parameters not correctly set']);
|
||||
http_response_code(400);
|
||||
exit;
|
||||
}
|
||||
|
||||
$access = preg_replace("/[\W]/", "", trim($_POST['access']));
|
||||
|
||||
require $baseDir . "/../scripts/websocket/ws-create-token.php";
|
||||
|
||||
$token = generateWSToken($access);
|
||||
if ($accessPermission === "R") {
|
||||
$token = generateWSReadToken($accesstype, $access);
|
||||
} elseif ($accessPermission === "W") {
|
||||
check_multiple_allowed_permissions(['kampfrichter', 'wk_leitung']);
|
||||
$token = generateWSAdminToken($accesstype, $access);
|
||||
} else {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
|
||||
$responseBool = $token != null;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ if (!$new_value) {
|
||||
}
|
||||
|
||||
if ($type === 'kampfrichter'){
|
||||
$_SESSION['selectedFreigabeKampfrichter'] = $new_value;
|
||||
$_SESSION['selectedFreigabeIdKampfrichter'] = $new_value;
|
||||
}
|
||||
|
||||
if ($type === 'trainer'){
|
||||
|
||||
@@ -10,6 +10,9 @@ check_multiple_allowed_permissions(['trainer', 'wk_leitung']);
|
||||
|
||||
verify_csrf();
|
||||
|
||||
$isTrainer = isset($_SESSION['access_granted_trainer']) && $_SESSION['access_granted_trainer'];
|
||||
$userId = $isTrainer ? intval($_SESSION['user_id_trainer'] ?? 0) : intval($_SESSION['user_id_wk_leitung'] ?? 0);
|
||||
|
||||
// Allow large uploads and enough memory for GD processing
|
||||
ini_set('memory_limit', '256M');
|
||||
ini_set('max_execution_time', '120');
|
||||
@@ -41,7 +44,23 @@ $normalDir = $saveDir;
|
||||
|
||||
$uploadDir = $baseDir . $saveDir;
|
||||
|
||||
$maxLengthMusic = db_get_var($mysqli, "SELECT `value` FROM $tableVar WHERE `name` = ?", ['maxLengthMusic']);
|
||||
$maxLengthMusic = 0;
|
||||
|
||||
if ($isTrainer) {
|
||||
$geraet_id = (int) $_POST['geraetId'] ?? 0;
|
||||
|
||||
$geraet_exists = db_get_var($mysqli, "SELECT 1 FROM $tableGeraete WHERE `id` = ?", [$geraet_id]);
|
||||
|
||||
if ($geraet_exists === null) {
|
||||
http_response_code(400);
|
||||
echo json_encode(['success' => false, 'message' => 'Invalides Gerät angegeben.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$geraet_max_duration_audio_db = db_get_var($mysqli, "SELECT `audiofile_max_duration` FROM $tableGeraete WHERE `id` = ?", [$geraet_id]);
|
||||
|
||||
$maxLengthMusic = (int) $geraet_max_duration_audio_db;
|
||||
}
|
||||
|
||||
if (!is_dir($uploadDir)) {
|
||||
mkdir($uploadDir, 0755, true);
|
||||
@@ -109,10 +128,10 @@ if ($isTrainer && $maxLengthMusic !== null && intval($maxLengthMusic) !== 0) {
|
||||
}
|
||||
|
||||
|
||||
$sql = "INSERT INTO $tableAudiofiles (`file_name`,`file_path`) VALUES (?, ?)";
|
||||
$sql = "INSERT INTO $tableAudiofiles (`file_name`,`file_path`,`edited_by`) VALUES (?, ?, ?)";
|
||||
|
||||
$stmt = $mysqli->prepare($sql);
|
||||
$stmt->bind_param("ss", $originalName, $normalPath);
|
||||
$stmt->bind_param("ssi", $originalName, $normalPath, $userId);
|
||||
|
||||
if (!$stmt->execute()) {
|
||||
http_response_code(500);
|
||||
|
||||
@@ -26,7 +26,7 @@ if ($type === 'ctext'){
|
||||
$ctext = isset($_POST['ctext']) ? $_POST['ctext'] : '';
|
||||
}
|
||||
|
||||
$folder = realpath($baseDir.'/displays/json');
|
||||
$folder = realpath($baseDir.'/externe-geraete/json');
|
||||
if ($folder === false) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!isset($baseDir)) {
|
||||
@@ -31,10 +27,14 @@ require $baseDir . '/../scripts/db/db-tables.php';
|
||||
|
||||
$allowedTypes = [
|
||||
'wkName',
|
||||
'displayCTextLogo',
|
||||
'displayCTextWKName',
|
||||
'displayColourLogo',
|
||||
'displayTextColourLogo',
|
||||
'displayColorScoringBg',
|
||||
'displayColorScoringBgSoft',
|
||||
'displayColorScoringShadowColor',
|
||||
'displayColorScoringBorderColor',
|
||||
'displayColorScoringPanel',
|
||||
'displayColorScoringPanelSoft',
|
||||
'displayColorScoringPanelText',
|
||||
@@ -53,8 +53,15 @@ $allowedTypes = [
|
||||
'maxLengthMusic',
|
||||
'linkWebseite',
|
||||
'rangNote',
|
||||
'orderBestRang'
|
||||
'orderBestRang',
|
||||
'rechnungenPostversand',
|
||||
'rechnungenPostversandKosten',
|
||||
'personEinzahl',
|
||||
'personMehrzahl',
|
||||
'rankLivePublic',
|
||||
'riegeneinteilungPublic'
|
||||
];
|
||||
|
||||
$type = $_POST['type'] ? trim($_POST['type']) : '';
|
||||
|
||||
if (!in_array($type, $allowedTypes)) {
|
||||
|
||||