impfwarteliste angepasst
This commit is contained in:
+61
-17
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||
// WICHTIG: Pfade aus /admin heraus korrekt auflösen
|
||||
require_once __DIR__ . "/../inc/config.inc.php";
|
||||
require_once __DIR__ . "/../inc/functions.inc.php";
|
||||
require_once __DIR__ . "/../inc/impfworkflow_notifications.inc.php";
|
||||
|
||||
// Login prüfen
|
||||
// Login prüfen
|
||||
$user = check_admin_user();
|
||||
|
||||
include __DIR__ . "/templates/header.inc.php";
|
||||
|
||||
$user = check_admin_user();
|
||||
$internUserId = (int)$_SESSION['auth']['id'];
|
||||
$activeTab = 'data';
|
||||
|
||||
if (!$user) { echo "<div class='container main-container'><h3>Erst anmelden: <a href=login.php>Login</a></h3><br>";
|
||||
|
||||
@@ -22,11 +24,12 @@ if(isset($_GET['save'])) {
|
||||
$save = $_GET['save'];
|
||||
|
||||
if($save == 'personal_data') {
|
||||
$activeTab = 'data';
|
||||
$vorname = trim($_POST['vorname']);
|
||||
$nachname = trim($_POST['nachname']);
|
||||
|
||||
if($vorname == "" || $nachname == "") {
|
||||
$error_msg = "Bitte Vor- und Nachname ausfüllen.";
|
||||
$error_msg = "Bitte Vor- und Nachname ausfüllen.";
|
||||
} else {
|
||||
$statement = $pdo->prepare("UPDATE users SET vorname = :vorname, nachname = :nachname, updated_at=NOW() WHERE id = :userid");
|
||||
$result = $statement->execute(array('vorname' => $vorname, 'nachname'=> $nachname, 'userid' => $user['id'] ));
|
||||
@@ -34,14 +37,15 @@ if(isset($_GET['save'])) {
|
||||
$success_msg = "Daten erfolgreich gespeichert.";
|
||||
}
|
||||
} else if($save == 'email') {
|
||||
$activeTab = 'email';
|
||||
$passwort = $_POST['passwort'];
|
||||
$email = trim($_POST['email']);
|
||||
$email2 = trim($_POST['email2']);
|
||||
|
||||
if($email != $email2) {
|
||||
$error_msg = "Die eingegebenen E-Mail-Adressen stimmten nicht überein.";
|
||||
$error_msg = "Die eingegebenen E-Mail-Adressen stimmten nicht überein.";
|
||||
} else if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$error_msg = "Bitte eine gültige E-Mail-Adresse eingeben.";
|
||||
$error_msg = "Bitte eine gültige E-Mail-Adresse eingeben.";
|
||||
} else if(!password_verify($passwort, $user['passwort'])) {
|
||||
$error_msg = "Bitte korrektes Passwort eingeben.";
|
||||
} else {
|
||||
@@ -51,13 +55,31 @@ if(isset($_GET['save'])) {
|
||||
$success_msg = "E-Mail-Adresse erfolgreich gespeichert.";
|
||||
}
|
||||
|
||||
} else if($save == 'impfworkflow_notification') {
|
||||
$activeTab = 'impfworkflow';
|
||||
$benachrichtigungEmail = trim((string)($_POST['benachrichtigung_email'] ?? ''));
|
||||
|
||||
if ($benachrichtigungEmail !== '' && !filter_var($benachrichtigungEmail, FILTER_VALIDATE_EMAIL)) {
|
||||
$error_msg = "Bitte eine gueltige E-Mail-Adresse fuer die Impfworkflow-Benachrichtigung eingeben.";
|
||||
} else {
|
||||
try {
|
||||
impfWorkflowNotificationSetEmail($pdo, $benachrichtigungEmail);
|
||||
$success_msg = ($benachrichtigungEmail !== '')
|
||||
? "Impfworkflow-Benachrichtigungsadresse gespeichert."
|
||||
: "Impfworkflow-Benachrichtigungsadresse geloescht.";
|
||||
} catch (Throwable $e) {
|
||||
$error_msg = "Die Impfworkflow-Benachrichtigungsadresse konnte nicht gespeichert werden: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
} else if($save == 'passwort') {
|
||||
$activeTab = 'passwort';
|
||||
$passwortAlt = $_POST['passwortAlt'];
|
||||
$passwortNeu = trim($_POST['passwortNeu']);
|
||||
$passwortNeu2 = trim($_POST['passwortNeu2']);
|
||||
|
||||
if($passwortNeu != $passwortNeu2) {
|
||||
$error_msg = "Die eingegebenen Passwörter stimmten nicht überein.";
|
||||
$error_msg = "Die eingegebenen Passwörter stimmten nicht überein.";
|
||||
} else if($passwortNeu == "") {
|
||||
$error_msg = "Das Passwort darf nicht leer sein.";
|
||||
} else if(!password_verify($passwortAlt, $user['passwort'])) {
|
||||
@@ -107,14 +129,15 @@ endif;
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#data" aria-controls="home" role="tab" data-toggle="tab">Persönliche Daten</a></li>
|
||||
<li role="presentation"><a href="#email" aria-controls="profile" role="tab" data-toggle="tab">E-Mail</a></li>
|
||||
<li role="presentation"><a href="#passwort" aria-controls="messages" role="tab" data-toggle="tab">Passwort</a></li>
|
||||
<li role="presentation" class="<?php echo ($activeTab === 'data') ? 'active' : ''; ?>"><a href="#data" aria-controls="home" role="tab" data-toggle="tab">Persönliche Daten</a></li>
|
||||
<li role="presentation" class="<?php echo ($activeTab === 'email') ? 'active' : ''; ?>"><a href="#email" aria-controls="profile" role="tab" data-toggle="tab">E-Mail</a></li>
|
||||
<li role="presentation" class="<?php echo ($activeTab === 'impfworkflow') ? 'active' : ''; ?>"><a href="#impfworkflow" aria-controls="impfworkflow" role="tab" data-toggle="tab">Impfworkflow</a></li>
|
||||
<li role="presentation" class="<?php echo ($activeTab === 'passwort') ? 'active' : ''; ?>"><a href="#passwort" aria-controls="messages" role="tab" data-toggle="tab">Passwort</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Persönliche Daten-->
|
||||
<!-- Persönliche Daten-->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="data">
|
||||
<div role="tabpanel" class="tab-pane <?php echo ($activeTab === 'data') ? 'active' : ''; ?>" id="data">
|
||||
<br>
|
||||
<form action="?save=personal_data" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
@@ -139,10 +162,10 @@ endif;
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Änderung der E-Mail-Adresse -->
|
||||
<div role="tabpanel" class="tab-pane" id="email">
|
||||
<!-- Änderung der E-Mail-Adresse -->
|
||||
<div role="tabpanel" class="tab-pane <?php echo ($activeTab === 'email') ? 'active' : ''; ?>" id="email">
|
||||
<br>
|
||||
<p>Zum Änderen deiner E-Mail-Adresse gib bitte dein aktuelles Passwort sowie die neue E-Mail-Adresse ein.</p>
|
||||
<p>Zum Änderen deiner E-Mail-Adresse gib bitte dein aktuelles Passwort sowie die neue E-Mail-Adresse ein.</p>
|
||||
<form action="?save=email" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="inputPasswort" class="col-sm-2 control-label">Passwort</label>
|
||||
@@ -174,10 +197,31 @@ endif;
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Änderung des Passworts -->
|
||||
<div role="tabpanel" class="tab-pane" id="passwort">
|
||||
<div role="tabpanel" class="tab-pane <?php echo ($activeTab === 'impfworkflow') ? 'active' : ''; ?>" id="impfworkflow">
|
||||
<br>
|
||||
<p>Zum Änderen deines Passworts gib bitte dein aktuelles Passwort sowie das neue Passwort ein.</p>
|
||||
<p>Hier hinterlegst du die E-Mail-Adresse, an die spaeter Impfworkflow-Benachrichtigungen gesendet werden sollen.</p>
|
||||
<?php $currentNotificationEmail = impfWorkflowNotificationGetEmail($pdo); ?>
|
||||
<form action="?save=impfworkflow_notification" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="inputImpfworkflowMail" class="col-sm-2 control-label">Benachrichtigungs-E-Mail</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" id="inputImpfworkflowMail" name="benachrichtigung_email" type="email" value="<?php echo htmlentities($currentNotificationEmail); ?>" placeholder="benachrichtigung@praxis.de">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<p class="help-block">Leer lassen, um Benachrichtigungen zu deaktivieren.</p>
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Änderung des Passworts -->
|
||||
<div role="tabpanel" class="tab-pane <?php echo ($activeTab === 'passwort') ? 'active' : ''; ?>" id="passwort">
|
||||
<br>
|
||||
<p>Zum Änderen deines Passworts gib bitte dein aktuelles Passwort sowie das neue Passwort ein.</p>
|
||||
<form action="?save=passwort" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="inputPasswort" class="col-sm-2 control-label">Altes Passwort</label>
|
||||
|
||||
Reference in New Issue
Block a user