Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
997786be54 | |||
c4974787d4 | |||
a42bdaa721 | |||
49938a1085 | |||
d0a27fe095 | |||
d388bce528 | |||
aabb4540c9 | |||
ffde078238 | |||
9e320c4eb2 | |||
58ed5fe867 | |||
72676edc10 | |||
d5954eac89 | |||
68a2db28a1 | |||
13709de515 | |||
2c65d5f651 | |||
33ecb79e0b | |||
00bb197620 | |||
8e7d3da07f | |||
35e0d0a783 | |||
40196fa28f | |||
7b5e90e3bd | |||
3c48988e88 | |||
869acdcb18 | |||
91af1dfca0 | |||
c271bc1f60 | |||
9c04bb973e | |||
6d7298548b | |||
42a11abe61 | |||
3c6d2f7c45 | |||
d143d6c7b6 | |||
e6638b737d | |||
1f493e0a37 | |||
469ad0ce05 | |||
8a8c13e407 | |||
18974eb69b | |||
9e406ed7a3 | |||
8b82a44ad8 | |||
528baff7b5 | |||
e105dc4663 | |||
3f69ba6198 | |||
7e812eb835 | |||
ece7f984f7 | |||
6cfc2e0162 | |||
bbcd04fd21 | |||
89a5152ada | |||
e6f43ca10a | |||
da3ef358d2 | |||
d77ee8ef04 | |||
cbc95c0d29 | |||
3639344a13 | |||
84ba72ab72 | |||
2f4671cbc4 | |||
df87868ab5 | |||
d1c4f6a1d0 | |||
88d33b1a30 | |||
0e9a1156e2 | |||
cdf0bc31d9 | |||
f1c2e9227e | |||
a5383ccce8 |
16
.env.example
Normal file
16
.env.example
Normal file
@@ -0,0 +1,16 @@
|
||||
# Flask-Konfiguration
|
||||
FLASK_APP=app.py
|
||||
FLASK_ENV=development
|
||||
SECRET_KEY=your-secret-key-here
|
||||
|
||||
# Datenbank-Konfiguration
|
||||
DATABASE_URL=sqlite:///customers.db
|
||||
|
||||
# Authentifizierung
|
||||
STATIC_PASSWORD=your-static-password-here
|
||||
|
||||
# IP-Bereiche für direkten Zugriff (ohne Login)
|
||||
ALLOWED_IP_RANGES=192.168.0.0/24,192.168.177.0/24,213.178.68.218/29
|
||||
|
||||
# Logging-Konfiguration
|
||||
LOG_LEVEL=INFO
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -46,3 +46,7 @@ coverage.xml
|
||||
|
||||
# Daten
|
||||
spezexpo.csv
|
||||
|
||||
# Database
|
||||
*.db
|
||||
data/customers.db
|
75
CHANGELOG.md
Normal file
75
CHANGELOG.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Changelog
|
||||
|
||||
Alle wichtigen Änderungen an diesem Projekt werden in dieser Datei dokumentiert.
|
||||
|
||||
Das Format basiert auf [Keep a Changelog](https://keepachangelog.com/de/1.0.0/),
|
||||
und dieses Projekt adhäriert zu [Semantic Versioning](https://semver.org/lang/de/).
|
||||
|
||||
## [1.2.4] - 2024-03-19
|
||||
### Geändert
|
||||
- Performance-Optimierung: Indizes für alle Suchfelder hinzugefügt
|
||||
- Verbesserte Suchgeschwindigkeit durch optimierte Datenbankindizes
|
||||
- Zusammengesetzter Index für die häufigste Suchkombination (Name + Ort) hinzugefügt
|
||||
|
||||
## [1.2.3] - 2024-03-19
|
||||
### Geändert
|
||||
- Performance-Optimierung: Entfernung aller console.log Anweisungen
|
||||
- Verbesserte Code-Qualität durch Entfernung von Debug-Ausgaben
|
||||
|
||||
## [1.2.2] - 2024-03-19
|
||||
### Geändert
|
||||
- Verbesserte Telefonnummern-Formatierung: Führende "0" wird immer hinzugefügt, wenn der Benutzer von einer erlaubten IP-Adresse zugreift
|
||||
- Debug-Logging für Telefonnummern-Formatierung hinzugefügt
|
||||
- Verbesserte Benutzerfreundlichkeit bei der Anzeige von Telefonnummern
|
||||
|
||||
### Behoben
|
||||
- Problem mit fehlender führender "0" bei Telefonnummern für autorisierte Benutzer
|
||||
|
||||
## [1.2.1] - 2024-03-18
|
||||
### Geändert
|
||||
- Verbesserte CSV-Import-Funktionalität mit pandas
|
||||
- Korrektur des Login-Prozesses
|
||||
- Verbesserte Fehlerbehandlung und Logging
|
||||
- Anpassung der Spaltennamen für den CSV-Import
|
||||
|
||||
### Behoben
|
||||
- Login-Prozess funktioniert jetzt korrekt mit dem Passwort aus der .env Datei
|
||||
- CSV-Import verarbeitet Anführungszeichen korrekt
|
||||
- Verbesserte Fehlerbehandlung beim Datenbankimport
|
||||
|
||||
## [1.2.0] - 2024-03-18
|
||||
|
||||
### Geändert
|
||||
- IP-Subnetz-Prüfung korrigiert (CIDR-Notation wird jetzt korrekt ausgewertet)
|
||||
- Debug-Logging für IP-Adressen hinzugefügt
|
||||
- Beispiel-Umgebungsvariablen (.env.example) hinzugefügt
|
||||
|
||||
### Hinzugefügt
|
||||
- IP-basierte Zugriffssteuerung für medisoftware-Links
|
||||
- IP-basierte Zugriffssteuerung für Telefonnummern-Links
|
||||
- Google Maps Integration für Adressen
|
||||
- Version im Footer angezeigt
|
||||
|
||||
### Verbessert
|
||||
- Verbesserte Fehlerbehandlung bei der IP-Überprüfung
|
||||
- Bessere Dokumentation der Konfigurationsmöglichkeiten
|
||||
|
||||
## [v1.1.0] - 2024-03-17
|
||||
|
||||
### Hinzugefügt
|
||||
- Benutzer-Login für nicht-autorisierte IPs
|
||||
- Verbesserte Darstellung der Telefonnummern
|
||||
- Responsive Design für mobile Geräte
|
||||
|
||||
### Verbessert
|
||||
- Optimierte Suchfunktion
|
||||
- Verbesserte Benutzeroberfläche
|
||||
|
||||
## [v1.0.0] - 2024-03-17
|
||||
|
||||
### Hinzugefügt
|
||||
- Erste Version mit grundlegenden Suchfunktionen
|
||||
- Echtzeit-Suche über Kundendaten
|
||||
- Hervorhebung von Suchbegriffen in den Ergebnissen
|
||||
- Klickbare Links für Telefonnummern, E-Mail-Adressen und Adressen
|
||||
- Docker-Container für einfache Installation und Deployment
|
@@ -10,8 +10,12 @@ COPY requirements.txt .
|
||||
# Installiere Abhängigkeiten
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Kopiere den Anwendungscode
|
||||
COPY . .
|
||||
# Erstelle das data Verzeichnis und setze Berechtigungen
|
||||
RUN mkdir -p /app/data && \
|
||||
chmod 755 /app/data
|
||||
|
||||
# Kopiere die Anwendungsdateien
|
||||
COPY . /app/
|
||||
|
||||
# Exponiere Port 5000
|
||||
EXPOSE 5000
|
||||
|
295
README.md
295
README.md
@@ -1,229 +1,106 @@
|
||||
# medisoftware Kundensuche
|
||||
# Medi-Customers
|
||||
|
||||
Eine Flask-basierte Webanwendung zur Suche in Kundendaten aus einer CSV-Datei.
|
||||
Eine Flask-basierte Webanwendung zur Verwaltung von Kundenkontakten für medizinische Einrichtungen.
|
||||
|
||||
## Features
|
||||
|
||||
- Live-Suche während der Eingabe
|
||||
- Spezifische Suchfelder für:
|
||||
- Kundennummer
|
||||
- Name (Vor- und Nachname)
|
||||
- Fachrichtung
|
||||
- Ort
|
||||
- Allgemeine Suche über alle Felder
|
||||
- Klickbare Links für:
|
||||
- Telefonnummern (tel:)
|
||||
- E-Mail-Adressen (mailto:)
|
||||
- Adressen (Google Maps)
|
||||
- Kundennummern (KKBefe-System)
|
||||
- Teilen-Funktion für einzelne Suchergebnisse
|
||||
- Responsive Design mit Bootstrap
|
||||
- Docker-Container-Unterstützung
|
||||
|
||||
## Technische Details
|
||||
|
||||
### Technologie-Stack
|
||||
|
||||
- **Backend**: Python 3.11 mit Flask
|
||||
- **Frontend**: HTML, CSS, JavaScript, Bootstrap 5
|
||||
- **Datenverarbeitung**: pandas, numpy
|
||||
- **Container**: Docker
|
||||
|
||||
### Projektstruktur
|
||||
|
||||
```
|
||||
medi-customers/
|
||||
├── app.py # Flask-Anwendung
|
||||
├── templates/ # HTML-Templates
|
||||
│ └── index.html # Hauptseite
|
||||
├── spezexpo.csv # Kundendaten
|
||||
├── requirements.txt # Python-Abhängigkeiten
|
||||
├── Dockerfile # Docker-Konfiguration
|
||||
├── docker-compose.yml # Docker Compose Konfiguration
|
||||
└── .dockerignore # Docker-Ignore-Datei
|
||||
```
|
||||
|
||||
### Datenformat
|
||||
|
||||
Die Anwendung erwartet eine CSV-Datei (`spezexpo.csv`) mit folgenden Spalten:
|
||||
- Nummer (Kundennummer)
|
||||
- Vorname
|
||||
- Nachname
|
||||
- Fachrichtung
|
||||
- Strasse
|
||||
- PLZ
|
||||
- Ort
|
||||
- Tel
|
||||
- mail
|
||||
- Kundensuche nach verschiedenen Kriterien (Name, Ort, Kundennummer, etc.)
|
||||
- Direkte Links zu Kundendaten in medisoftware (für autorisierte IPs)
|
||||
- Telefonnummern-Links für autorisierte IPs
|
||||
- Adress-Links mit Google Maps Integration
|
||||
- IP-basierte Zugriffssteuerung
|
||||
- Responsive Design
|
||||
|
||||
## Installation
|
||||
|
||||
### Lokale Entwicklung
|
||||
|
||||
1. Python 3.11 installieren
|
||||
2. Virtuelle Umgebung erstellen und aktivieren:
|
||||
```bash
|
||||
python -m venv venv
|
||||
source venv/bin/activate # Linux/Mac
|
||||
venv\Scripts\activate # Windows
|
||||
```
|
||||
3. Abhängigkeiten installieren:
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
4. Anwendung starten:
|
||||
```bash
|
||||
python app.py
|
||||
```
|
||||
|
||||
### Docker-Container
|
||||
|
||||
1. Docker installieren
|
||||
2. Container mit Docker Compose starten:
|
||||
```bash
|
||||
docker-compose up --build
|
||||
```
|
||||
Die Anwendung ist dann unter `http://localhost:5001` erreichbar.
|
||||
|
||||
## API-Endpunkte
|
||||
|
||||
### GET /
|
||||
- Rendert die Hauptseite
|
||||
|
||||
### GET /search
|
||||
- Sucht nach Kunden basierend auf verschiedenen Parametern
|
||||
- Parameter:
|
||||
- `name`: Suche nach Vor- oder Nachname
|
||||
- `ort`: Suche nach Ort
|
||||
- `kundennummer`: Suche nach Kundennummer
|
||||
- `fachrichtung`: Suche nach Fachrichtung
|
||||
- `q`: Allgemeine Suche über alle Felder
|
||||
- Returns: JSON-Array mit gefundenen Kunden
|
||||
|
||||
#### API-Beispiele
|
||||
|
||||
1. Suche nach Namen:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?name=Schmidt"
|
||||
```
|
||||
|
||||
2. Suche nach Ort:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?ort=Berlin"
|
||||
```
|
||||
|
||||
3. Suche nach Kundennummer:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?kundennummer=12345"
|
||||
```
|
||||
|
||||
4. Suche nach Fachrichtung:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?fachrichtung=Allgemeinmedizin"
|
||||
```
|
||||
|
||||
5. Kombinierte Suche:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?name=Schmidt&ort=Berlin&fachrichtung=Allgemeinmedizin"
|
||||
```
|
||||
|
||||
6. Allgemeine Suche:
|
||||
```bash
|
||||
curl "http://localhost:5001/search?q=Schmidt"
|
||||
```
|
||||
|
||||
#### Beispiel-Response
|
||||
```json
|
||||
[
|
||||
{
|
||||
"Nummer": "12345",
|
||||
"Vorname": "Max",
|
||||
"Nachname": "Schmidt",
|
||||
"Fachrichtung": "Allgemeinmedizin",
|
||||
"Strasse": "Hauptstraße 1",
|
||||
"PLZ": "10115",
|
||||
"Ort": "Berlin",
|
||||
"Tel": "030-123456",
|
||||
"mail": "max.schmidt@example.com"
|
||||
}
|
||||
]
|
||||
1. Repository klonen:
|
||||
```bash
|
||||
git clone https://gitea.elpatron.me/elpatron/medi-customers.git
|
||||
cd medi-customers
|
||||
```
|
||||
|
||||
## Frontend-Funktionen
|
||||
|
||||
### Suchfunktion
|
||||
- Live-Suche mit 300ms Debounce
|
||||
- Spezifische Suchfelder für präzise Suche
|
||||
- Allgemeine Suche für breite Suche
|
||||
- Kombinierbare Suchkriterien
|
||||
- Trefferzähler für jedes Suchfeld
|
||||
|
||||
### Link-Generierung
|
||||
- `createPhoneLink()`: Erstellt tel:-Links mit führender 0
|
||||
- `createEmailLink()`: Erstellt mailto:-Links
|
||||
- `createAddressLink()`: Erstellt Google Maps-Links
|
||||
- `createCustomerLink()`: Erstellt KKBefe-System-Links
|
||||
|
||||
### Teilen-Funktion
|
||||
- Individueller Teilen-Button für jedes Suchergebnis
|
||||
- Kopiert einen direkten Link zum spezifischen Kunden
|
||||
- Visuelles Feedback beim Kopieren
|
||||
|
||||
## Fehlerbehandlung
|
||||
|
||||
- Logging für Backend-Fehler
|
||||
- Benutzerfreundliche Fehlermeldungen im Frontend
|
||||
- Graceful Degradation bei fehlenden Daten
|
||||
|
||||
## Entwicklung
|
||||
|
||||
### Debug-Modus
|
||||
Die Anwendung läuft standardmäßig im Debug-Modus:
|
||||
2. Umgebungsvariablen einrichten:
|
||||
```bash
|
||||
python app.py
|
||||
cp .env.example .env
|
||||
# Bearbeiten Sie die .env-Datei mit Ihren Einstellungen
|
||||
```
|
||||
|
||||
### Logging
|
||||
- Backend-Logs werden mit Python's logging-Modul erstellt
|
||||
- Log-Level: DEBUG
|
||||
- Logs werden in der Konsole ausgegeben
|
||||
|
||||
## Wartung
|
||||
|
||||
### Container-Verwaltung
|
||||
3. Docker Container starten:
|
||||
```bash
|
||||
# Container stoppen
|
||||
docker-compose down
|
||||
|
||||
# Container starten
|
||||
docker-compose up
|
||||
|
||||
# Container im Hintergrund starten
|
||||
docker-compose up -d
|
||||
|
||||
# Container-Logs anzeigen
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
### Datenaktualisierung
|
||||
1. CSV-Datei aktualisieren
|
||||
2. Container neu bauen und starten:
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose up --build
|
||||
```
|
||||
## Konfiguration
|
||||
|
||||
## Sicherheit
|
||||
Die Anwendung kann über folgende Umgebungsvariablen konfiguriert werden:
|
||||
|
||||
- Alle externen Links öffnen sich in neuen Tabs
|
||||
- Sicherheitsattribute für externe Links (noopener, noreferrer)
|
||||
- Input-Validierung im Backend
|
||||
- Fehlerbehandlung für ungültige Daten
|
||||
- `FLASK_APP`: Die Hauptanwendungsdatei (Standard: app.py)
|
||||
- `FLASK_ENV`: Die Flask-Umgebung (development/production)
|
||||
- `SECRET_KEY`: Der geheime Schlüssel für Flask-Sessions
|
||||
- `DATABASE_URL`: Die URL zur SQLite-Datenbank
|
||||
- `STATIC_PASSWORD`: Das Passwort für die Login-Seite
|
||||
- `ALLOWED_IP_RANGES`: Komma-getrennte Liste von IP-Bereichen, die direkten Zugriff haben
|
||||
- `LOG_LEVEL`: Das Logging-Level (INFO/DEBUG)
|
||||
|
||||
## Browser-Kompatibilität
|
||||
## IP-Bereiche
|
||||
|
||||
Die Anwendung wurde getestet mit:
|
||||
- Chrome (neueste Version)
|
||||
- Firefox (neueste Version)
|
||||
- Edge (neueste Version)
|
||||
- Safari (neueste Version)
|
||||
Die Anwendung unterstützt CIDR-Notation für IP-Bereiche. Beispiele:
|
||||
- Einzelne IP: 192.168.1.1/32
|
||||
- Subnetz: 192.168.1.0/24
|
||||
- Größeres Netzwerk: 10.0.0.0/8
|
||||
|
||||
## Version
|
||||
|
||||
Aktuelle Version: 1.2.4
|
||||
|
||||
## Lizenz
|
||||
|
||||
Alle Rechte vorbehalten. © 2025 medisoftware
|
||||
|
||||
## API-Beispiele
|
||||
|
||||
### Suche nach Name
|
||||
```bash
|
||||
curl "http://localhost:5001/search?name=Mustermann"
|
||||
```
|
||||
|
||||
### Suche nach Ort
|
||||
```bash
|
||||
curl "http://localhost:5001/search?ort=Berlin"
|
||||
```
|
||||
|
||||
### Suche nach Kundennummer
|
||||
```bash
|
||||
curl "http://localhost:5001/search?kundennummer=12345"
|
||||
```
|
||||
|
||||
### Suche nach Fachrichtung
|
||||
```bash
|
||||
curl "http://localhost:5001/search?fachrichtung=Zahnarzt"
|
||||
```
|
||||
|
||||
### Suche nach Telefon
|
||||
```bash
|
||||
curl "http://localhost:5001/search?telefon=030"
|
||||
```
|
||||
|
||||
### Allgemeine Suche
|
||||
```bash
|
||||
curl "http://localhost:5001/search?q=Suchbegriff"
|
||||
```
|
||||
|
||||
### Kombinierte Suche
|
||||
```bash
|
||||
# Suche nach Fachrichtung und Ort
|
||||
curl "http://localhost:5001/search?fachrichtung=Zahnarzt&ort=Berlin"
|
||||
|
||||
# Suche nach Name und Telefon
|
||||
curl "http://localhost:5001/search?name=Mustermann&telefon=030"
|
||||
|
||||
# Suche nach mehreren Kriterien
|
||||
curl "http://localhost:5001/search?fachrichtung=Zahnarzt&ort=Berlin&name=Schmidt"
|
||||
```
|
||||
|
||||
## Version
|
||||
|
||||
Aktuelle Version: [v1.2.4](CHANGELOG.md#v124---2024-03-19)
|
319
app.py
319
app.py
@@ -1,19 +1,188 @@
|
||||
from flask import Flask, render_template, request, jsonify, url_for
|
||||
from flask import Flask, render_template, request, jsonify, url_for, redirect, session
|
||||
import pandas as pd
|
||||
import os
|
||||
import logging
|
||||
import numpy as np
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
from dotenv import load_dotenv
|
||||
import requests
|
||||
from collections import defaultdict
|
||||
import ipaddress
|
||||
import csv
|
||||
import sqlite3
|
||||
from functools import wraps
|
||||
|
||||
app = Flask(__name__, static_folder='static')
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
app.secret_key = os.getenv('SECRET_KEY', 'default-secret-key')
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Version der Anwendung
|
||||
VERSION = "1.0.1"
|
||||
VERSION = "1.2.1"
|
||||
|
||||
# Pfad zur CSV-Datei
|
||||
CSV_FILE = "data/customers.csv"
|
||||
CSV_FILE = 'data/customers.csv'
|
||||
|
||||
# Pfad zur Datenbank
|
||||
DB_FILE = 'data/customers.db'
|
||||
|
||||
# Lade Umgebungsvariablen
|
||||
load_dotenv()
|
||||
|
||||
# Statisches Passwort aus der .env Datei
|
||||
STATIC_PASSWORD = os.getenv('LOGIN_PASSWORD', 'default-password')
|
||||
ALLOWED_IP_RANGES = os.getenv('ALLOWED_IP_RANGES', '').split(',')
|
||||
|
||||
def init_db():
|
||||
"""Initialisiert die SQLite-Datenbank mit der notwendigen Tabelle."""
|
||||
conn = sqlite3.connect(DB_FILE)
|
||||
c = conn.cursor()
|
||||
|
||||
# Erstelle die Tabelle mit Indizes
|
||||
c.execute('''
|
||||
CREATE TABLE IF NOT EXISTS customers (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
nummer TEXT,
|
||||
name TEXT,
|
||||
strasse TEXT,
|
||||
plz TEXT,
|
||||
ort TEXT,
|
||||
telefon TEXT,
|
||||
mobil TEXT,
|
||||
email TEXT,
|
||||
bemerkung TEXT,
|
||||
fachrichtung TEXT
|
||||
)
|
||||
''')
|
||||
|
||||
# Erstelle Indizes für alle Suchfelder
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_nummer ON customers(nummer)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_name ON customers(name)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_strasse ON customers(strasse)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_plz ON customers(plz)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_ort ON customers(ort)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_telefon ON customers(telefon)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_mobil ON customers(mobil)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_email ON customers(email)')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_fachrichtung ON customers(fachrichtung)')
|
||||
|
||||
# Erstelle einen zusammengesetzten Index für die häufigste Suchkombination
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_customers_name_ort ON customers(name, ort)')
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
logger.info('Datenbank initialisiert')
|
||||
|
||||
def import_csv():
|
||||
"""Importiert die Daten aus der CSV-Datei in die SQLite-Datenbank."""
|
||||
conn = sqlite3.connect(DB_FILE)
|
||||
c = conn.cursor()
|
||||
|
||||
# Lösche bestehende Daten
|
||||
c.execute('DELETE FROM customers')
|
||||
|
||||
try:
|
||||
# Lese die CSV-Datei mit pandas
|
||||
df = pd.read_csv(CSV_FILE, sep=',', encoding='utf-8', quotechar='"')
|
||||
|
||||
# Entferne Anführungszeichen aus den Spaltennamen
|
||||
df.columns = df.columns.str.strip('"')
|
||||
|
||||
# Entferne Anführungszeichen aus den Werten
|
||||
for col in df.columns:
|
||||
if df[col].dtype == 'object':
|
||||
df[col] = df[col].str.strip('"')
|
||||
|
||||
# Kombiniere Vorname und Nachname
|
||||
df['name'] = df['Vorname'] + ' ' + df['Nachname']
|
||||
|
||||
# Importiere die Daten
|
||||
for _, row in df.iterrows():
|
||||
c.execute('''
|
||||
INSERT INTO customers (nummer, name, strasse, plz, ort, telefon, mobil, email, bemerkung, fachrichtung)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
''', (
|
||||
row['Nummer'],
|
||||
row['name'],
|
||||
row['Strasse'],
|
||||
row['PLZ'],
|
||||
row['Ort'],
|
||||
row['Tel'],
|
||||
row['Handy'],
|
||||
row['mail'],
|
||||
f"Fachrichtung: {row['Fachrichtung']}",
|
||||
row['Fachrichtung']
|
||||
))
|
||||
|
||||
conn.commit()
|
||||
logger.info('CSV-Daten erfolgreich in die Datenbank importiert')
|
||||
except Exception as e:
|
||||
logger.error(f'Fehler beim Import der CSV-Daten: {str(e)}')
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def search_customers(search_params):
|
||||
"""Sucht nach Kunden basierend auf den Suchparametern."""
|
||||
conn = sqlite3.connect(DB_FILE)
|
||||
c = conn.cursor()
|
||||
|
||||
try:
|
||||
# Baue die SQL-Abfrage dynamisch auf
|
||||
query = "SELECT * FROM customers WHERE 1=1"
|
||||
params = []
|
||||
|
||||
# Allgemeine Suche über alle Felder
|
||||
if search_params.get('q'):
|
||||
search_term = f"%{search_params['q']}%"
|
||||
query += " AND (name LIKE ? OR ort LIKE ? OR nummer LIKE ? OR telefon LIKE ? OR mobil LIKE ? OR email LIKE ? OR bemerkung LIKE ? OR fachrichtung LIKE ?)"
|
||||
params.extend([search_term] * 8)
|
||||
|
||||
# Spezifische Suche für einzelne Felder
|
||||
if search_params.get('name'):
|
||||
query += " AND name LIKE ?"
|
||||
params.append(f"%{search_params['name']}%")
|
||||
|
||||
if search_params.get('ort'):
|
||||
query += " AND ort LIKE ?"
|
||||
params.append(f"%{search_params['ort']}%")
|
||||
|
||||
if search_params.get('nummer'):
|
||||
query += " AND nummer LIKE ?"
|
||||
params.append(f"%{search_params['nummer']}%")
|
||||
|
||||
if search_params.get('plz'):
|
||||
query += " AND plz LIKE ?"
|
||||
params.append(f"%{search_params['plz']}%")
|
||||
|
||||
# Führe die Abfrage aus
|
||||
c.execute(query, params)
|
||||
results = c.fetchall()
|
||||
|
||||
# Formatiere die Ergebnisse
|
||||
customers = []
|
||||
for row in results:
|
||||
customer = {
|
||||
'id': row[0],
|
||||
'nummer': row[1],
|
||||
'name': row[2],
|
||||
'strasse': row[3],
|
||||
'plz': row[4],
|
||||
'ort': row[5],
|
||||
'telefon': row[6],
|
||||
'mobil': row[7],
|
||||
'email': row[8],
|
||||
'bemerkung': row[9],
|
||||
'fachrichtung': row[10]
|
||||
}
|
||||
customers.append(customer)
|
||||
|
||||
return customers
|
||||
except Exception as e:
|
||||
logger.error(f"Fehler bei der Kundensuche: {str(e)}")
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def clean_dataframe(df):
|
||||
"""Konvertiert NaN-Werte in None für JSON-Kompatibilität"""
|
||||
@@ -27,7 +196,14 @@ def load_data():
|
||||
logger.error(f"CSV-Datei '{CSV_FILE}' nicht gefunden!")
|
||||
return None
|
||||
|
||||
df = pd.read_csv(CSV_FILE, encoding='utf-8')
|
||||
# Lade CSV mit Komma als Trennzeichen
|
||||
df = pd.read_csv(CSV_FILE, sep=',', encoding='utf-8', quotechar='"')
|
||||
# Entferne Anführungszeichen aus den Spaltennamen
|
||||
df.columns = df.columns.str.strip('"')
|
||||
# Entferne Anführungszeichen aus den Werten
|
||||
for col in df.columns:
|
||||
if df[col].dtype == 'object':
|
||||
df[col] = df[col].str.strip('"')
|
||||
df = clean_dataframe(df)
|
||||
logger.info(f"CSV-Datei erfolgreich geladen. {len(df)} Einträge gefunden.")
|
||||
return df
|
||||
@@ -35,70 +211,95 @@ def load_data():
|
||||
logger.error(f"Fehler beim Laden der CSV-Datei: {str(e)}")
|
||||
return None
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
# Versuche, die tatsächliche Client-IP aus dem X-Forwarded-For-Header zu erhalten
|
||||
client_ip = request.headers.get('X-Forwarded-For', request.remote_addr)
|
||||
allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '').split(',')
|
||||
|
||||
logger.info(f"Client-IP: {client_ip}")
|
||||
logger.info(f"Erlaubte IP-Bereiche: {allowed_ip_ranges}")
|
||||
logger.info(f"Session Status: {session}")
|
||||
|
||||
# Überprüfen, ob die IP-Adresse in einem der erlaubten Subnetze liegt
|
||||
client_ip_obj = ipaddress.ip_address(client_ip)
|
||||
for ip_range in allowed_ip_ranges:
|
||||
try:
|
||||
network = ipaddress.ip_network(ip_range.strip(), strict=False)
|
||||
logger.info(f"Überprüfe Netzwerk: {network}")
|
||||
if client_ip_obj in network:
|
||||
logger.info("Client-IP ist im erlaubten Bereich.")
|
||||
session['logged_in'] = True
|
||||
session.permanent = True # Session bleibt bestehen
|
||||
return redirect(url_for('index'))
|
||||
except ValueError:
|
||||
logger.error(f"Ungültiges Netzwerkformat: {ip_range}")
|
||||
|
||||
if request.method == 'POST':
|
||||
password = request.form.get('password')
|
||||
logger.info(f"Login-Versuch mit Passwort: {'*' * len(password) if password else 'None'}")
|
||||
if password == STATIC_PASSWORD:
|
||||
session['logged_in'] = True
|
||||
session.permanent = True # Session bleibt bestehen
|
||||
logger.info("Login erfolgreich, Session gesetzt")
|
||||
return redirect(url_for('index'))
|
||||
else:
|
||||
logger.warning("Falsches Passwort eingegeben")
|
||||
return render_template('login.html', error="Falsches Passwort")
|
||||
|
||||
logger.info("Zeige Login-Seite")
|
||||
return render_template('login.html')
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
logger.info(f"Index-Route aufgerufen. Session Status: {session}")
|
||||
if not session.get('logged_in'):
|
||||
logger.info("Benutzer nicht eingeloggt, Weiterleitung zum Login")
|
||||
return redirect(url_for('login'))
|
||||
|
||||
allowed_ip_ranges = os.getenv('ALLOWED_IP_RANGES', '')
|
||||
client_ip = request.headers.get('X-Forwarded-For', request.remote_addr)
|
||||
logger.info(f"Client-IP: {client_ip}")
|
||||
logger.info(f"Erlaubte IP-Bereiche: {allowed_ip_ranges}")
|
||||
return render_template('index.html', allowed_ip_ranges=allowed_ip_ranges)
|
||||
|
||||
@app.route('/search')
|
||||
def search():
|
||||
try:
|
||||
# CSV-Datei laden
|
||||
df = load_data()
|
||||
if df is None:
|
||||
return jsonify({"error": "Datenbank konnte nicht geladen werden"}), 500
|
||||
# Hole die Suchparameter aus der Anfrage
|
||||
search_params = {
|
||||
'name': request.args.get('name', ''),
|
||||
'ort': request.args.get('ort', ''),
|
||||
'nummer': request.args.get('nummer', ''),
|
||||
'plz': request.args.get('plz', ''),
|
||||
'telefon': request.args.get('telefon', ''),
|
||||
'email': request.args.get('email', ''),
|
||||
'q': request.args.get('q', ''),
|
||||
'fachrichtung': request.args.get('fachrichtung', '')
|
||||
}
|
||||
|
||||
# Suchparameter aus der URL holen
|
||||
name = request.args.get('name', '').strip()
|
||||
ort = request.args.get('ort', '').strip()
|
||||
kundennummer = request.args.get('kundennummer', '').strip()
|
||||
fachrichtung = request.args.get('fachrichtung', '').strip()
|
||||
telefon = request.args.get('telefon', '').strip()
|
||||
query = request.args.get('q', '').strip()
|
||||
# Führe die Suche in der Datenbank durch
|
||||
results = search_customers(search_params)
|
||||
|
||||
# Wenn keine spezifischen Suchkriterien angegeben sind, aber eine allgemeine Suche
|
||||
if not any([name, ort, kundennummer, fachrichtung, telefon]) and query:
|
||||
# Suche in allen relevanten Feldern
|
||||
mask = (
|
||||
df['Vorname'].str.contains(query, case=False, na=False) |
|
||||
df['Nachname'].str.contains(query, case=False, na=False) |
|
||||
df['Ort'].str.contains(query, case=False, na=False) |
|
||||
df['Nummer'].astype(str).str.contains(query, case=False, na=False) |
|
||||
df['Fachrichtung'].str.contains(query, case=False, na=False) |
|
||||
df['Tel'].astype(str).str.contains(query, case=False, na=False)
|
||||
)
|
||||
else:
|
||||
# Spezifische Suche
|
||||
mask = pd.Series(True, index=df.index)
|
||||
# Protokolliere die Anzahl der gefundenen Ergebnisse
|
||||
logger.info(f'Suchergebnisse gefunden: {len(results)}')
|
||||
|
||||
if name:
|
||||
name_mask = (
|
||||
df['Vorname'].str.contains(name, case=False, na=False) |
|
||||
df['Nachname'].str.contains(name, case=False, na=False)
|
||||
)
|
||||
mask &= name_mask
|
||||
|
||||
if ort:
|
||||
ort_mask = df['Ort'].str.contains(ort, case=False, na=False)
|
||||
mask &= ort_mask
|
||||
|
||||
if kundennummer:
|
||||
kundennummer_mask = df['Nummer'].astype(str).str.contains(kundennummer, case=False, na=False)
|
||||
mask &= kundennummer_mask
|
||||
|
||||
if fachrichtung:
|
||||
fachrichtung_mask = df['Fachrichtung'].str.contains(fachrichtung, case=False, na=False)
|
||||
mask &= fachrichtung_mask
|
||||
|
||||
if telefon:
|
||||
telefon_mask = df['Tel'].astype(str).str.contains(telefon, case=False, na=False)
|
||||
mask &= telefon_mask
|
||||
|
||||
results = df[mask].to_dict('records')
|
||||
logger.info(f"{len(results)} Ergebnisse gefunden")
|
||||
return jsonify(results)
|
||||
except Exception as e:
|
||||
logger.error(f"Fehler bei der Suche: {str(e)}")
|
||||
logger.error(f'Fehler bei der Suche: {str(e)}')
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
def init_app(app):
|
||||
"""Initialisiert die Anwendung mit allen notwendigen Einstellungen."""
|
||||
with app.app_context():
|
||||
# Initialisiere die Datenbank
|
||||
init_db()
|
||||
# Importiere die CSV-Daten
|
||||
import_csv()
|
||||
logger.info("Anwendung erfolgreich initialisiert")
|
||||
|
||||
# Initialisiere die App
|
||||
init_app(app)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
app.run(debug=True, port=5001)
|
@@ -1,14 +1,14 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "5001:5000"
|
||||
volumes:
|
||||
- .:/app
|
||||
- ./data:/app/data
|
||||
environment:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_ENV=development
|
||||
- FLASK_DEBUG=1
|
||||
- FLASK_ENV=production
|
||||
- SECRET_KEY=your-super-secret-key-here
|
||||
- LOGIN_PASSWORD=changeme
|
||||
- ALLOWED_IP_RANGES=213.178.68.218/29,192.168.0.0/24,192.168.177.0/24
|
||||
command: flask run --host=0.0.0.0
|
@@ -2,3 +2,4 @@ flask==3.0.2
|
||||
pandas==2.2.1
|
||||
numpy==1.26.4
|
||||
python-dotenv==1.0.1
|
||||
requests==2.32.3
|
238
static/css/styles.css
Normal file
238
static/css/styles.css
Normal file
@@ -0,0 +1,238 @@
|
||||
body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex: 1 0 auto;
|
||||
padding: 2rem 0;
|
||||
margin-bottom: 4rem; /* Platz für die fixierte Fußzeile */
|
||||
}
|
||||
|
||||
.search-container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.result-card {
|
||||
margin-bottom: 1rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.result-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: none;
|
||||
text-align: center;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
.phone-link, .email-link, .address-link, .customer-link {
|
||||
text-decoration: none;
|
||||
color: #0d6efd;
|
||||
}
|
||||
|
||||
.phone-link:hover, .email-link:hover, .address-link:hover, .customer-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.search-icon, .reset-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #6c757d;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.reset-icon {
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
right: 35px;
|
||||
}
|
||||
|
||||
.reset-icon.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.search-icon.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customer-number {
|
||||
color: #6c757d;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.footer {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-top: 1px solid #dee2e6;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.share-feedback {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
display: none;
|
||||
animation: fadeOut 2s forwards;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
@keyframes fadeOut {
|
||||
0% { opacity: 1; }
|
||||
70% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.share-button {
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 20px;
|
||||
font-size: 0.9rem;
|
||||
background-color: #0d6efd;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.share-button:hover {
|
||||
background-color: #0b5ed7;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.share-button i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.search-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-field {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.result-counts {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
padding: 0.5rem;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.result-count {
|
||||
background-color: #e9ecef;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.9em;
|
||||
color: #6c757d;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.result-count.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.location-pin {
|
||||
color: #dc3545;
|
||||
margin-left: 4px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.customer-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.customer-card:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.customer-info {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-top: 1px solid #dee2e6;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.footer-link {
|
||||
color: #0d6efd;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.general-search {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.general-search .input-group {
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.general-search .form-control {
|
||||
height: 3.5rem;
|
||||
font-size: 1.2rem;
|
||||
padding: 0.75rem 1rem;
|
||||
}
|
||||
|
||||
.general-search .search-icon,
|
||||
.general-search .reset-icon {
|
||||
font-size: 1.2rem;
|
||||
padding: 0 1rem;
|
||||
}
|
BIN
static/medisoftware_logo_rb_200.png
Normal file
BIN
static/medisoftware_logo_rb_200.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
@@ -7,182 +7,66 @@
|
||||
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.main-content {
|
||||
flex: 1 0 auto;
|
||||
padding: 2rem 0;
|
||||
}
|
||||
.search-container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.result-card {
|
||||
margin-bottom: 1rem;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.result-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||
}
|
||||
.loading {
|
||||
display: none;
|
||||
text-align: center;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
.phone-link, .email-link, .address-link, .customer-link {
|
||||
text-decoration: none;
|
||||
color: #0d6efd;
|
||||
}
|
||||
.phone-link:hover, .email-link:hover, .address-link:hover, .customer-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.search-icon, .reset-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #6c757d;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.reset-icon {
|
||||
right: 10px;
|
||||
}
|
||||
.search-icon {
|
||||
right: 35px;
|
||||
}
|
||||
.reset-icon.visible {
|
||||
display: block;
|
||||
}
|
||||
.search-icon.visible {
|
||||
display: block;
|
||||
}
|
||||
.customer-number {
|
||||
color: #6c757d;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.footer {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-top: 1px solid #dee2e6;
|
||||
width: 100%;
|
||||
}
|
||||
.share-feedback {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
display: none;
|
||||
animation: fadeOut 2s forwards;
|
||||
z-index: 1000;
|
||||
}
|
||||
@keyframes fadeOut {
|
||||
0% { opacity: 1; }
|
||||
70% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
.card-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.share-button {
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.search-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.search-field {
|
||||
position: relative;
|
||||
}
|
||||
.input-group {
|
||||
position: relative;
|
||||
}
|
||||
.result-counts {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
padding: 0.5rem;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.result-count {
|
||||
background-color: #e9ecef;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.9em;
|
||||
color: #6c757d;
|
||||
display: none;
|
||||
}
|
||||
.result-count.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
.location-pin {
|
||||
color: #dc3545;
|
||||
margin-left: 4px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
</style>
|
||||
<link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="main-content">
|
||||
<div class="container search-container">
|
||||
<h1 class="text-center mb-4">medisoftware Kundensuche</h1>
|
||||
<div class="container">
|
||||
<div class="text-center mb-4">
|
||||
<img src="{{ url_for('static', filename='medisoftware_logo_rb_200.png') }}" alt="medisoftware Logo" class="img-fluid" style="max-width: 200px;">
|
||||
</div>
|
||||
<div class="search-container">
|
||||
<h1 class="text-center mb-4">Kundensuche</h1>
|
||||
|
||||
<div class="input-group mb-4 position-relative">
|
||||
<input type="text" id="searchInput" class="form-control form-control-lg"
|
||||
placeholder="Allgemeine Suche...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="searchReset"></i>
|
||||
<span class="search-icon">🔍</span>
|
||||
<div class="general-search mb-4">
|
||||
<div class="input-group">
|
||||
<input type="text" id="q" class="form-control form-control-lg" placeholder="Allgemeine Suche" oninput="searchCustomers()">
|
||||
<i class="fas fa-times reset-icon" onclick="clearInput('q')"></i>
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-fields">
|
||||
<div class="search-field">
|
||||
<input type="text" id="nameInput" class="form-control"
|
||||
placeholder="Name...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="nameReset"></i>
|
||||
<div class="input-group">
|
||||
<input type="text" id="nameInput" class="form-control" placeholder="Name" oninput="searchCustomers()">
|
||||
<i class="fas fa-times reset-icon" onclick="clearInput('nameInput')"></i>
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
<div class="search-field">
|
||||
<input type="text" id="ortInput" class="form-control"
|
||||
placeholder="Ort...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="ortReset"></i>
|
||||
</div>
|
||||
|
||||
<div class="search-field">
|
||||
<input type="text" id="kundennummerInput" class="form-control"
|
||||
placeholder="Kundennummer...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="kundennummerReset"></i>
|
||||
<div class="input-group">
|
||||
<input type="text" id="ortInput" class="form-control" placeholder="Ort" oninput="searchCustomers()">
|
||||
<i class="fas fa-times reset-icon" onclick="clearInput('ortInput')"></i>
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
<div class="search-field">
|
||||
<input type="text" id="fachrichtungInput" class="form-control"
|
||||
placeholder="Fachrichtung...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="fachrichtungReset"></i>
|
||||
</div>
|
||||
|
||||
<div class="search-field">
|
||||
<input type="text" id="telefonInput" class="form-control"
|
||||
placeholder="Telefon...">
|
||||
<i class="fa-solid fa-xmark reset-icon" id="telefonReset"></i>
|
||||
<div class="input-group">
|
||||
<input type="text" id="nummerInput" class="form-control" placeholder="Kundennummer" oninput="searchCustomers()">
|
||||
<i class="fas fa-times reset-icon" onclick="clearInput('nummerInput')"></i>
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-field">
|
||||
<div class="input-group">
|
||||
<input type="text" id="plzInput" class="form-control" placeholder="PLZ" oninput="searchCustomers()">
|
||||
<i class="fas fa-times reset-icon" onclick="clearInput('plzInput')"></i>
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="fachrichtungInput">Fachrichtung</label>
|
||||
<input type="text" class="form-control" id="fachrichtungInput" placeholder="Fachrichtung eingeben">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="result-counts">
|
||||
<span id="generalCount" class="result-count"></span>
|
||||
<span id="resultCount" class="result-count"></span>
|
||||
</div>
|
||||
|
||||
<div id="loading" class="loading">
|
||||
@@ -191,18 +75,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="results" class="mt-4">
|
||||
<!-- Hier werden die Suchergebnisse angezeigt -->
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="shareFeedback" class="share-feedback">
|
||||
Link kopiert!
|
||||
Link in die Zwischenablage kopiert!
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p class="mb-0">(c) 2025 <a href="https://medisoftware.de" target="_blank" rel="noopener noreferrer" class="text-decoration-none">medisoftware</a></p>
|
||||
<div class="footer-content">
|
||||
Proudly made with ❤️ and 🍺 by <a href="https://www.medisoftware.de" target="_blank" class="footer-link">medisoftware</a>
|
||||
<div style="font-size: 0.8em;">Version: v1.2.2</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
@@ -211,9 +97,31 @@
|
||||
|
||||
function createPhoneLink(phone) {
|
||||
if (!phone) return 'N/A';
|
||||
const cleaned = phone.replace(/\D/g, '');
|
||||
const telLink = '0' + cleaned;
|
||||
return `<a href="tel:${telLink}" class="phone-link">${phone}</a>`;
|
||||
|
||||
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||
const allowedIPRanges = '{{ allowed_ip_ranges }}'.split(',');
|
||||
|
||||
// Überprüfen, ob die Client-IP in einem der erlaubten Bereiche liegt
|
||||
const isAllowed = allowedIPRanges.some(range => isIPInSubnet(clientIP, range.trim()));
|
||||
|
||||
// Entferne alle nicht-numerischen Zeichen
|
||||
let cleanNumber = phone.replace(/\D/g, '');
|
||||
|
||||
// Füge eine führende 0 hinzu, wenn isAllowed true ist
|
||||
if (isAllowed) {
|
||||
cleanNumber = '0' + cleanNumber;
|
||||
}
|
||||
|
||||
// Formatiere die Nummer
|
||||
let formattedNumber = cleanNumber;
|
||||
if (cleanNumber.length === 11) {
|
||||
formattedNumber = cleanNumber.replace(/(\d{4})(\d{7})/, '$1-$2');
|
||||
} else if (cleanNumber.length === 10) {
|
||||
formattedNumber = cleanNumber.replace(/(\d{3})(\d{7})/, '$1-$2');
|
||||
}
|
||||
|
||||
// Erstelle den Link
|
||||
return `<a href="tel:${cleanNumber}" class="phone-link">${formattedNumber}</a>`;
|
||||
}
|
||||
|
||||
function createEmailLink(email) {
|
||||
@@ -221,23 +129,66 @@
|
||||
return `<a href="mailto:${email}" class="email-link">${email}</a>`;
|
||||
}
|
||||
|
||||
function highlightText(text, searchTerm) {
|
||||
if (!searchTerm) return text;
|
||||
const regex = new RegExp(`(${searchTerm})`, 'gi');
|
||||
return text.replace(regex, '<mark>$1</mark>');
|
||||
}
|
||||
|
||||
function createAddressLink(street, plz, city) {
|
||||
if (!street || !plz || !city) return 'N/A';
|
||||
const address = `${street}, ${plz} ${city}`;
|
||||
const searchQuery = encodeURIComponent(address);
|
||||
return `${address}
|
||||
const routeQuery = encodeURIComponent(address);
|
||||
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||
return `<span class="address-text">${address}</span>
|
||||
<a href="https://www.google.com/maps/search/?api=1&query=${searchQuery}"
|
||||
class="address-link" target="_blank" rel="noopener noreferrer">
|
||||
<i class="fa-solid fa-location-pin location-pin"></i>
|
||||
</a>
|
||||
<a href="https://www.google.com/maps/dir/?api=1&destination=${routeQuery}"
|
||||
class="route-link" target="_blank" rel="noopener noreferrer">
|
||||
<i class="fa-solid fa-car route-pin"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
function createCustomerLink(customerNumber) {
|
||||
if (!customerNumber) return 'N/A';
|
||||
return `<a href="medisw:openkkbefe/P${customerNumber}?NetGrp=4"
|
||||
class="customer-link" target="_blank" rel="noopener noreferrer">
|
||||
${customerNumber}
|
||||
</a>`;
|
||||
function adjustCustomerNumber(number) {
|
||||
return number - 12000;
|
||||
}
|
||||
|
||||
function isIPInSubnet(ip, subnet) {
|
||||
// Teile die IP und das Subnetz in ihre Komponenten
|
||||
const [subnetIP, bits] = subnet.split('/');
|
||||
const ipParts = ip.split('.').map(Number);
|
||||
const subnetParts = subnetIP.split('.').map(Number);
|
||||
|
||||
// Konvertiere IPs in 32-bit Zahlen
|
||||
const ipNum = (ipParts[0] << 24) | (ipParts[1] << 16) | (ipParts[2] << 8) | ipParts[3];
|
||||
const subnetNum = (subnetParts[0] << 24) | (subnetParts[1] << 16) | (subnetParts[2] << 8) | subnetParts[3];
|
||||
|
||||
// Erstelle die Subnetzmaske
|
||||
const mask = ~((1 << (32 - bits)) - 1);
|
||||
|
||||
// Prüfe, ob die IP im Subnetz liegt
|
||||
return (ipNum & mask) === (subnetNum & mask);
|
||||
}
|
||||
|
||||
function createCustomerLink(nummer) {
|
||||
const clientIP = '{{ request.headers.get("X-Forwarded-For", request.remote_addr) }}';
|
||||
const allowedIPRanges = '{{ allowed_ip_ranges }}'.split(',');
|
||||
|
||||
// Überprüfe, ob die Client-IP in einem der erlaubten Bereiche liegt
|
||||
const isAllowed = allowedIPRanges.some(range => {
|
||||
const trimmedRange = range.trim();
|
||||
return isIPInSubnet(clientIP, trimmedRange);
|
||||
});
|
||||
|
||||
const adjustedNumber = adjustCustomerNumber(nummer);
|
||||
if (isAllowed) {
|
||||
return `<a href="medisw:openkkbefe/P${adjustedNumber}?NetGrp=4" class="customer-link">${nummer}</a>`;
|
||||
} else {
|
||||
return nummer;
|
||||
}
|
||||
}
|
||||
|
||||
function showCopyFeedback() {
|
||||
@@ -258,124 +209,138 @@
|
||||
await navigator.clipboard.writeText(url.toString());
|
||||
showCopyFeedback();
|
||||
} catch (err) {
|
||||
console.error('Fehler beim Kopieren:', err);
|
||||
// Fehlerbehandlung ohne console.log
|
||||
}
|
||||
}
|
||||
|
||||
function updateResultCounts() {
|
||||
// Nur Gesamtzahl anzeigen
|
||||
const generalCount = lastResults.length;
|
||||
document.getElementById('generalCount').textContent =
|
||||
document.getElementById('resultCount').textContent =
|
||||
generalCount > 0 ? `${generalCount} Treffer gefunden` : '';
|
||||
document.getElementById('generalCount').classList.toggle('visible', generalCount > 0);
|
||||
document.getElementById('resultCount').classList.toggle('visible', generalCount > 0);
|
||||
}
|
||||
|
||||
function searchCustomers() {
|
||||
const name = document.getElementById('nameInput').value;
|
||||
const ort = document.getElementById('ortInput').value;
|
||||
const kundennummer = document.getElementById('kundennummerInput').value;
|
||||
const fachrichtung = document.getElementById('fachrichtungInput').value;
|
||||
const telefon = document.getElementById('telefonInput').value;
|
||||
const query = document.getElementById('searchInput').value;
|
||||
function displayResults(results) {
|
||||
const resultsDiv = document.getElementById('results');
|
||||
resultsDiv.innerHTML = '';
|
||||
|
||||
// Prüfe, ob mindestens ein Suchfeld ausgefüllt ist
|
||||
if (!name && !ort && !kundennummer && !fachrichtung && !telefon && !query) {
|
||||
document.getElementById('results').innerHTML = '';
|
||||
lastResults = [];
|
||||
updateResultCounts();
|
||||
if (results.length === 0) {
|
||||
resultsDiv.innerHTML = '<p>Keine Ergebnisse gefunden.</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Lade-Animation anzeigen
|
||||
document.getElementById('loading').style.display = 'block';
|
||||
document.getElementById('results').innerHTML = '';
|
||||
const searchTerm = document.getElementById('q').value;
|
||||
|
||||
// URL-Parameter erstellen
|
||||
const params = new URLSearchParams();
|
||||
if (name) params.append('name', name);
|
||||
if (ort) params.append('ort', ort);
|
||||
if (kundennummer) params.append('kundennummer', kundennummer);
|
||||
if (fachrichtung) params.append('fachrichtung', fachrichtung);
|
||||
if (telefon) params.append('telefon', telefon);
|
||||
if (query) params.append('q', query);
|
||||
|
||||
fetch(`/search?${params.toString()}`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
return response.json().then(data => {
|
||||
throw new Error(data.error || 'Ein Fehler ist aufgetreten');
|
||||
results.forEach(customer => {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'customer-card';
|
||||
card.innerHTML = `
|
||||
<div class="customer-info">
|
||||
<h5 class="mb-1">${highlightText(customer.name, searchTerm)}</h5>
|
||||
<p class="mb-1 customer-number">${createCustomerLink(customer.nummer)}</p>
|
||||
<p class="mb-1">${createAddressLink(customer.strasse, customer.plz, customer.ort)}</p>
|
||||
<p class="mb-1">Tel: ${createPhoneLink(customer.telefon)}</p>
|
||||
${customer.mobil ? `<p class="mb-1">Mobil: ${createPhoneLink(customer.mobil)}</p>` : ''}
|
||||
${customer.email ? `<p class="mb-1">E-Mail: ${createEmailLink(customer.email)}</p>` : ''}
|
||||
${customer.bemerkung ? `<p class="mb-1">Bemerkung: ${customer.bemerkung}</p>` : ''}
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<button class="share-button" onclick="copyCustomerLink('${customer.nummer}')">
|
||||
<i class="fas fa-share-alt"></i> Teilen
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
resultsDiv.appendChild(card);
|
||||
});
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
|
||||
function searchCustomers() {
|
||||
const q = document.getElementById('q').value;
|
||||
const name = document.getElementById('nameInput').value;
|
||||
const ort = document.getElementById('ortInput').value;
|
||||
const nummer = document.getElementById('nummerInput').value;
|
||||
const plz = document.getElementById('plzInput').value;
|
||||
const fachrichtung = document.getElementById('fachrichtungInput').value;
|
||||
|
||||
// Zeige das Lade-Icon
|
||||
document.getElementById('loading').style.display = 'block';
|
||||
|
||||
// Baue die Suchanfrage
|
||||
const params = new URLSearchParams();
|
||||
if (q) params.append('q', q);
|
||||
if (name) params.append('name', name);
|
||||
if (ort) params.append('ort', ort);
|
||||
if (nummer) params.append('nummer', nummer);
|
||||
if (plz) params.append('plz', plz);
|
||||
if (fachrichtung) params.append('fachrichtung', fachrichtung);
|
||||
|
||||
// Führe die Suche durch
|
||||
fetch('/search?' + params.toString())
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Verstecke das Lade-Icon
|
||||
document.getElementById('loading').style.display = 'none';
|
||||
|
||||
if (data.error) {
|
||||
return;
|
||||
}
|
||||
|
||||
lastResults = data;
|
||||
updateResultCounts();
|
||||
|
||||
const resultsDiv = document.getElementById('results');
|
||||
resultsDiv.innerHTML = '';
|
||||
|
||||
if (data.length === 0) {
|
||||
resultsDiv.innerHTML = '<div class="alert alert-info">Keine Ergebnisse gefunden.</div>';
|
||||
lastResults = [];
|
||||
updateResultCounts();
|
||||
resultsDiv.innerHTML = '<p class="text-center text-muted">Keine Ergebnisse gefunden</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
data.forEach(customer => {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'card result-card';
|
||||
card.className = 'customer-card';
|
||||
card.innerHTML = `
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
${customer.Vorname} ${customer.Nachname}
|
||||
<span class="customer-number ms-2">(Kunde: ${createCustomerLink(customer.Nummer)})</span>
|
||||
</h5>
|
||||
<p class="card-text">
|
||||
<strong>Fachrichtung:</strong> ${customer.Fachrichtung || 'N/A'}<br>
|
||||
<strong>Adresse:</strong> ${createAddressLink(customer.Strasse, customer.PLZ, customer.Ort)}<br>
|
||||
<strong>Telefon:</strong> ${createPhoneLink(customer.Tel)}<br>
|
||||
<strong>E-Mail:</strong> ${createEmailLink(customer.mail)}
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="btn btn-outline-primary share-button" onclick="copyCustomerLink('${customer.Nummer}')">
|
||||
🔗 Teilen
|
||||
</button>
|
||||
<div class="customer-info">
|
||||
<h5 class="mb-1">${highlightText(customer.name, q || name)}</h5>
|
||||
<p class="mb-1 customer-number">${createCustomerLink(customer.nummer)}</p>
|
||||
<p class="mb-1">${createAddressLink(customer.strasse, customer.plz, customer.ort)}</p>
|
||||
<p class="mb-1">Tel: ${createPhoneLink(customer.telefon)}</p>
|
||||
${customer.mobil ? `<p class="mb-1">Mobil: ${createPhoneLink(customer.mobil)}</p>` : ''}
|
||||
${customer.email ? `<p class="mb-1">E-Mail: ${createEmailLink(customer.email)}</p>` : ''}
|
||||
${customer.bemerkung ? `<p class="mb-1">Bemerkung: ${customer.bemerkung}</p>` : ''}
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<button class="share-button" onclick="copyCustomerLink('${customer.nummer}')">
|
||||
<i class="fas fa-share-alt"></i> Teilen
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
resultsDiv.appendChild(card);
|
||||
});
|
||||
|
||||
lastResults = data;
|
||||
updateResultCounts();
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fehler:', error);
|
||||
document.getElementById('results').innerHTML =
|
||||
`<div class="alert alert-danger">${error.message}</div>`;
|
||||
lastResults = [];
|
||||
updateResultCounts();
|
||||
})
|
||||
.finally(() => {
|
||||
document.getElementById('loading').style.display = 'none';
|
||||
});
|
||||
}
|
||||
|
||||
// Event-Listener für die Live-Suche
|
||||
const searchInputs = [
|
||||
document.getElementById('q'),
|
||||
document.getElementById('nameInput'),
|
||||
document.getElementById('ortInput'),
|
||||
document.getElementById('kundennummerInput'),
|
||||
document.getElementById('fachrichtungInput'),
|
||||
document.getElementById('telefonInput'),
|
||||
document.getElementById('searchInput')
|
||||
document.getElementById('nummerInput'),
|
||||
document.getElementById('plzInput'),
|
||||
document.getElementById('fachrichtungInput')
|
||||
];
|
||||
|
||||
const resetIcons = [
|
||||
document.getElementById('nameReset'),
|
||||
document.getElementById('ortReset'),
|
||||
document.getElementById('kundennummerReset'),
|
||||
document.getElementById('fachrichtungReset'),
|
||||
document.getElementById('telefonReset'),
|
||||
document.getElementById('searchReset')
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'q\')"]'),
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'nameInput\')"]'),
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'ortInput\')"]'),
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'nummerInput\')"]'),
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'plzInput\')"]'),
|
||||
document.querySelector('.reset-icon[onclick="clearInput(\'fachrichtungInput\')"]')
|
||||
];
|
||||
|
||||
searchInputs.forEach((input, index) => {
|
||||
@@ -400,18 +365,14 @@
|
||||
const name = urlParams.get('name');
|
||||
const ort = urlParams.get('ort');
|
||||
const kundennummer = urlParams.get('kundennummer');
|
||||
const fachrichtung = urlParams.get('fachrichtung');
|
||||
const telefon = urlParams.get('telefon');
|
||||
const query = urlParams.get('q');
|
||||
const plz = urlParams.get('plz');
|
||||
|
||||
if (name) document.getElementById('nameInput').value = name;
|
||||
if (ort) document.getElementById('ortInput').value = ort;
|
||||
if (kundennummer) document.getElementById('kundennummerInput').value = kundennummer;
|
||||
if (fachrichtung) document.getElementById('fachrichtungInput').value = fachrichtung;
|
||||
if (telefon) document.getElementById('telefonInput').value = telefon;
|
||||
if (query) document.getElementById('searchInput').value = query;
|
||||
if (kundennummer) document.getElementById('nummerInput').value = kundennummer;
|
||||
if (plz) document.getElementById('plzInput').value = plz;
|
||||
|
||||
if (name || ort || kundennummer || fachrichtung || telefon || query) {
|
||||
if (name || ort || kundennummer || plz) {
|
||||
searchCustomers();
|
||||
}
|
||||
});
|
||||
|
60
templates/login.html
Normal file
60
templates/login.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>medisoftware Kundensuche</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.main-content {
|
||||
flex: 1 0 auto;
|
||||
padding: 2rem 0;
|
||||
margin-bottom: 4rem; /* Platz für die fixierte Fußzeile */
|
||||
}
|
||||
.footer {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-top: 1px solid #dee2e6;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-5">
|
||||
<div class="text-center mb-4">
|
||||
<img src="{{ url_for('static', filename='medisoftware_logo_rb_200.png') }}" alt="medisoftware Logo" class="img-fluid" style="max-width: 200px;">
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-4">
|
||||
<h2 class="text-center">Login</h2>
|
||||
<form method="POST" action="/login">
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Passwort</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Einloggen</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="footer-content">
|
||||
Proudly made with ❤️ and 🍺 by <a href="https://www.medisoftware.de" target="_blank" class="footer-link">medisoftware</a>
|
||||
<div style="font-size: 0.8em;">Version: v1.2.3</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user