Inital
This commit is contained in:
@@ -0,0 +1,762 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Alpha by HTML5 UP
|
||||
html5up.net | @n33co
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<?php
|
||||
|
||||
include('header.php');
|
||||
|
||||
?>
|
||||
<title>Praxis Creutzburg - Impfung Warteliste</title>
|
||||
|
||||
</head>
|
||||
<body >
|
||||
|
||||
<!-- Header -->
|
||||
<header id="header" class="../skel-layers-fixed">
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include('menu.php');
|
||||
include_once("inc/config.inc.php");
|
||||
include_once("inc/functions.inc.php");
|
||||
include_once('inc/functions.impfen.inc.php');
|
||||
if ($con instanceof mysqli) {
|
||||
mysqli_set_charset($con, "utf8mb4");
|
||||
}
|
||||
if (isset($pdo) && $pdo instanceof PDO) {
|
||||
impfWorkflowEnsureTables($pdo);
|
||||
}
|
||||
$zeitOptionenJson = "{}";
|
||||
?>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$mailbetreff = "Ihr Wartelistenplatz für eine Impfung bei Praxis Creutzburg";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!-- Main -->
|
||||
<section id="main" class="container">
|
||||
<?php
|
||||
echo showHeaderpraxis();
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<section class="box special">
|
||||
<h2>Impfwarteliste</h2>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
if(isset($_POST["id"]) || isset($_GET["id"])){
|
||||
|
||||
if(isset($_POST["id"])){
|
||||
$id = mysqli_real_escape_string($con, $_POST["id"]);
|
||||
}else if(isset($_GET["id"])){
|
||||
$id = mysqli_real_escape_string($con, $_GET["id"]);
|
||||
}
|
||||
$queryimpf = mysqli_query($con, "SELECT * FROM warteliste WHERE hash='" . $id . "'");
|
||||
|
||||
if($queryimpf->num_rows == 1){
|
||||
$rowimpf = $queryimpf->fetch_assoc() ;
|
||||
$userid = $rowimpf["userid"];
|
||||
$checked = $rowimpf["checked"];
|
||||
$warteid = $rowimpf["warteid"];
|
||||
$impfenzeitraum = $rowimpf["impfenzeitraum"];
|
||||
//echo $userid;
|
||||
$queryuser = mysqli_query($con, "SELECT * FROM persons WHERE person_id='" . $userid . "'");
|
||||
$rowuser = $queryuser->fetch_assoc();
|
||||
$vorname = $rowuser["vorname"];
|
||||
$nachname = $rowuser["nachname"];
|
||||
$mail = $rowuser["email"];
|
||||
//echo $mail;
|
||||
$tel = $rowuser["tele"];
|
||||
$geburtstag = $rowuser["geburtstag"];
|
||||
$userausgabe = $vorname . " " . $nachname;
|
||||
|
||||
|
||||
// Impfstoff
|
||||
$impfstoff = $rowimpf["impfstoff"];
|
||||
$sqlimpfstoffstring = "SELECT * FROM impfstoff WHERE impfid ='" . $impfstoff . "'";
|
||||
$queryimpfstoff = mysqli_query($con,$sqlimpfstoffstring);
|
||||
$rowimpf = mysqli_fetch_assoc($queryimpfstoff);
|
||||
$impfstofftext = $rowimpf["impfname"];
|
||||
|
||||
|
||||
|
||||
$Patientenart = $rowuser["patientenart"];
|
||||
if($Patientenart == "1"){
|
||||
$Patientenart = "Patient";
|
||||
}else{
|
||||
$Patientenart = "neuer Patient";
|
||||
}
|
||||
$Impfaufklaerung = $rowimpf["Impfaufklaerung"];
|
||||
if($Impfaufklaerung == "1"){
|
||||
$Impfaufklaerung = "Ja";
|
||||
}else{
|
||||
$Impfaufklaerung = "Nein";
|
||||
}
|
||||
$WeitereFragen = $rowimpf["WeitereFragen"];
|
||||
if($WeitereFragen == "1"){
|
||||
$WeitereFragen = "Ja";
|
||||
}else{
|
||||
$WeitereFragen = "Nein";
|
||||
}
|
||||
|
||||
//$mailbetreff = "Ihre Coronaimpfung bei Praxis Creutzburg";
|
||||
|
||||
$Zeitanzeige = $datum . " " . $start . "-" . $ende ;
|
||||
if($checked == 0){
|
||||
echo "<h4>Sie haben Ihren Wartelisten-Eintrag aktuell noch nicht bestätigt!<br><br>Über diese Oberfäche können Sie bei freien Impftermin schneller einen Termin buchen!<br><br>";
|
||||
echo "Sie haben die folgenden Angaben:<br><br>";
|
||||
echo "<h4>Name: $userausgabe</h4>";
|
||||
echo "<h4>Art: $Patientenart</h4>";
|
||||
echo "<h4>Telefon: $tel</h4>";
|
||||
echo "<h4>Impfstoff: $impfstofftext</h4>";
|
||||
echo "<h4>Zeitraum: $impfenzeitraum </h4><br>";
|
||||
|
||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
||||
echo '<input type="hidden" name="warteid" id="warteid" value="'. $warteid .'" />';
|
||||
echo '<input type="hidden" name="aktion" id="aktion" value="2" />';
|
||||
echo '<input type="submit" id="submit" value="Warteplatz ZUSAGEN" />';
|
||||
echo "</form>";
|
||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
||||
echo '<input type="hidden" name="aktion" id="aktion" value="3" />';
|
||||
echo '<input type="hidden" name="warteid" id="warteid" value="'. $warteid .'" />';
|
||||
echo '<input type="submit" id="submit" value="Warteplatz LÖSCHEN!" />';
|
||||
echo "</form>";
|
||||
|
||||
}else if($checked == 1){
|
||||
echo "<h4>Sie haben Ihren Warteplatz bestätigt!</h4><br><b>Vielen Dank!</b><br><br>Sie erhalten von uns automatisch eine Terminanfrage, sobald ein passendes Impfevent geplant wurde.<br><br><br>";
|
||||
echo "Sie haben die folgenden Angaben:<br><br>";
|
||||
echo "<h4>Name: $userausgabe</h4>";
|
||||
echo "<h4>Impfstoff: $impfstofftext</h4><br>";
|
||||
echo "<h4>Wir informieren Sie, sobald ein konkreter Impftermin für Ihren Impfstoff festgelegt wurde.</h4>";
|
||||
echo "Die Terminvergabe erfolgt durch das Praxisteam, sobald eine komplette Impfflasche mit passenden Wartelistenplätzen gefüllt ist.<br><br>";
|
||||
echo "Können Sie Ihren Warteplatz nicht wahrnehmen oder benötigen diesen nicht mehr, dann tragen Sie sich bitte aus:<br>";
|
||||
echo "<form action='". $_SERVER['PHP_SELF'] . "' method=POST>";
|
||||
echo '<input type="hidden" name="aktion" id="aktion" value="3" />';
|
||||
echo '<input type="hidden" name="warteid" id="warteid" value="'. $warteid .'" />';
|
||||
echo '<input type="submit" id="submit" value="Warteplatz LÖSCHEN!" />';
|
||||
echo "</form>";
|
||||
|
||||
|
||||
}else if($checked == 2){
|
||||
echo "<h4>Ihr Warteplatz wurde erfolgreich abgesagt!!</h4><br>Wünschen Sie einen neuen Warteplatz, tragen Sie sich wieder über das Formular ein.<br>";
|
||||
|
||||
|
||||
}else if($checked == 3){
|
||||
echo "<h4>Ihr Warteplatz wurde vom Praxisteam storniert!</h4><br>Wünschen Sie einen neuen Warteplatz, tragen Sie sich wieder über das Formular ein.<br>";
|
||||
|
||||
|
||||
}else if($checked == 4){
|
||||
echo "<h4>Ihr Warteplatz wurde vom Praxisteam storniert!</h4><br>Wünschen Sie einen neuen Warteplatz, tragen Sie sich wieder über das Formular ein.<br>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
echo "<h4>Ihre Warteplatz ist gelöscht.</h4><br>Eine weitere Bearbeitung ist nicht mehr möglich.<br><br>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else if(isset($_POST["submitbox"]) && !isset($_POST["aktion"])){
|
||||
|
||||
|
||||
echo '<h4>Kontrollieren Sie Ihre Angaben!</h4><br>';
|
||||
echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';
|
||||
echo '<table border="0">';
|
||||
// Schleife durch Clemens 15.10.2018
|
||||
$ignoreKeys = ["impfenangebot", "Patientenart", "Impfaufklaerung", "WeitereFragen", "zusammenmit"];
|
||||
foreach ($_POST as $key => $value) {
|
||||
if($key === "submitbox"){
|
||||
continue;
|
||||
}
|
||||
if(in_array($key, $ignoreKeys, true)){
|
||||
echo "<input type=hidden name='".$key."' value='".$value. "'>\n";
|
||||
continue;
|
||||
}
|
||||
if($value !== ""){
|
||||
if($key == "Impfstoff"){
|
||||
$sqlimpfstoffstring = "SELECT * FROM impfstoff WHERE impfid ='" . $value . "' order by sortierung";
|
||||
$queryimpfstoff = mysqli_query($con,$sqlimpfstoffstring);
|
||||
$rowimpf = mysqli_fetch_assoc($queryimpfstoff);
|
||||
$impfstofftext = $rowimpf["impfname"];
|
||||
|
||||
|
||||
echo "<tr><td width=100 valign=top class=fett>$key:</td><td>$impfstofftext</td></tr>\n";
|
||||
echo"<input type=hidden name='".$key."' value='".$value. "'>\n";
|
||||
}else if($key == "impfenzeitraum"){
|
||||
$zeitraumRow = null;
|
||||
if (isset($pdo) && $pdo instanceof PDO) {
|
||||
$zeitraumRow = impfLoadZeitraumById($pdo, (int)$value, true);
|
||||
}
|
||||
$zeitraumText = $zeitraumRow ? $zeitraumRow['label'] : 'Unbekannter Zeitraum';
|
||||
echo "<tr><td width=100 valign=top class=fett>$key:</td><td>$zeitraumText</td></tr>\n";
|
||||
echo"<input type=hidden name='".$key."' value='".$value. "'>\n";
|
||||
}else{
|
||||
echo "<tr><td width=100 valign=top class=fett>$key:</td><td>$value</td></tr>\n";
|
||||
echo"<input type=hidden name='".$key."' value='".$value. "'>\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo '</table>';
|
||||
echo '<input type="hidden" name="aktion" value="1" />';
|
||||
echo '<input type="submit" value="Anfrage abschicken" />';
|
||||
echo '</form >';
|
||||
|
||||
|
||||
}else if(isset($_POST["aktion"])){
|
||||
|
||||
if($_POST["aktion"] == "1"){
|
||||
|
||||
$vorname = mysqli_real_escape_string($con, $_POST["Vorname"] ?? "");
|
||||
$nachname = mysqli_real_escape_string($con, $_POST["Name"] ?? "");
|
||||
$geburtstag = mysqli_real_escape_string($con, $_POST["Geburtsjahr"] ?? "");
|
||||
$Email = mysqli_real_escape_string($con, $_POST["Email"] ?? "");
|
||||
$tele = mysqli_real_escape_string($con, $_POST["Tel"] ?? "");
|
||||
$plz = mysqli_real_escape_string($con, $_POST["plz"] ?? "");
|
||||
$ort = mysqli_real_escape_string($con, $_POST["ort"] ?? "");
|
||||
$strasse = mysqli_real_escape_string($con, $_POST["strasse"] ?? "");
|
||||
$impfenangebotstring = $_POST["impfenangebot"] ?? "I";
|
||||
$impfstoff = (int)($_POST["Impfstoff"] ?? 0);
|
||||
$Patientenartstring = mysqli_real_escape_string($con, $_POST["Patientenart"] ?? "Neupatient");
|
||||
$Impfaufklaerung = mysqli_real_escape_string($con, $_POST["Impfaufklaerung"] ?? "Nein");
|
||||
$WeitereFragen = mysqli_real_escape_string($con, $_POST["WeitereFragen"] ?? "Nein");
|
||||
$impfenmit = mysqli_real_escape_string($con, $_POST["zusammenmit"] ?? "");
|
||||
$impfenzeitraumId = (int)($_POST["impfenzeitraum"] ?? 0);
|
||||
$impfart = (int)($_POST["impfart"] ?? 0);
|
||||
$letzteimpfung = trim($_POST["letzteimpfung"] ?? "");
|
||||
|
||||
if ($impfstoff <= 0 || $impfart <= 0 || $impfenzeitraumId <= 0) {
|
||||
echo "<h3>Pflichtfelder fehlen</h3><br>Bitte wählen Sie Impfstoff, Zeitraum und Impfungsart aus.<br><br>";
|
||||
goto end_aktion_1;
|
||||
}
|
||||
|
||||
if ($impfart > 1 && $letzteimpfung === "") {
|
||||
echo "<h3>Letzte Impfung fehlt</h3><br>Bitte geben Sie das Datum der letzten Impfung an.<br><br>";
|
||||
goto end_aktion_1;
|
||||
}
|
||||
|
||||
if ($impfart === 1) {
|
||||
$letzteimpfung = "";
|
||||
}
|
||||
|
||||
$zeitraumRow = (isset($pdo) && $pdo instanceof PDO) ? impfLoadZeitraumById($pdo, $impfenzeitraumId, true) : null;
|
||||
if (!$zeitraumRow || !in_array($impfstoff, $zeitraumRow['impfstoff_id_list'] ?? [], true)) {
|
||||
echo "<h3>Ungültiger Zeitraum</h3><br>Bitte wählen Sie einen gültigen Zeitraum für den ausgewählten Impfstoff.<br><br>";
|
||||
goto end_aktion_1;
|
||||
}
|
||||
$impfenzeitraum = mysqli_real_escape_string($con, $zeitraumRow['label']);
|
||||
|
||||
|
||||
//echo $impfenmit;
|
||||
if($impfenangebotstring == "S"){
|
||||
$impfenangebot = 2;
|
||||
}else if($impfenangebotstring == "I"){
|
||||
$impfenangebot = 1;
|
||||
}else{
|
||||
$impfenangebot = 1;
|
||||
}
|
||||
|
||||
// Impfstoff
|
||||
//$impfstoff = $rowtime["impfstoff"];
|
||||
$sqlimpfstoffstring = "SELECT * FROM impfstoff WHERE impfid ='" . $impfstoff . "'";
|
||||
$queryimpfstoff = mysqli_query($con,$sqlimpfstoffstring);
|
||||
$rowimpf = mysqli_fetch_assoc($queryimpfstoff);
|
||||
$impfstofftext = $rowimpf["impfname"];
|
||||
|
||||
|
||||
|
||||
if($Patientenartstring == "Patient"){
|
||||
$Patientenart = 1;
|
||||
}else{
|
||||
$Patientenart = 0;
|
||||
}
|
||||
$Impfaufklaerung = mysqli_real_escape_string($con, $Impfaufklaerung);
|
||||
if($Impfaufklaerung == "Ja"){
|
||||
$Impfaufklaerung = 1;
|
||||
}else{
|
||||
$Impfaufklaerung = 0;
|
||||
}
|
||||
$WeitereFragen = mysqli_real_escape_string($con, $WeitereFragen);
|
||||
if($WeitereFragen == "Ja"){
|
||||
$WeitereFragen = 1;
|
||||
}else{
|
||||
$WeitereFragen = 0;
|
||||
}
|
||||
|
||||
$sendmail = false;
|
||||
|
||||
$userid = Userspeichern(
|
||||
$vorname,
|
||||
$nachname,
|
||||
$geburtstag,
|
||||
$Email,
|
||||
$tele,
|
||||
$ort,
|
||||
$plz,
|
||||
$strasse,
|
||||
0,
|
||||
$Patientenart,
|
||||
0
|
||||
);
|
||||
|
||||
$hashvorher = $vorname . $nachname . $Email;
|
||||
$hash = md5($hashvorher) . date("Ymd");
|
||||
|
||||
$letzteimpfungSql = ($letzteimpfung !== "") ? ("'" . mysqli_real_escape_string($con, $letzteimpfung) . "'") : "NULL";
|
||||
$query = mysqli_query($con, "SELECT * FROM warteliste WHERE userid='" . (int)$userid . "'");
|
||||
if($query && $query->num_rows == 0){
|
||||
$query = mysqli_query($con, "INSERT INTO warteliste (userid, hash, impfenangebot, impfstoff, Patientenart,Impfaufklaerung, WeitereFragen, date_created, impfenmit, impfenzeitraum, impfart, letzteimpfung, checked) VALUES ('". (int)$userid ."', '".$hash."', '".$impfenangebot."', '".$impfstoff."', '".$Patientenart."', '".$Impfaufklaerung."', '".$WeitereFragen."', now(), '".$impfenmit."', '".$impfenzeitraum."', '".$impfart."', ".$letzteimpfungSql.", '0')");
|
||||
if($query){
|
||||
$warteid = mysqli_insert_id($con);
|
||||
SendMailMessageVorlage($pdo, "2", $warteid , "8" );
|
||||
echo "<h3>Nachricht abgeschickt!</h3><br>Sie müssen die Eintragung in der Warteliste noch bestätigen!<br>Überprüfen Sie auch Ihren Spam-Filter!<br><br>";
|
||||
}else{
|
||||
echo "<h3>Speicherung nicht erfolgreich</h3><br>Ihre Anfrage konnte nicht gespeichert werden.<br>Nutzen Sie das Formular erneut<br><br>";
|
||||
}
|
||||
}else{
|
||||
echo "<h3>Kein Versand!</h3><h4>Dieser Benutzer ist schon in unserer Warteliste eingetragen. Eine Doppelbuchung ist nicht möglich!</h4><br><br><br>";
|
||||
}
|
||||
end_aktion_1:
|
||||
|
||||
}else if($_POST["aktion"] == 2){
|
||||
|
||||
$querychecked = mysqli_query($con, "SELECT checked FROM warteliste WHERE warteid='" . $_POST["warteid"] . "'");
|
||||
$rowchecked = $querychecked->fetch_assoc() ;
|
||||
$checked = $rowchecked["checked"];
|
||||
|
||||
if($checked >= 1){
|
||||
echo "<h4>Sie haben Ihren Termin schon bestätigt.</h4>";
|
||||
|
||||
}else{
|
||||
$query = mysqli_query($con, "Update warteliste SET checked='1' WHERE warteid ='".$_POST["warteid"]."'");
|
||||
if($query){
|
||||
echo "<h4>Ihr Termin wurde erfolgreich bestätigt!<h4><br>";
|
||||
echo "Sie erhalten gleiche eine schriftliche Bestätigung per E-Mail<br>";
|
||||
|
||||
|
||||
$queryimpf = mysqli_query($con, "SELECT * FROM warteliste WHERE warteid='" . $_POST["warteid"] . "'");
|
||||
|
||||
$rowimpf = $queryimpf->fetch_assoc() ;
|
||||
$userid = $rowimpf["userid"];
|
||||
$checked = $rowimpf["checked"];
|
||||
$warteid = $rowimpf["warteid"];
|
||||
$timeid = $rowimpf["timeid"];
|
||||
//echo $userid;
|
||||
$queryuser = mysqli_query($con, "SELECT * FROM persons WHERE person_id='" . $userid . "'");
|
||||
$rowuser = $queryuser->fetch_assoc();
|
||||
$vorname = $rowuser["vorname"];
|
||||
$nachname = $rowuser["nachname"];
|
||||
$mail = $rowuser["email"];
|
||||
//echo $mail;
|
||||
$tel = $rowuser["tele"];
|
||||
$geburtstag = $rowuser["geburtstag"];
|
||||
$userausgabe = $vorname . " " . $nachname;
|
||||
|
||||
SendMailMessageVorlage($pdo, "2", $warteid , "9" );
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}else if($_POST["aktion"] == 3){
|
||||
$querychecked = mysqli_query($con, "SELECT checked FROM warteliste WHERE warteid='" . $_POST["warteid"] . "'");
|
||||
$rowchecked = $querychecked->fetch_assoc() ;
|
||||
$checked = $rowchecked["checked"];
|
||||
if($checked >= 2){
|
||||
echo "<h4>Sie haben Ihren Warteplatz schon abgesagt.</h4>";
|
||||
|
||||
}else{
|
||||
$queryimpf = mysqli_query($con, "SELECT * FROM warteliste WHERE warteid='" . $_POST["warteid"] . "'");
|
||||
$rowimpf = $queryimpf->fetch_assoc() ;
|
||||
SendMailMessageVorlage($pdo, "2", $_POST["warteid"], "10" );
|
||||
$query = mysqli_query($con, "DELETE FROM warteliste WHERE warteid ='".$_POST["warteid"]."'");
|
||||
if($query){
|
||||
echo "<h4>Ihr Warteplatz wurde erfolgreich gelöscht!<h4><br>";
|
||||
echo "Sie erhalten gleiche eine schriftliche Bestätigung per E-Mail<br>";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}else if($_POST["aktion"] == 4){
|
||||
|
||||
$timeid = mysqli_real_escape_string($con, $_POST["Terminzeitraum"]);
|
||||
//echo $timeid ;
|
||||
//echo "<br>";
|
||||
|
||||
$warteid = mysqli_real_escape_string($con, $_POST["warteid"]);
|
||||
//echo $warteid ;
|
||||
$query = mysqli_query($con, "SELECT impfdosen FROM timeslots WHERE timeid ='". $timeid ."'");
|
||||
$row = $query->fetch_assoc();
|
||||
$dosenanzahl = $row["impfdosen"];
|
||||
if($dosenanzahl >= 1){
|
||||
$queryuser = mysqli_query($con, "SELECT userid, hash, warteid, impfart FROM warteliste WHERE warteid='" . $warteid . "'");
|
||||
$row = mysqli_fetch_assoc($queryuser);
|
||||
$userid = $row['userid'];
|
||||
$warteid = $row['warteid'];
|
||||
$hash = $row['hash'];
|
||||
$impfartwarte = (int)($row['impfart'] ?? 1);
|
||||
$datestring = date("Y-m-d");
|
||||
$query = mysqli_query($con, "SELECT * FROM impftermin INNER JOIN timeslots ON impftermin.timeid = timeslots.timeid WHERE userid='". $userid ."' AND date >= '". $datestring ."' AND checked IN ('0','1')");
|
||||
|
||||
if($query->num_rows == 0){
|
||||
$queryinsert = mysqli_query($con, "INSERT INTO impftermin (userid, timeid, hash, coronafragen, astraok, impfart, checked, behandelt) VALUES ('".$userid."', '".$timeid."', '".$hash."', '0', '1', '".$impfartwarte."', '0', '0')");
|
||||
|
||||
if($queryinsert){
|
||||
//echo "Select terminid FROM impftermin WHERE userid='" . $userid . "' AND timeid='" . $timeid . "'";
|
||||
$querytermin = mysqli_query($con, "Select terminid FROM impftermin WHERE userid='" . $userid . "' AND timeid='" . $timeid . "'");
|
||||
$rowtermin = mysqli_fetch_assoc($querytermin);
|
||||
$terminid = $rowtermin["terminid"];
|
||||
$query = mysqli_query($con, "Select impfdosen FROM timeslots WHERE timeid='".$timeid."'");
|
||||
$row = mysqli_fetch_assoc($query);
|
||||
$dosen = $row["impfdosen"] - 1;
|
||||
$query = mysqli_query($con, "Update timeslots SET impfdosen='".$dosen ."' WHERE timeid ='".$timeid."'");
|
||||
if($query){
|
||||
echo "<h4>Mail wird gleich versendet!</h4>";
|
||||
echo "<br>Überprüfen Sie auch Ihren SPAM Ordner!<br>";
|
||||
SendMailMessageVorlage($pdo, "1", (int)$terminid, "1" );
|
||||
|
||||
|
||||
$query = mysqli_query($con, "DELETE FROM warteliste WHERE warteid ='".$warteid."'");
|
||||
}else{
|
||||
echo "<h4>Fehler bei Speichern der Anfragen!</h4>";
|
||||
echo "<br>Versuchen Sie es später erneut!<br>";
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
echo "<h3>Kein Versand!</h3><h4>Dieser Benutzer hat schon einen Termin eingetragen. Eine Doppelbuchung ist nicht möglich!</h4>
|
||||
<br><b>Achtung!</b> Sagen Sie Ihren Termin ab können Sie eine Woche keinen neuen Termin erhalten.<br>
|
||||
Haben Sie Ihren Termin abgesagt, können Sie sieben Tage keinen neuen Termin beantragen!
|
||||
<br><br><br>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
echo "<h4>Kein Termin mehr frei!</h4>";
|
||||
echo "<br>Aktuell ist zu diesem Zeitabschnitt keine Impfung mehr möglich!<br>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}else{
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="12u">
|
||||
|
||||
<section class="box" id="box" >
|
||||
<h3>Impfwillig? </h3>
|
||||
|
||||
|
||||
Sie wollen sich impfen lassen?<br>Schnell und unkompliziert? <br>
|
||||
Melden Sie sich unverbindlich auf unserer Warteliste an. Sollten wir entsprechend wieder Impfstoff vorrätig haben, dann bekommen Sie eine Information per E-Mail.
|
||||
<br><br>
|
||||
|
||||
<?php
|
||||
$zeitOptionenByImpfstoff = [];
|
||||
$verfuegbareImpfstoffe = [];
|
||||
if (isset($pdo) && $pdo instanceof PDO) {
|
||||
$stImpfstoffe = $pdo->prepare("SELECT r.impfstoff_id, i.impfname
|
||||
FROM impfstoff_workflow r
|
||||
INNER JOIN impfstoff i ON i.impfid = r.impfstoff_id
|
||||
WHERE r.dosen_pro_flasche > 0
|
||||
ORDER BY i.impfname");
|
||||
$stImpfstoffe->execute();
|
||||
foreach ($stImpfstoffe->fetchAll(PDO::FETCH_ASSOC) as $impfstoffRow) {
|
||||
$verfuegbareImpfstoffe[(int)$impfstoffRow['impfstoff_id']] = (string)$impfstoffRow['impfname'];
|
||||
}
|
||||
|
||||
$zeitraeumeByImpfstoff = impfGetZeitraeumeByImpfstoff($pdo, true);
|
||||
foreach ($zeitraeumeByImpfstoff as $iid => $zeitraeume) {
|
||||
foreach ($zeitraeume as $zeitraum) {
|
||||
if (!isset($verfuegbareImpfstoffe[$iid])) {
|
||||
continue;
|
||||
}
|
||||
if (!isset($zeitOptionenByImpfstoff[$iid])) {
|
||||
$zeitOptionenByImpfstoff[$iid] = [];
|
||||
}
|
||||
$zeitOptionenByImpfstoff[$iid][] = [
|
||||
'id' => (int)$zeitraum['zeitraum_id'],
|
||||
'label' => (string)$zeitraum['label'],
|
||||
];
|
||||
}
|
||||
}
|
||||
foreach ($verfuegbareImpfstoffe as $iid => $impfname) {
|
||||
if (empty($zeitOptionenByImpfstoff[$iid])) {
|
||||
unset($verfuegbareImpfstoffe[$iid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$zeitOptionenJson = json_encode($zeitOptionenByImpfstoff, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Form -->
|
||||
|
||||
|
||||
<h3 align="center">Anmeldung</h3>
|
||||
|
||||
Füllen Sie das Formular für jede anzumeldende Person einzeln aus: <br><br>
|
||||
|
||||
<!--<br>Es werden nur die ersten beiden Buchstaben Ihres Vor- und Nachnamens sowie Ihr Geburtsdatum elektronisch einfach verschlüsselt übermittelt.-->
|
||||
|
||||
<?php echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';?>
|
||||
<div class="row uniform 50%">
|
||||
<div class="6u 12u(3)">
|
||||
<label for="vorname">Vorname:</label>
|
||||
<input type="text" name="Vorname" id="Vorname" size=12 maxlength="30"value="" placeholder="Vorname" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="Name">Nachname:</label>
|
||||
<input type="text"name="Name" size=12 maxlength="30" placeholder="Name" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="Email">E-Mail:</label>
|
||||
<input type="email" name="Email" id="Email" value="" placeholder="Email" required />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$mintimegeburtstag = strtotime("-5 year", time());
|
||||
$mindategeburtstag = date("Y-m-d", $mintimegeburtstag);
|
||||
|
||||
?>
|
||||
|
||||
<div class="6u 12u(3)">
|
||||
<label for="Tel">Telefon:</label>
|
||||
<input type="text" name="Tel" size=4 maxlength="15" id="" value="" placeholder="Telefon" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="plz">PLZ:</label>
|
||||
<input type="text" name="plz" size=4 maxlength="5" id="" value="" placeholder="PLZ" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="ort">Ort:</label>
|
||||
<input type="text" name="ort" size=4 maxlength="50" id="" value="" placeholder="Ort" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="strasse">Straße:</label>
|
||||
<input type="text" name="strasse" size=4 maxlength="50" id="" value="" placeholder="Straße" required />
|
||||
</div>
|
||||
<div class="6u 12u(3)">
|
||||
<label for="Geburtsjahr">Geburtstag:</label>
|
||||
<input type="date" class="input" name="Geburtsjahr" id="" value="" max="<?php echo $mindategeburtstag; ?>" placeholder="Geburtsjahr" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="12u">
|
||||
|
||||
<label for="AstraImpfung">Ich möchte mich mit dem folgenden Impfstoff impfen lassen:</label>
|
||||
<div class="select-wrapper">
|
||||
<select name="Impfstoff" id="AstraImpfung" required onchange="updateZeitfenster()" <?php echo empty($verfuegbareImpfstoffe) ? 'disabled' : ''; ?>>
|
||||
<?php if (empty($verfuegbareImpfstoffe)): ?>
|
||||
<option value="">- Aktuell keine Impfstoffe verfügbar -</option>
|
||||
<?php else: ?>
|
||||
<option value="">- Bitte auswählen -</option>
|
||||
<?php foreach ($verfuegbareImpfstoffe as $impfid => $impfstofftext): ?>
|
||||
<option value="<?php echo (int)$impfid; ?>"><?php echo htmlspecialchars($impfstofftext); ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
|
||||
<div id="AstraInfobox"></div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="12u">
|
||||
<label for="impfenzeitraum">Wählen Sie den möglichen Zeitbereich für den gewählten Impfstoff:</label>
|
||||
<div class="select-wrapper">
|
||||
<select name="impfenzeitraum" id="impfenzeitraum" required disabled onchange="checkZeitraum()">
|
||||
<option value="">- Bitte zuerst Impfstoff auswählen -</option>
|
||||
</select>
|
||||
<div id="Zeitrauminfo"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<label for="impfart">Welche Impfungsart benötigen Sie?</label>
|
||||
<div class="select-wrapper">
|
||||
<select name="impfart" id="impfart" required onchange="checklastImpf()">
|
||||
<option value="">- Bitte auswählen -</option>
|
||||
<option value="1">Erstimpfung</option>
|
||||
<option value="2">Zweitimpfung</option>
|
||||
<option value="3">Drittimpfung</option>
|
||||
<option value="4">Viertimpfung</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div id="letzteimpfung" style="display:none;">
|
||||
|
||||
<label for="lastimpf">Wann war Ihre letzte Impfung?</label>
|
||||
<div class="select-wrapper">
|
||||
<input type="date" class="input" name="letzteimpfung" id="lastimpf" value="" />
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<input type="hidden" name="impfenangebot" value="I" />
|
||||
<input type="hidden" name="Patientenart" value="Neupatient" />
|
||||
<input type="hidden" name="Impfaufklaerung" value="Nein" />
|
||||
<input type="hidden" name="WeitereFragen" value="Nein" />
|
||||
<input type="hidden" name="zusammenmit" value="" />
|
||||
|
||||
<br>
|
||||
<div class="12u">
|
||||
<ul class="actions">
|
||||
<li><input type="submit" name="submitbox" id="submitbox" value="In Warteliste eintragen!" /></li>
|
||||
<li><input type="reset" value="Reset" class="alt" /></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
Impfanfragen werden nur online bearbeitet!<br>
|
||||
Ohne Chipkarte sind seit 1.1.2016 keine Kassendienstleistungen mehr möglich. <br>
|
||||
Kassenleistungen sind an die gesetzlichen Regelungen gebunden. Fragen Sie Ihre Krankenkasse.<br>
|
||||
Datenschutz Belehrung: Elektronische Nachrichten können von Dritten gelesen werden. <br>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
const zeitfensterByImpfstoff = <?php echo $zeitOptionenJson ?: '{}'; ?>;
|
||||
|
||||
function isIE() {
|
||||
return /Trident\/|MSIE/.test(window.navigator.userAgent);
|
||||
}
|
||||
|
||||
function updateZeitfenster() {
|
||||
const impfstoff = document.getElementById('AstraImpfung');
|
||||
const zeitraum = document.getElementById('impfenzeitraum');
|
||||
const zeitraumInfo = document.getElementById('Zeitrauminfo');
|
||||
const submit = document.getElementById('submitbox');
|
||||
const impfstoffId = impfstoff.value;
|
||||
const optionen = zeitfensterByImpfstoff[impfstoffId] || [];
|
||||
|
||||
zeitraum.innerHTML = '';
|
||||
if (!impfstoffId || optionen.length === 0) {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = '';
|
||||
opt.textContent = '- Kein Zeitbereich verfügbar -';
|
||||
zeitraum.appendChild(opt);
|
||||
zeitraum.disabled = true;
|
||||
submit.disabled = true;
|
||||
zeitraumInfo.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const optDefault = document.createElement('option');
|
||||
optDefault.value = '';
|
||||
optDefault.textContent = '- Bitte auswählen -';
|
||||
zeitraum.appendChild(optDefault);
|
||||
optionen.forEach((eintrag) => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = String(eintrag.id || '');
|
||||
opt.textContent = eintrag.label || '';
|
||||
zeitraum.appendChild(opt);
|
||||
});
|
||||
zeitraum.disabled = false;
|
||||
submit.disabled = false;
|
||||
zeitraumInfo.innerHTML = '';
|
||||
}
|
||||
|
||||
function checklastImpf() {
|
||||
const impfart = document.getElementById('impfart');
|
||||
const letzteBox = document.getElementById('letzteimpfung');
|
||||
const letzteInput = document.getElementById('lastimpf');
|
||||
if (impfart.value === "" || impfart.value === "1") {
|
||||
letzteBox.style.display = "none";
|
||||
letzteInput.required = false;
|
||||
letzteInput.value = "";
|
||||
} else {
|
||||
letzteBox.style.display = "block";
|
||||
letzteInput.required = true;
|
||||
}
|
||||
}
|
||||
|
||||
function checkZeitraum() {
|
||||
const info = document.getElementById('Zeitrauminfo');
|
||||
if (document.getElementById('impfenzeitraum').value === "") {
|
||||
info.innerHTML = "";
|
||||
} else {
|
||||
info.innerHTML = '<div style="border:5px solid red; margin: 5px; padding: 5px;">Bitte halten Sie sich den gewählten Zeitraum frei. Die konkrete Terminanfrage erhalten Sie später per E-Mail.</div>';
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (isIE()) {
|
||||
document.getElementById('box').innerHTML = '<div style="border:5px solid red; margin: 5px; padding: 5px;"><h3>Der Internet Explorer unterstützt dieses Formular nicht.<br><b>Bitte nutzen Sie einen alternativen Browser.</b><br>Vielen Dank.</h3></div>';
|
||||
return;
|
||||
}
|
||||
checklastImpf();
|
||||
updateZeitfenster();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
include_once('footer.php');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user