Abgleich mit Live-Daten

This commit is contained in:
2026-03-24 14:45:06 +01:00
parent 00077aa09a
commit 211ce11e06
116 changed files with 16602 additions and 16612 deletions
+164 -164
View File
@@ -1,164 +1,164 @@
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
### Togo Termine anlegen
function gototerminanlegung() {
global $pdo;
$statementtermin = $pdo->prepare("SELECT * FROM togo_terminvorgaben");
$statementtermin->execute();
foreach ($statementtermin as $row) {
$togovorgabenid = $row["vorgabenid"];
$togodate = $row["date"];
$togostart = $row["start"];
$togoende = $row["ende"];
$standort = $row["standort"];
$error = $row["error"];
$warning = $row["warning"];
$date = new DateTime();
if($togodate == "Mo"){
$date->modify('next monday');
}elseif($togodate == "Di"){
$$date->modify('next tuesday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Mi"){
$date->modify('next wednesday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Do"){
$date->modify('next thursday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Fr"){
$date->modify('next friday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Sa"){
$date->modify('next saturday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "so"){
$date->modify('next sunday');
#$nextday = date('Y-m-d', $nextTuesday);
}else{
$ausgabedate = "error";
}
$nextday = $date->format('Y-m-d');
$i=0;
while($i < 4){
if($i!=0){
#$nextday = date('Y-m-d', strtotime($nextday .' +7 day'));
// Create a new DateTime object
$currentDate = new DateTime($nextday);
$datetempz = $currentDate->add(new DateInterval('P7D'));
//Get yesterday date
$nextday = $datetempz->format('Y-m-d');
}
$statementuser = $pdo->prepare("SELECT terminid FROM togo_termin WHERE date=:date AND start=:start AND end=:end AND standort=:standort");
$statementuser->execute(array('date' => $nextday , 'start' => $togostart, 'end' => $togoende , 'standort' => $standort ));
$count = $statementuser->rowCount();
if($count == 0){
$insert = $pdo->prepare("INSERT INTO togo_termin (date, start, end,standort,error,warning) VALUES (:date, :start, :end,:standort, :error, :warning)");
$insert->execute(array('date' => $nextday , 'start' => $togostart, 'end' => $togoende , 'standort' => $standort, 'error' => $error , 'warning' => $warning ));
$userid = $pdo->lastInsertId();
}
$i++;
}
}
}
function SendMailMessageSilent($con, $empfaenger, $betreff, $body){
// LOGIN CONFIG AUSLESEN
$queryconfig = mysqli_query($con, "Select * FROM config");
$rowconfig = mysqli_fetch_assoc($queryconfig);
if($queryconfig->num_rows == 1){
$row = mysqli_fetch_assoc($queryconfig);
$userid = $row["mailserver"];
echo $userid;
}
$mailserver = $rowconfig["mailserver"];
$mailUsername = $rowconfig["mailUsername"];
$mailPassword = $rowconfig["mailPassword"];
$mailPort = $rowconfig["mailPort"];
$mailFrom = $rowconfig["mailFrom"];
$mailFromName = $rowconfig["mailFromName"];
$mailSMTPSecure = $rowconfig["mailSMTPSecure"];
$body = iconv('UTF-8', 'CP1252//IGNORE', $body);
$betreff = iconv('UTF-8', 'CP1252//IGNORE', $betreff);
//$mail = new PHPMailer(true);
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
//$mail->Host = 'vwp0583.webpack.hosteurope.de'; // Specify main and backup SMTP servers
$mail->Host = $mailserver;
$mail->SMTPAuth = true; // Enable SMTP authentication
//$mail->Username = 'wp1085322-creutzburg'; // SMTP username
//$mail->Password = 'praxis.cr'; // SMTP password
$mail->Username = $mailUsername;
$mail->Password = $mailPassword;
$mail->SMTPSecure = $mailSMTPSecure; // Enable TLS encryption, `ssl` also accepted
//$mail->Port = 587; // TCP port to connect to
$mail->Port = $mailPort;
//Recipients
$mail->setFrom($mailFrom , $mailFromName);
#$mail->addAddress('ccreutzburg@live.de', 'Joe User'); // Add a recipient
$mail->addAddress($empfaenger); // Name is optional
//$mail->addReplyTo('kontakt@praxis-creutzburg.de', 'Praxis Creutzburg');
//$mail->addBCC('Arzt@praxis-creutzburg.de');
//$mail->addBCC("praxis@balanceacademie.de");
//Attachments
#$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
#$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $betreff;
$mail->Body = $body;
$mail->AltBody = $body;
//$mail->charSet = "UTF-8";
//$mail->Encoding = 'base64';
$mail->send();
} catch (Exception $e) {
}
}
?>
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
### Togo Termine anlegen
function gototerminanlegung() {
global $pdo;
$statementtermin = $pdo->prepare("SELECT * FROM togo_terminvorgaben");
$statementtermin->execute();
foreach ($statementtermin as $row) {
$togovorgabenid = $row["vorgabenid"];
$togodate = $row["date"];
$togostart = $row["start"];
$togoende = $row["ende"];
$standort = $row["standort"];
$error = $row["error"];
$warning = $row["warning"];
$date = new DateTime();
if($togodate == "Mo"){
$date->modify('next monday');
}elseif($togodate == "Di"){
$$date->modify('next tuesday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Mi"){
$date->modify('next wednesday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Do"){
$date->modify('next thursday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Fr"){
$date->modify('next friday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "Sa"){
$date->modify('next saturday');
#$nextday = date('Y-m-d', $nextTuesday);
}elseif($togodate == "so"){
$date->modify('next sunday');
#$nextday = date('Y-m-d', $nextTuesday);
}else{
$ausgabedate = "error";
}
$nextday = $date->format('Y-m-d');
$i=0;
while($i < 4){
if($i!=0){
#$nextday = date('Y-m-d', strtotime($nextday .' +7 day'));
// Create a new DateTime object
$currentDate = new DateTime($nextday);
$datetempz = $currentDate->add(new DateInterval('P7D'));
//Get yesterday date
$nextday = $datetempz->format('Y-m-d');
}
$statementuser = $pdo->prepare("SELECT terminid FROM togo_termin WHERE date=:date AND start=:start AND end=:end AND standort=:standort");
$statementuser->execute(array('date' => $nextday , 'start' => $togostart, 'end' => $togoende , 'standort' => $standort ));
$count = $statementuser->rowCount();
if($count == 0){
$insert = $pdo->prepare("INSERT INTO togo_termin (date, start, end,standort,error,warning) VALUES (:date, :start, :end,:standort, :error, :warning)");
$insert->execute(array('date' => $nextday , 'start' => $togostart, 'end' => $togoende , 'standort' => $standort, 'error' => $error , 'warning' => $warning ));
$userid = $pdo->lastInsertId();
}
$i++;
}
}
}
function SendMailMessageSilent($con, $empfaenger, $betreff, $body){
// LOGIN CONFIG AUSLESEN
$queryconfig = mysqli_query($con, "Select * FROM config");
$rowconfig = mysqli_fetch_assoc($queryconfig);
if($queryconfig->num_rows == 1){
$row = mysqli_fetch_assoc($queryconfig);
$userid = $row["mailserver"];
echo $userid;
}
$mailserver = $rowconfig["mailserver"];
$mailUsername = $rowconfig["mailUsername"];
$mailPassword = $rowconfig["mailPassword"];
$mailPort = $rowconfig["mailPort"];
$mailFrom = $rowconfig["mailFrom"];
$mailFromName = $rowconfig["mailFromName"];
$mailSMTPSecure = $rowconfig["mailSMTPSecure"];
$body = iconv('UTF-8', 'CP1252//IGNORE', $body);
$betreff = iconv('UTF-8', 'CP1252//IGNORE', $betreff);
//$mail = new PHPMailer(true);
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
//$mail->Host = 'vwp0583.webpack.hosteurope.de'; // Specify main and backup SMTP servers
$mail->Host = $mailserver;
$mail->SMTPAuth = true; // Enable SMTP authentication
//$mail->Username = 'wp1085322-creutzburg'; // SMTP username
//$mail->Password = 'praxis.cr'; // SMTP password
$mail->Username = $mailUsername;
$mail->Password = $mailPassword;
$mail->SMTPSecure = $mailSMTPSecure; // Enable TLS encryption, `ssl` also accepted
//$mail->Port = 587; // TCP port to connect to
$mail->Port = $mailPort;
//Recipients
$mail->setFrom($mailFrom , $mailFromName);
#$mail->addAddress('ccreutzburg@live.de', 'Joe User'); // Add a recipient
$mail->addAddress($empfaenger); // Name is optional
//$mail->addReplyTo('kontakt@praxis-creutzburg.de', 'Praxis Creutzburg');
//$mail->addBCC('Arzt@praxis-creutzburg.de');
//$mail->addBCC("praxis@balanceacademie.de");
//Attachments
#$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
#$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $betreff;
$mail->Body = $body;
$mail->AltBody = $body;
//$mail->charSet = "UTF-8";
//$mail->Encoding = 'base64';
$mail->send();
} catch (Exception $e) {
}
}
?>
+5 -5
View File
@@ -1,6 +1,6 @@
<?php
<?php
?>
+36 -36
View File
@@ -1,37 +1,37 @@
<?php
/**
* @package Patientsuche
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
*
*/
include("config.inc.php");
/* retrieve the search term that autocomplete sends */
$term = trim(strip_tags($_GET['term']));
$a_json = array();
$a_json_row = array();
$sql = 'SELECT * FROM persons WHERE vorname LIKE "%' . $term . '%" OR nachname LIKE "%' . $term . '%" OR email LIKE "%' . $term . '%" OR tele LIKE "%' . $term . '%" ORDER BY nachname, vorname ';
foreach ($pdo->query($sql) as $row) {
$userid = stripslashes($row['person_id']);
$name = stripslashes($row['nachname']);
$vorname = stripslashes($row['vorname']);
$geburtstag = stripslashes($row['geburtstag']);
$email = htmlentities(stripslashes($row['email']));
$tele = htmlentities(stripslashes($row['tele']));
$a_json_row["id"] = $userid;
$a_json_row["value"] = $vorname.' '.$name.' - '.$geburtstag.' - '.$email.' - '.$tele;
$a_json_row["label"] = $vorname.' '.$name.' - '.$geburtstag.' - '.$email.' - '.$tele;
array_push($a_json, $a_json_row);
}
// jQuery wants JSON data
echo json_encode($a_json);
<?php
/**
* @package Patientsuche
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
*
*/
include("config.inc.php");
/* retrieve the search term that autocomplete sends */
$term = trim(strip_tags($_GET['term']));
$a_json = array();
$a_json_row = array();
$sql = 'SELECT * FROM persons WHERE vorname LIKE "%' . $term . '%" OR nachname LIKE "%' . $term . '%" OR email LIKE "%' . $term . '%" OR tele LIKE "%' . $term . '%" ORDER BY nachname, vorname ';
foreach ($pdo->query($sql) as $row) {
$userid = stripslashes($row['person_id']);
$name = stripslashes($row['nachname']);
$vorname = stripslashes($row['vorname']);
$geburtstag = stripslashes($row['geburtstag']);
$email = htmlentities(stripslashes($row['email']));
$tele = htmlentities(stripslashes($row['tele']));
$a_json_row["id"] = $userid;
$a_json_row["value"] = $vorname.' '.$name.' - '.$geburtstag.' - '.$email.' - '.$tele;
$a_json_row["label"] = $vorname.' '.$name.' - '.$geburtstag.' - '.$email.' - '.$tele;
array_push($a_json, $a_json_row);
}
// jQuery wants JSON data
echo json_encode($a_json);
?>
+119 -119
View File
@@ -1,120 +1,120 @@
<?php
/**
* @package Patientsuche
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
*
*/
include("config.inc.php");
if(isset($_POST["timeid"])){
$timeid=$_POST["timeid"];
$statementtermin = $pdo->prepare("SELECT impfstoff, date,terminart, ZIminimal, ZImaximal, ZIaktiv, ZIbiontech, ZIastra, ZImoderna FROM timeslots INNER JOIN impfstoff ON timeslots.impfstoff = impfstoff.impfid WHERE timeid = :timeid");
$statementtermin->execute(array('timeid' => $timeid));
$rowtime = $statementtermin->fetch(PDO::FETCH_ASSOC);
$ZIaktiv = $rowtime["ZIaktiv"];
$ZIminimal = $rowtime["ZIminimal"];
$ZImaximal = $rowtime["ZImaximal"];
$ZIbiontech = $rowtime["ZIbiontech"];
$ZIastra = $rowtime["ZIastra"];
$ZImoderna = $rowtime["ZImoderna"];
$impfname = $rowtime["impfname"];
$terminart = $rowtime["terminart"];
$minimaldate = date_create($rowtime["date"]);
date_add($minimaldate, date_interval_create_from_date_string($ZIminimal . ' days'));
$minimaldate = date_format($minimaldate, 'Y-m-d');
$maximaldate = date_create($rowtime["date"]);
date_add($maximaldate, date_interval_create_from_date_string($ZImaximal . ' days'));
$maximaldate = date_format($maximaldate, 'Y-m-d');
$impfstoffstring = "";
$terminartstring = "";
if($ZIaktiv && ($terminart == 1 || $terminart == 0) ){
if($ZIbiontech){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='3'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='3'";
}
}
if($ZIastra){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='2'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='2'";
}
}
if($ZImoderna){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='5'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='5'";
}
}
$impfstoffstring = $impfstoffstring . ")";
$terminartstring = " AND (terminart='1' OR terminart='3' OR terminart='5')";
$statement = $pdo->prepare("SELECT date,start,ende,impfdosen,timeid,impfstoff FROM timeslots WHERE date>= '$minimaldate' AND date<='$maximaldate' AND $impfstoffstring $terminartstring AND impfdosen > 0");
$statement->execute();
$count = $statement->rowCount();
if($count == 0){
echo"<h3>Zweitimpfung</h3><b>Aktuell stehen bei uns keine Termine für die Zweitimpfung zur Verfügung.</b><br>Bitte kümmern Sie sich selbstständig, um einen Termin für die Zweitimpfung.<br>Sobald wir Termine für die Zweitimpfung zur Verfügung haben, finden Sie diese auch auf dieser Webseite.<br><h4>Sehen Sie von weiteren telefonischen Anfragen ab!</h4><br>";
}else{
?>
<div class="select-wrapper">
<label for="Zweitimpfung">Die Zweitimpfung nehme ich am folgenden Termin wahr:</label>
<select name="Zweitimpfung" id="Zweitimpfung" required onchange="checkTerminzeitraumZweit()">
<?php
//echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';
echo '<option value="">- Terminzeitraum </option>';
foreach ($statement as $row) {
$datum = date("d.m.Y", strtotime($row["date"]));
$start = substr($row["start"],0, 5);
$ende = substr($row["ende"],0, 5);
$dosenanzahl = $row["impfdosen"];
$timeid = $row["timeid"];
$impfid = $row["impfstoff"];
$statementtermin = $pdo->prepare("SELECT impfname FROM impfstoff WHERE impfid =:impfid");
$statementtermin->execute(array('impfid' => $impfid));
$rowimpf = $statementtermin->fetch(PDO::FETCH_ASSOC);
$impfstofftext = $rowimpf["impfname"];
$value = "$timeid";
$anzeige = "$datum - $start-$ende - $dosenanzahl Plätze frei - $impfstofftext";
echo '<option value="' . $value . '">' . $anzeige . '</option>';
}
?>
</select>
<div id="TerminzeitrauminfoZweit"></div><br>
<?php
}
}
}
<?php
/**
* @package Patientsuche
* @copyright Copyright (C) 2021 ctb-it.de Inc. All rights reserved.
*
*/
include("config.inc.php");
if(isset($_POST["timeid"])){
$timeid=$_POST["timeid"];
$statementtermin = $pdo->prepare("SELECT impfstoff, date,terminart, ZIminimal, ZImaximal, ZIaktiv, ZIbiontech, ZIastra, ZImoderna FROM timeslots INNER JOIN impfstoff ON timeslots.impfstoff = impfstoff.impfid WHERE timeid = :timeid");
$statementtermin->execute(array('timeid' => $timeid));
$rowtime = $statementtermin->fetch(PDO::FETCH_ASSOC);
$ZIaktiv = $rowtime["ZIaktiv"];
$ZIminimal = $rowtime["ZIminimal"];
$ZImaximal = $rowtime["ZImaximal"];
$ZIbiontech = $rowtime["ZIbiontech"];
$ZIastra = $rowtime["ZIastra"];
$ZImoderna = $rowtime["ZImoderna"];
$impfname = $rowtime["impfname"];
$terminart = $rowtime["terminart"];
$minimaldate = date_create($rowtime["date"]);
date_add($minimaldate, date_interval_create_from_date_string($ZIminimal . ' days'));
$minimaldate = date_format($minimaldate, 'Y-m-d');
$maximaldate = date_create($rowtime["date"]);
date_add($maximaldate, date_interval_create_from_date_string($ZImaximal . ' days'));
$maximaldate = date_format($maximaldate, 'Y-m-d');
$impfstoffstring = "";
$terminartstring = "";
if($ZIaktiv && ($terminart == 1 || $terminart == 0) ){
if($ZIbiontech){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='3'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='3'";
}
}
if($ZIastra){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='2'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='2'";
}
}
if($ZImoderna){
if($impfstoffstring == ""){
$impfstoffstring = $impfstoffstring . "(impfstoff='5'";
}else{
$impfstoffstring = $impfstoffstring . " OR impfstoff='5'";
}
}
$impfstoffstring = $impfstoffstring . ")";
$terminartstring = " AND (terminart='1' OR terminart='3' OR terminart='5')";
$statement = $pdo->prepare("SELECT date,start,ende,impfdosen,timeid,impfstoff FROM timeslots WHERE date>= '$minimaldate' AND date<='$maximaldate' AND $impfstoffstring $terminartstring AND impfdosen > 0");
$statement->execute();
$count = $statement->rowCount();
if($count == 0){
echo"<h3>Zweitimpfung</h3><b>Aktuell stehen bei uns keine Termine für die Zweitimpfung zur Verfügung.</b><br>Bitte kümmern Sie sich selbstständig, um einen Termin für die Zweitimpfung.<br>Sobald wir Termine für die Zweitimpfung zur Verfügung haben, finden Sie diese auch auf dieser Webseite.<br><h4>Sehen Sie von weiteren telefonischen Anfragen ab!</h4><br>";
}else{
?>
<div class="select-wrapper">
<label for="Zweitimpfung">Die Zweitimpfung nehme ich am folgenden Termin wahr:</label>
<select name="Zweitimpfung" id="Zweitimpfung" required onchange="checkTerminzeitraumZweit()">
<?php
//echo '<form action="'. $_SERVER['PHP_SELF'] .'" method=POST>';
echo '<option value="">- Terminzeitraum </option>';
foreach ($statement as $row) {
$datum = date("d.m.Y", strtotime($row["date"]));
$start = substr($row["start"],0, 5);
$ende = substr($row["ende"],0, 5);
$dosenanzahl = $row["impfdosen"];
$timeid = $row["timeid"];
$impfid = $row["impfstoff"];
$statementtermin = $pdo->prepare("SELECT impfname FROM impfstoff WHERE impfid =:impfid");
$statementtermin->execute(array('impfid' => $impfid));
$rowimpf = $statementtermin->fetch(PDO::FETCH_ASSOC);
$impfstofftext = $rowimpf["impfname"];
$value = "$timeid";
$anzeige = "$datum - $start-$ende - $dosenanzahl Plätze frei - $impfstofftext";
echo '<option value="' . $value . '">' . $anzeige . '</option>';
}
?>
</select>
<div id="TerminzeitrauminfoZweit"></div><br>
<?php
}
}
}
?>